summaryrefslogtreecommitdiff
path: root/libs/graphicsenv/IGpuService.cpp
diff options
context:
space:
mode:
author Yiwei Zhang <zzyiwei@google.com> 2019-02-27 16:35:37 -0800
committer Yiwei Zhang <zzyiwei@google.com> 2019-03-01 22:44:10 -0800
commitbaea97ff9e574203903a6b54d3d35ab36f00f7d5 (patch)
tree0d400d289d4857068294af00a5d8e8de7897936f /libs/graphicsenv/IGpuService.cpp
parentf40fb10f1dfbbc17edbd15ee102d772dd1df6adf (diff)
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
Diffstat (limited to 'libs/graphicsenv/IGpuService.cpp')
-rw-r--r--libs/graphicsenv/IGpuService.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/libs/graphicsenv/IGpuService.cpp b/libs/graphicsenv/IGpuService.cpp
index f755e00067..0b0bf445ae 100644
--- a/libs/graphicsenv/IGpuService.cpp
+++ b/libs/graphicsenv/IGpuService.cpp
@@ -46,6 +46,27 @@ public:
remote()->transact(BnGpuService::SET_GPU_STATS, data, &reply, IBinder::FLAG_ONEWAY);
}
+
+ virtual status_t getGpuStatsGlobalInfo(std::vector<GpuStatsGlobalInfo>* outStats) const {
+ if (!outStats) return UNEXPECTED_NULL;
+
+ Parcel data, reply;
+ status_t status;
+
+ if ((status = data.writeInterfaceToken(IGpuService::getInterfaceDescriptor())) != OK)
+ return status;
+
+ if ((status = remote()->transact(BnGpuService::GET_GPU_STATS_GLOBAL_INFO, data, &reply)) !=
+ OK)
+ return status;
+
+ int32_t result = 0;
+ if ((status = reply.readInt32(&result)) != OK) return status;
+ if (result != OK) return result;
+
+ outStats->clear();
+ return reply.readParcelableVector(outStats);
+ }
};
IMPLEMENT_META_INTERFACE(GpuService, "android.graphicsenv.IGpuService");
@@ -89,6 +110,19 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep
return OK;
}
+ case GET_GPU_STATS_GLOBAL_INFO: {
+ CHECK_INTERFACE(IGpuService, data, reply);
+
+ std::vector<GpuStatsGlobalInfo> stats;
+ const status_t result = getGpuStatsGlobalInfo(&stats);
+
+ if ((status = reply->writeInt32(result)) != OK) return status;
+ if (result != OK) return result;
+
+ if ((status = reply->writeParcelableVector(stats)) != OK) return status;
+
+ return OK;
+ }
case SHELL_COMMAND_TRANSACTION: {
int in = data.readFileDescriptor();
int out = data.readFileDescriptor();