Loading apex/statsd/aidl/android/os/IStatsd.aidl +10 −5 Original line number Diff line number Diff line Loading @@ -219,6 +219,11 @@ interface IStatsd { */ oneway void unregisterPullAtomCallback(int uid, int atomTag); /** * Unregisters any pullAtomCallback for the given atom. */ oneway void unregisterNativePullAtomCallback(int atomTag); /** * The install requires staging. */ Loading cmds/statsd/src/StatsService.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -1312,6 +1312,13 @@ Status StatsService::unregisterPullAtomCallback(int32_t uid, int32_t atomTag) { return Status::ok(); } Status StatsService::unregisterNativePullAtomCallback(int32_t atomTag) { VLOG("StatsService::unregisterNativePullAtomCallback called."); int32_t uid = IPCThreadState::self()->getCallingUid(); mPullerManager->UnregisterPullAtomCallback(uid, atomTag); return Status::ok(); } Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainNameIn, const int64_t trainVersionCodeIn, const int options, Loading cmds/statsd/src/StatsService.h +5 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,11 @@ public: */ virtual Status unregisterPullAtomCallback(int32_t uid, int32_t atomTag) override; /** * Binder call to unregister any existing callback for the given atom and calling uid. */ virtual Status unregisterNativePullAtomCallback(int32_t atomTag) override; /** * Binder call to log BinaryPushStateChanged atom. */ Loading cmds/statsd/src/external/StatsCallbackPuller.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ StatsCallbackPuller::StatsCallbackPuller(int tagId, const sp<IPullAtomCallback>& } bool StatsCallbackPuller::PullInternal(vector<shared_ptr<LogEvent>>* data) { VLOG("StatsCallbackPuller called for tag %d", mTagId) VLOG("StatsCallbackPuller called for tag %d", mTagId); if(mCallback == nullptr) { ALOGW("No callback registered"); return false; Loading services/core/jni/com_android_server_GraphicsStatsService.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -178,15 +178,16 @@ static void writeGpuHistogram(stats_event* event, } // graphicsStatsPullCallback is invoked by statsd service to pull GRAPHICS_STATS atom. static bool graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* data, const void* cookie) { static status_pull_atom_return_t graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* data, void* cookie) { JNIEnv* env = getJNIEnv(); if (!env) { return false; } if (gGraphicsStatsServiceObject == nullptr) { ALOGE("Failed to get graphicsstats service"); return false; return STATS_PULL_SKIP; } for (bool lastFullDay : {true, false}) { Loading @@ -198,7 +199,7 @@ static bool graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* env->ExceptionDescribe(); env->ExceptionClear(); ALOGE("Failed to invoke graphicsstats service"); return false; return STATS_PULL_SKIP; } if (!jdata) { // null means data is not available for that day. Loading @@ -217,7 +218,7 @@ static bool graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* if (!success) { ALOGW("Parse failed on GraphicsStatsPuller error='%s' dataSize='%d'", serviceDump.InitializationErrorString().c_str(), dataSize); return false; return STATS_PULL_SKIP; } for (int stat_index = 0; stat_index < serviceDump.stats_size(); stat_index++) { Loading @@ -244,7 +245,7 @@ static bool graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* stats_event_build(event); } } return true; return STATS_PULL_SUCCESS; } // Register a puller for GRAPHICS_STATS atom with the statsd service. Loading Loading
apex/statsd/aidl/android/os/IStatsd.aidl +10 −5 Original line number Diff line number Diff line Loading @@ -219,6 +219,11 @@ interface IStatsd { */ oneway void unregisterPullAtomCallback(int uid, int atomTag); /** * Unregisters any pullAtomCallback for the given atom. */ oneway void unregisterNativePullAtomCallback(int atomTag); /** * The install requires staging. */ Loading
cmds/statsd/src/StatsService.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -1312,6 +1312,13 @@ Status StatsService::unregisterPullAtomCallback(int32_t uid, int32_t atomTag) { return Status::ok(); } Status StatsService::unregisterNativePullAtomCallback(int32_t atomTag) { VLOG("StatsService::unregisterNativePullAtomCallback called."); int32_t uid = IPCThreadState::self()->getCallingUid(); mPullerManager->UnregisterPullAtomCallback(uid, atomTag); return Status::ok(); } Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainNameIn, const int64_t trainVersionCodeIn, const int options, Loading
cmds/statsd/src/StatsService.h +5 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,11 @@ public: */ virtual Status unregisterPullAtomCallback(int32_t uid, int32_t atomTag) override; /** * Binder call to unregister any existing callback for the given atom and calling uid. */ virtual Status unregisterNativePullAtomCallback(int32_t atomTag) override; /** * Binder call to log BinaryPushStateChanged atom. */ Loading
cmds/statsd/src/external/StatsCallbackPuller.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ StatsCallbackPuller::StatsCallbackPuller(int tagId, const sp<IPullAtomCallback>& } bool StatsCallbackPuller::PullInternal(vector<shared_ptr<LogEvent>>* data) { VLOG("StatsCallbackPuller called for tag %d", mTagId) VLOG("StatsCallbackPuller called for tag %d", mTagId); if(mCallback == nullptr) { ALOGW("No callback registered"); return false; Loading
services/core/jni/com_android_server_GraphicsStatsService.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -178,15 +178,16 @@ static void writeGpuHistogram(stats_event* event, } // graphicsStatsPullCallback is invoked by statsd service to pull GRAPHICS_STATS atom. static bool graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* data, const void* cookie) { static status_pull_atom_return_t graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* data, void* cookie) { JNIEnv* env = getJNIEnv(); if (!env) { return false; } if (gGraphicsStatsServiceObject == nullptr) { ALOGE("Failed to get graphicsstats service"); return false; return STATS_PULL_SKIP; } for (bool lastFullDay : {true, false}) { Loading @@ -198,7 +199,7 @@ static bool graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* env->ExceptionDescribe(); env->ExceptionClear(); ALOGE("Failed to invoke graphicsstats service"); return false; return STATS_PULL_SKIP; } if (!jdata) { // null means data is not available for that day. Loading @@ -217,7 +218,7 @@ static bool graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* if (!success) { ALOGW("Parse failed on GraphicsStatsPuller error='%s' dataSize='%d'", serviceDump.InitializationErrorString().c_str(), dataSize); return false; return STATS_PULL_SKIP; } for (int stat_index = 0; stat_index < serviceDump.stats_size(); stat_index++) { Loading @@ -244,7 +245,7 @@ static bool graphicsStatsPullCallback(int32_t atom_tag, pulled_stats_event_list* stats_event_build(event); } } return true; return STATS_PULL_SUCCESS; } // Register a puller for GRAPHICS_STATS atom with the statsd service. Loading