Game Driver Metrics: plumb gpu global stats into statsd
This change adds all the necessary binder calls to IGpuService.
Bug: 123529932
Test: adb shell cmd stats pull-source 10054
Change-Id: Ibd5b6d366bece45291e80c63f4270c93b56d963f
diff --git a/services/gpuservice/gpustats/GpuStats.cpp b/services/gpuservice/gpustats/GpuStats.cpp
index c4256df..146e2c2 100644
--- a/services/gpuservice/gpustats/GpuStats.cpp
+++ b/services/gpuservice/gpustats/GpuStats.cpp
@@ -184,4 +184,18 @@
}
}
+void GpuStats::pullGlobalStats(std::vector<GpuStatsGlobalInfo>* outStats) {
+ ATRACE_CALL();
+
+ std::lock_guard<std::mutex> lock(mLock);
+ outStats->clear();
+ outStats->reserve(mGlobalStats.size());
+
+ for (const auto& ele : mGlobalStats) {
+ outStats->emplace_back(ele.second);
+ }
+
+ mGlobalStats.clear();
+}
+
} // namespace android