Merge "GpuStats: add render api versions to global stats" into qt-dev am: 7d35c0d901

am: eb3adbaedd

Change-Id: I6295bd4d8c24a14202fa5fb8a32b075131c90804
This commit is contained in:
Yiwei Zhang
2019-05-07 20:39:04 -07:00
committed by android-build-merger
3 changed files with 22 additions and 1 deletions

View File

@@ -6131,6 +6131,15 @@ message GpuStatsGlobalInfo {
// Total count of the Vulkan driver fails to be loaded.
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;
}
/**

View File

@@ -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.vkLoadingCount)) 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();
data->emplace_back(event);
}

View File

@@ -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_1 = 888;
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;
// clang-format on
@@ -93,6 +96,9 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsGlobalInfo) {
EXPECT_TRUE(event->write(GL_LOADING_FAILURE_COUNT));
EXPECT_TRUE(event->write(VK_LOADING_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();
inData.emplace_back(event);
MockGpuStatsPuller mockPuller(android::util::GPU_STATS_GLOBAL_INFO, &inData);
@@ -110,6 +116,9 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsGlobalInfo) {
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_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) {