Loading cmds/statsd/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ cc_defaults { "libprotoutil", "libservices", "libstatslog", "libstatssocket", "libsysutils", "libtimestats_proto", "libutils", Loading cmds/statsd/src/external/GpuStatsPuller.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -92,9 +92,15 @@ static bool pullGpuStatsAppInfo(const sp<IGpuService>& gpuService, android::util::GPU_STATS_APP_INFO, getWallClockNs(), getElapsedRealtimeNs()); if (!event->write(info.appPackageName)) return false; if (!event->write((int64_t)info.driverVersionCode)) return false; if (!event->write(int64VectorToProtoByteString(info.glDriverLoadingTime))) return false; if (!event->write(int64VectorToProtoByteString(info.vkDriverLoadingTime))) return false; if (!event->write(int64VectorToProtoByteString(info.angleDriverLoadingTime))) return false; if (!event->writeBytes(int64VectorToProtoByteString(info.glDriverLoadingTime))) { return false; } if (!event->writeBytes(int64VectorToProtoByteString(info.vkDriverLoadingTime))) { return false; } if (!event->writeBytes(int64VectorToProtoByteString(info.angleDriverLoadingTime))) { return false; } if (!event->write(info.cpuVulkanInUse)) return false; if (!event->write(info.falsePrerotation)) return false; event->init(); Loading cmds/statsd/src/logd/LogEvent.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,13 @@ bool LogEvent::write(float value) { return false; } bool LogEvent::writeBytes(const string& value) { if (mContext) { return android_log_write_char_array(mContext, value.c_str(), value.length()) >= 0; } return false; } bool LogEvent::writeKeyValuePairs(int32_t uid, const std::map<int32_t, int32_t>& int_map, const std::map<int32_t, int64_t>& long_map, Loading cmds/statsd/src/logd/LogEvent.h +2 −1 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ #include <android/frameworks/stats/1.0/types.h> #include <android/os/StatsLogEventWrapper.h> #include <android/util/ProtoOutputStream.h> #include <log/log_event_list.h> #include <log/log_read.h> #include <private/android_logger.h> #include <stats_event_list.h> #include <utils/Errors.h> #include <string> Loading Loading @@ -157,6 +157,7 @@ public: bool write(float value); bool write(const std::vector<AttributionNodeInternal>& nodes); bool write(const AttributionNodeInternal& node); bool writeBytes(const std::string& value); bool writeKeyValuePairs(int32_t uid, const std::map<int32_t, int32_t>& int_map, const std::map<int32_t, int64_t>& long_map, Loading cmds/statsd/tests/LogEvent_test.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -582,7 +582,7 @@ TEST(LogEventTest, TestBinaryFieldAtom) { event1.write((int32_t)stats::launcher::LauncherAction::LONGPRESS); event1.write((int32_t)stats::launcher::LauncherState::OVERVIEW); event1.write((int64_t)stats::launcher::LauncherState::ALLAPPS); event1.write(extension_str); event1.writeBytes(extension_str); event1.init(); ProtoOutputStream proto; Loading Loading @@ -621,7 +621,7 @@ TEST(LogEventTest, TestBinaryFieldAtom_empty) { event1.write((int32_t)stats::launcher::LauncherAction::LONGPRESS); event1.write((int32_t)stats::launcher::LauncherState::OVERVIEW); event1.write((int64_t)stats::launcher::LauncherState::ALLAPPS); event1.write(extension_str); event1.writeBytes(extension_str); event1.init(); ProtoOutputStream proto; Loading Loading
cmds/statsd/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ cc_defaults { "libprotoutil", "libservices", "libstatslog", "libstatssocket", "libsysutils", "libtimestats_proto", "libutils", Loading
cmds/statsd/src/external/GpuStatsPuller.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -92,9 +92,15 @@ static bool pullGpuStatsAppInfo(const sp<IGpuService>& gpuService, android::util::GPU_STATS_APP_INFO, getWallClockNs(), getElapsedRealtimeNs()); if (!event->write(info.appPackageName)) return false; if (!event->write((int64_t)info.driverVersionCode)) return false; if (!event->write(int64VectorToProtoByteString(info.glDriverLoadingTime))) return false; if (!event->write(int64VectorToProtoByteString(info.vkDriverLoadingTime))) return false; if (!event->write(int64VectorToProtoByteString(info.angleDriverLoadingTime))) return false; if (!event->writeBytes(int64VectorToProtoByteString(info.glDriverLoadingTime))) { return false; } if (!event->writeBytes(int64VectorToProtoByteString(info.vkDriverLoadingTime))) { return false; } if (!event->writeBytes(int64VectorToProtoByteString(info.angleDriverLoadingTime))) { return false; } if (!event->write(info.cpuVulkanInUse)) return false; if (!event->write(info.falsePrerotation)) return false; event->init(); Loading
cmds/statsd/src/logd/LogEvent.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,13 @@ bool LogEvent::write(float value) { return false; } bool LogEvent::writeBytes(const string& value) { if (mContext) { return android_log_write_char_array(mContext, value.c_str(), value.length()) >= 0; } return false; } bool LogEvent::writeKeyValuePairs(int32_t uid, const std::map<int32_t, int32_t>& int_map, const std::map<int32_t, int64_t>& long_map, Loading
cmds/statsd/src/logd/LogEvent.h +2 −1 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ #include <android/frameworks/stats/1.0/types.h> #include <android/os/StatsLogEventWrapper.h> #include <android/util/ProtoOutputStream.h> #include <log/log_event_list.h> #include <log/log_read.h> #include <private/android_logger.h> #include <stats_event_list.h> #include <utils/Errors.h> #include <string> Loading Loading @@ -157,6 +157,7 @@ public: bool write(float value); bool write(const std::vector<AttributionNodeInternal>& nodes); bool write(const AttributionNodeInternal& node); bool writeBytes(const std::string& value); bool writeKeyValuePairs(int32_t uid, const std::map<int32_t, int32_t>& int_map, const std::map<int32_t, int64_t>& long_map, Loading
cmds/statsd/tests/LogEvent_test.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -582,7 +582,7 @@ TEST(LogEventTest, TestBinaryFieldAtom) { event1.write((int32_t)stats::launcher::LauncherAction::LONGPRESS); event1.write((int32_t)stats::launcher::LauncherState::OVERVIEW); event1.write((int64_t)stats::launcher::LauncherState::ALLAPPS); event1.write(extension_str); event1.writeBytes(extension_str); event1.init(); ProtoOutputStream proto; Loading Loading @@ -621,7 +621,7 @@ TEST(LogEventTest, TestBinaryFieldAtom_empty) { event1.write((int32_t)stats::launcher::LauncherAction::LONGPRESS); event1.write((int32_t)stats::launcher::LauncherState::OVERVIEW); event1.write((int64_t)stats::launcher::LauncherState::ALLAPPS); event1.write(extension_str); event1.writeBytes(extension_str); event1.init(); ProtoOutputStream proto; Loading