Loading cmds/statsd/src/atoms.proto +3 −0 Original line number Original line Diff line number Diff line Loading @@ -6691,6 +6691,9 @@ message GpuStatsAppInfo { // App is not doing pre-rotation correctly. // App is not doing pre-rotation correctly. optional bool false_prerotation = 7; optional bool false_prerotation = 7; // App creates GLESv1 context. optional bool gles_1_in_use = 8; } } /* /* Loading cmds/statsd/src/external/GpuStatsPuller.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -103,6 +103,7 @@ static bool pullGpuStatsAppInfo(const sp<IGpuService>& gpuService, } } if (!event->write(info.cpuVulkanInUse)) return false; if (!event->write(info.cpuVulkanInUse)) return false; if (!event->write(info.falsePrerotation)) return false; if (!event->write(info.falsePrerotation)) return false; if (!event->write(info.gles1InUse)) return false; event->init(); event->init(); data->emplace_back(event); data->emplace_back(event); } } Loading cmds/statsd/tests/external/GpuStatsPuller_test.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -58,8 +58,9 @@ static const int32_t CPU_VULKAN_VERSION = 2; static const int32_t GLES_VERSION = 3; static const int32_t GLES_VERSION = 3; static const bool CPU_VULKAN_IN_USE = true; static const bool CPU_VULKAN_IN_USE = true; static const bool FALSE_PREROTATION = true; static const bool FALSE_PREROTATION = true; static const bool GLES_1_IN_USE = true; static const size_t NUMBER_OF_VALUES_GLOBAL = 13; static const size_t NUMBER_OF_VALUES_GLOBAL = 13; static const size_t NUMBER_OF_VALUES_APP = 7; static const size_t NUMBER_OF_VALUES_APP = 8; // clang-format on // clang-format on class MockGpuStatsPuller : public GpuStatsPuller { class MockGpuStatsPuller : public GpuStatsPuller { Loading Loading @@ -153,6 +154,7 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { EXPECT_TRUE(event->write(int64VectorToProtoByteString(angleDriverLoadingTime))); EXPECT_TRUE(event->write(int64VectorToProtoByteString(angleDriverLoadingTime))); EXPECT_TRUE(event->write(CPU_VULKAN_IN_USE)); EXPECT_TRUE(event->write(CPU_VULKAN_IN_USE)); EXPECT_TRUE(event->write(FALSE_PREROTATION)); EXPECT_TRUE(event->write(FALSE_PREROTATION)); EXPECT_TRUE(event->write(GLES_1_IN_USE)); event->init(); event->init(); inData.emplace_back(event); inData.emplace_back(event); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_APP_INFO, &inData); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_APP_INFO, &inData); Loading @@ -172,6 +174,7 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { outData[0]->getValues()[4].mValue.str_value); outData[0]->getValues()[4].mValue.str_value); EXPECT_EQ(CPU_VULKAN_IN_USE, outData[0]->getValues()[5].mValue.int_value); EXPECT_EQ(CPU_VULKAN_IN_USE, outData[0]->getValues()[5].mValue.int_value); EXPECT_EQ(FALSE_PREROTATION, outData[0]->getValues()[6].mValue.int_value); EXPECT_EQ(FALSE_PREROTATION, outData[0]->getValues()[6].mValue.int_value); EXPECT_EQ(GLES_1_IN_USE, outData[0]->getValues()[7].mValue.int_value); } } } // namespace statsd } // namespace statsd Loading Loading
cmds/statsd/src/atoms.proto +3 −0 Original line number Original line Diff line number Diff line Loading @@ -6691,6 +6691,9 @@ message GpuStatsAppInfo { // App is not doing pre-rotation correctly. // App is not doing pre-rotation correctly. optional bool false_prerotation = 7; optional bool false_prerotation = 7; // App creates GLESv1 context. optional bool gles_1_in_use = 8; } } /* /* Loading
cmds/statsd/src/external/GpuStatsPuller.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -103,6 +103,7 @@ static bool pullGpuStatsAppInfo(const sp<IGpuService>& gpuService, } } if (!event->write(info.cpuVulkanInUse)) return false; if (!event->write(info.cpuVulkanInUse)) return false; if (!event->write(info.falsePrerotation)) return false; if (!event->write(info.falsePrerotation)) return false; if (!event->write(info.gles1InUse)) return false; event->init(); event->init(); data->emplace_back(event); data->emplace_back(event); } } Loading
cmds/statsd/tests/external/GpuStatsPuller_test.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -58,8 +58,9 @@ static const int32_t CPU_VULKAN_VERSION = 2; static const int32_t GLES_VERSION = 3; static const int32_t GLES_VERSION = 3; static const bool CPU_VULKAN_IN_USE = true; static const bool CPU_VULKAN_IN_USE = true; static const bool FALSE_PREROTATION = true; static const bool FALSE_PREROTATION = true; static const bool GLES_1_IN_USE = true; static const size_t NUMBER_OF_VALUES_GLOBAL = 13; static const size_t NUMBER_OF_VALUES_GLOBAL = 13; static const size_t NUMBER_OF_VALUES_APP = 7; static const size_t NUMBER_OF_VALUES_APP = 8; // clang-format on // clang-format on class MockGpuStatsPuller : public GpuStatsPuller { class MockGpuStatsPuller : public GpuStatsPuller { Loading Loading @@ -153,6 +154,7 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { EXPECT_TRUE(event->write(int64VectorToProtoByteString(angleDriverLoadingTime))); EXPECT_TRUE(event->write(int64VectorToProtoByteString(angleDriverLoadingTime))); EXPECT_TRUE(event->write(CPU_VULKAN_IN_USE)); EXPECT_TRUE(event->write(CPU_VULKAN_IN_USE)); EXPECT_TRUE(event->write(FALSE_PREROTATION)); EXPECT_TRUE(event->write(FALSE_PREROTATION)); EXPECT_TRUE(event->write(GLES_1_IN_USE)); event->init(); event->init(); inData.emplace_back(event); inData.emplace_back(event); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_APP_INFO, &inData); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_APP_INFO, &inData); Loading @@ -172,6 +174,7 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { outData[0]->getValues()[4].mValue.str_value); outData[0]->getValues()[4].mValue.str_value); EXPECT_EQ(CPU_VULKAN_IN_USE, outData[0]->getValues()[5].mValue.int_value); EXPECT_EQ(CPU_VULKAN_IN_USE, outData[0]->getValues()[5].mValue.int_value); EXPECT_EQ(FALSE_PREROTATION, outData[0]->getValues()[6].mValue.int_value); EXPECT_EQ(FALSE_PREROTATION, outData[0]->getValues()[6].mValue.int_value); EXPECT_EQ(GLES_1_IN_USE, outData[0]->getValues()[7].mValue.int_value); } } } // namespace statsd } // namespace statsd Loading