diff options
| author | 2019-03-04 14:17:12 -0800 | |
|---|---|---|
| committer | 2019-03-11 13:03:53 -0700 | |
| commit | 178e067ee90e09289c448fb7e09d893e142fa4c0 (patch) | |
| tree | 2ad6af0d97aae76649038a0f0e17a17ee8c6ac0e /libs/graphicsenv/IGpuService.cpp | |
| parent | 7c863f5368a04876dc9892ac284340ebe37a5533 (diff) | |
Game Driver Metrics: plumb gpu app stats into statsd
This change adds all the necessary binder calls to IGpuService.
Bug: 123529932
Test: adb shell cmd stats pull-source 10055
Change-Id: I1113ff44977613527aca8207eeef0ad627eb70ef
Diffstat (limited to 'libs/graphicsenv/IGpuService.cpp')
| -rw-r--r-- | libs/graphicsenv/IGpuService.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libs/graphicsenv/IGpuService.cpp b/libs/graphicsenv/IGpuService.cpp index 0b0bf445ae..1dc1c0e4e9 100644 --- a/libs/graphicsenv/IGpuService.cpp +++ b/libs/graphicsenv/IGpuService.cpp @@ -67,6 +67,29 @@ public: outStats->clear(); return reply.readParcelableVector(outStats); } + + virtual status_t getGpuStatsAppInfo(std::vector<GpuStatsAppInfo>* 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_APP_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"); @@ -123,6 +146,19 @@ status_t BnGpuService::onTransact(uint32_t code, const Parcel& data, Parcel* rep return OK; } + case GET_GPU_STATS_APP_INFO: { + CHECK_INTERFACE(IGpuService, data, reply); + + std::vector<GpuStatsAppInfo> stats; + const status_t result = getGpuStatsAppInfo(&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(); |