Add engine name to GpuStatsAppInfo
The engine name from VkApplicationInfo is useful for collection metrics
on Vulkan usage. Add it to the collected metrics in GpuStatsAppInfo.
Bug: 330118952
Test: adb shell dumpsys gpu
Test: atest GpuStatsTest
Change-Id: If4096b8a96ed77ddb1d2fd9f48c2b8825b3d0280
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index 50c05f4..52383ac 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -445,6 +445,21 @@
extensionHashes, numStats);
}
+void GraphicsEnv::addVulkanEngineName(const char* engineName) {
+ ATRACE_CALL();
+ if (engineName == nullptr) {
+ return;
+ }
+ std::lock_guard<std::mutex> lock(mStatsLock);
+ if (!readyToSendGpuStatsLocked()) return;
+
+ const sp<IGpuService> gpuService = getGpuService();
+ if (gpuService) {
+ gpuService->addVulkanEngineName(mGpuStats.appPackageName, mGpuStats.driverVersionCode,
+ engineName);
+ }
+}
+
bool GraphicsEnv::readyToSendGpuStatsLocked() {
// Only send stats for processes having at least one activity launched and that process doesn't
// skip the GraphicsEnvironment setup.