Loading cmds/statsd/src/atoms.proto +9 −0 Original line number Original line Diff line number Diff line Loading @@ -6131,6 +6131,15 @@ message GpuStatsGlobalInfo { // Total count of the Vulkan driver fails to be loaded. // Total count of the Vulkan driver fails to be loaded. optional int64 vk_loading_failure_count = 8; optional int64 vk_loading_failure_count = 8; // Api version of the system Vulkan driver. optional int32 vulkan_version = 9; // Api version of the system CPU Vulkan driver. optional int32 cpu_vulkan_version = 10; // Api version of the system GLES driver. optional int32 gles_version = 11; } } /** /** Loading cmds/statsd/src/external/GpuStatsPuller.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,9 @@ static bool pullGpuStatsGlobalInfo(const sp<IGpuService>& gpuService, if (!event->write((int64_t)info.glLoadingFailureCount)) return false; if (!event->write((int64_t)info.glLoadingFailureCount)) return false; if (!event->write((int64_t)info.vkLoadingCount)) return false; if (!event->write((int64_t)info.vkLoadingCount)) return false; if (!event->write((int64_t)info.vkLoadingFailureCount)) return false; if (!event->write((int64_t)info.vkLoadingFailureCount)) return false; if (!event->write(info.vulkanVersion)) return false; if (!event->write(info.cpuVulkanVersion)) return false; if (!event->write(info.glesVersion)) return false; event->init(); event->init(); data->emplace_back(event); data->emplace_back(event); } } Loading cmds/statsd/tests/external/GpuStatsPuller_test.cpp +10 −1 Original line number Original line Diff line number Diff line Loading @@ -48,7 +48,10 @@ static const int64_t GL_DRIVER_LOADING_TIME_1 = 666; static const int64_t VK_DRIVER_LOADING_TIME_0 = 777; static const int64_t VK_DRIVER_LOADING_TIME_0 = 777; static const int64_t VK_DRIVER_LOADING_TIME_1 = 888; static const int64_t VK_DRIVER_LOADING_TIME_1 = 888; static const int64_t VK_DRIVER_LOADING_TIME_2 = 999; static const int64_t VK_DRIVER_LOADING_TIME_2 = 999; static const size_t NUMBER_OF_VALUES_GLOBAL = 8; static const int32_t VULKAN_VERSION = 1; static const int32_t CPU_VULKAN_VERSION = 2; static const int32_t GLES_VERSION = 3; static const size_t NUMBER_OF_VALUES_GLOBAL = 11; static const size_t NUMBER_OF_VALUES_APP = 4; static const size_t NUMBER_OF_VALUES_APP = 4; // clang-format on // clang-format on Loading Loading @@ -93,6 +96,9 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsGlobalInfo) { EXPECT_TRUE(event->write(GL_LOADING_FAILURE_COUNT)); EXPECT_TRUE(event->write(GL_LOADING_FAILURE_COUNT)); EXPECT_TRUE(event->write(VK_LOADING_COUNT)); EXPECT_TRUE(event->write(VK_LOADING_COUNT)); EXPECT_TRUE(event->write(VK_LOADING_FAILURE_COUNT)); EXPECT_TRUE(event->write(VK_LOADING_FAILURE_COUNT)); EXPECT_TRUE(event->write(VULKAN_VERSION)); EXPECT_TRUE(event->write(CPU_VULKAN_VERSION)); EXPECT_TRUE(event->write(GLES_VERSION)); event->init(); event->init(); inData.emplace_back(event); inData.emplace_back(event); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_GLOBAL_INFO, &inData); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_GLOBAL_INFO, &inData); Loading @@ -110,6 +116,9 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsGlobalInfo) { EXPECT_EQ(GL_LOADING_FAILURE_COUNT, outData[0]->getValues()[5].mValue.long_value); EXPECT_EQ(GL_LOADING_FAILURE_COUNT, outData[0]->getValues()[5].mValue.long_value); EXPECT_EQ(VK_LOADING_COUNT, outData[0]->getValues()[6].mValue.long_value); EXPECT_EQ(VK_LOADING_COUNT, outData[0]->getValues()[6].mValue.long_value); EXPECT_EQ(VK_LOADING_FAILURE_COUNT, outData[0]->getValues()[7].mValue.long_value); EXPECT_EQ(VK_LOADING_FAILURE_COUNT, outData[0]->getValues()[7].mValue.long_value); EXPECT_EQ(VULKAN_VERSION, outData[0]->getValues()[8].mValue.int_value); EXPECT_EQ(CPU_VULKAN_VERSION, outData[0]->getValues()[9].mValue.int_value); EXPECT_EQ(GLES_VERSION, outData[0]->getValues()[10].mValue.int_value); } } TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { Loading Loading
cmds/statsd/src/atoms.proto +9 −0 Original line number Original line Diff line number Diff line Loading @@ -6131,6 +6131,15 @@ message GpuStatsGlobalInfo { // Total count of the Vulkan driver fails to be loaded. // Total count of the Vulkan driver fails to be loaded. optional int64 vk_loading_failure_count = 8; optional int64 vk_loading_failure_count = 8; // Api version of the system Vulkan driver. optional int32 vulkan_version = 9; // Api version of the system CPU Vulkan driver. optional int32 cpu_vulkan_version = 10; // Api version of the system GLES driver. optional int32 gles_version = 11; } } /** /** Loading
cmds/statsd/src/external/GpuStatsPuller.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,9 @@ static bool pullGpuStatsGlobalInfo(const sp<IGpuService>& gpuService, if (!event->write((int64_t)info.glLoadingFailureCount)) return false; if (!event->write((int64_t)info.glLoadingFailureCount)) return false; if (!event->write((int64_t)info.vkLoadingCount)) return false; if (!event->write((int64_t)info.vkLoadingCount)) return false; if (!event->write((int64_t)info.vkLoadingFailureCount)) return false; if (!event->write((int64_t)info.vkLoadingFailureCount)) return false; if (!event->write(info.vulkanVersion)) return false; if (!event->write(info.cpuVulkanVersion)) return false; if (!event->write(info.glesVersion)) return false; event->init(); event->init(); data->emplace_back(event); data->emplace_back(event); } } Loading
cmds/statsd/tests/external/GpuStatsPuller_test.cpp +10 −1 Original line number Original line Diff line number Diff line Loading @@ -48,7 +48,10 @@ static const int64_t GL_DRIVER_LOADING_TIME_1 = 666; static const int64_t VK_DRIVER_LOADING_TIME_0 = 777; static const int64_t VK_DRIVER_LOADING_TIME_0 = 777; static const int64_t VK_DRIVER_LOADING_TIME_1 = 888; static const int64_t VK_DRIVER_LOADING_TIME_1 = 888; static const int64_t VK_DRIVER_LOADING_TIME_2 = 999; static const int64_t VK_DRIVER_LOADING_TIME_2 = 999; static const size_t NUMBER_OF_VALUES_GLOBAL = 8; static const int32_t VULKAN_VERSION = 1; static const int32_t CPU_VULKAN_VERSION = 2; static const int32_t GLES_VERSION = 3; static const size_t NUMBER_OF_VALUES_GLOBAL = 11; static const size_t NUMBER_OF_VALUES_APP = 4; static const size_t NUMBER_OF_VALUES_APP = 4; // clang-format on // clang-format on Loading Loading @@ -93,6 +96,9 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsGlobalInfo) { EXPECT_TRUE(event->write(GL_LOADING_FAILURE_COUNT)); EXPECT_TRUE(event->write(GL_LOADING_FAILURE_COUNT)); EXPECT_TRUE(event->write(VK_LOADING_COUNT)); EXPECT_TRUE(event->write(VK_LOADING_COUNT)); EXPECT_TRUE(event->write(VK_LOADING_FAILURE_COUNT)); EXPECT_TRUE(event->write(VK_LOADING_FAILURE_COUNT)); EXPECT_TRUE(event->write(VULKAN_VERSION)); EXPECT_TRUE(event->write(CPU_VULKAN_VERSION)); EXPECT_TRUE(event->write(GLES_VERSION)); event->init(); event->init(); inData.emplace_back(event); inData.emplace_back(event); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_GLOBAL_INFO, &inData); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_GLOBAL_INFO, &inData); Loading @@ -110,6 +116,9 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsGlobalInfo) { EXPECT_EQ(GL_LOADING_FAILURE_COUNT, outData[0]->getValues()[5].mValue.long_value); EXPECT_EQ(GL_LOADING_FAILURE_COUNT, outData[0]->getValues()[5].mValue.long_value); EXPECT_EQ(VK_LOADING_COUNT, outData[0]->getValues()[6].mValue.long_value); EXPECT_EQ(VK_LOADING_COUNT, outData[0]->getValues()[6].mValue.long_value); EXPECT_EQ(VK_LOADING_FAILURE_COUNT, outData[0]->getValues()[7].mValue.long_value); EXPECT_EQ(VK_LOADING_FAILURE_COUNT, outData[0]->getValues()[7].mValue.long_value); EXPECT_EQ(VULKAN_VERSION, outData[0]->getValues()[8].mValue.int_value); EXPECT_EQ(CPU_VULKAN_VERSION, outData[0]->getValues()[9].mValue.int_value); EXPECT_EQ(GLES_VERSION, outData[0]->getValues()[10].mValue.int_value); } } TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { Loading