summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds/statsd/src/atoms.proto9
-rw-r--r--cmds/statsd/src/external/GpuStatsPuller.cpp3
-rw-r--r--cmds/statsd/tests/external/GpuStatsPuller_test.cpp11
3 files changed, 22 insertions, 1 deletions
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 17067daa994d..033dbf7aa4a5 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -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;
}
/**
diff --git a/cmds/statsd/src/external/GpuStatsPuller.cpp b/cmds/statsd/src/external/GpuStatsPuller.cpp
index 3fa932fddd04..876383c16863 100644
--- a/cmds/statsd/src/external/GpuStatsPuller.cpp
+++ b/cmds/statsd/src/external/GpuStatsPuller.cpp
@@ -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);
}
diff --git a/cmds/statsd/tests/external/GpuStatsPuller_test.cpp b/cmds/statsd/tests/external/GpuStatsPuller_test.cpp
index 8625487d1aca..2acfb8354905 100644
--- a/cmds/statsd/tests/external/GpuStatsPuller_test.cpp
+++ b/cmds/statsd/tests/external/GpuStatsPuller_test.cpp
@@ -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) {