From c23fcd04886477f1c8026948ed01f81bca082699 Mon Sep 17 00:00:00 2001 From: Tom Murphy Date: Wed, 13 Mar 2024 10:22:06 +0000 Subject: 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 --- libs/graphicsenv/GraphicsEnv.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libs/graphicsenv/GraphicsEnv.cpp') diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp index 50c05f4e5b..52383acb34 100644 --- a/libs/graphicsenv/GraphicsEnv.cpp +++ b/libs/graphicsenv/GraphicsEnv.cpp @@ -445,6 +445,21 @@ void GraphicsEnv::setVulkanDeviceExtensions(uint32_t enabledExtensionCount, extensionHashes, numStats); } +void GraphicsEnv::addVulkanEngineName(const char* engineName) { + ATRACE_CALL(); + if (engineName == nullptr) { + return; + } + std::lock_guard lock(mStatsLock); + if (!readyToSendGpuStatsLocked()) return; + + const sp 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. -- cgit v1.2.3-59-g8ed1b