Loading cmds/statsd/src/StatsService.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -1097,6 +1097,14 @@ hardware::Return<void> StatsService::reportUsbPortOverheatEvent( return hardware::Void(); } hardware::Return<void> StatsService::reportSpeechDspStat( const SpeechDspStat& speechDspStat) { LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), speechDspStat); mProcessor->OnLogEvent(&event); return hardware::Void(); } void StatsService::binderDied(const wp <IBinder>& who) { ALOGW("statscompanion service died"); StatsdStats::getInstance().noteSystemServerRestart(getWallClockSec()); Loading cmds/statsd/src/StatsService.h +6 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,12 @@ public: virtual Return<void> reportUsbPortOverheatEvent( const UsbPortOverheatEvent& usbPortOverheatEvent) override; /** * Binder call to get Speech DSP state atom. */ virtual Return<void> reportSpeechDspStat( const SpeechDspStat& speechDspStat) override; /** IBinder::DeathRecipient */ virtual void binderDied(const wp<IBinder>& who) override; Loading cmds/statsd/src/atoms.proto +16 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ message Atom { BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142; AttentionManagerServiceResultReported attention_manager_service_result_reported = 143; AdbConnectionChanged adb_connection_changed = 144; SpeechDspStatReported speech_dsp_stat_reported = 145; } // Pulled events will start at field 10000. Loading Loading @@ -4521,3 +4522,18 @@ message AdbConnectionChanged { // True if the 'always allow' option was selected for this system. optional bool always_allow = 4; } /* * Logs the reported speech DSP status. * * Logged from: * Vendor audio implementation. */ message SpeechDspStatReported { // The total Speech DSP uptime in milliseconds. optional int32 total_uptime_millis = 1; // The total Speech DSP downtime in milliseconds. optional int32 total_downtime_millis = 2; optional int32 total_crash_count = 3; optional int32 total_recover_count = 4; } cmds/statsd/src/logd/LogEvent.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,22 @@ LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, con mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)), Value(slowIo.count))); } LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const SpeechDspStat& speechDspStat) { mLogdTimestampNs = wallClockTimestampNs; mElapsedTimestampNs = elapsedTimestampNs; mTagId = android::util::SPEECH_DSP_STAT_REPORTED; mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)), Value(speechDspStat.totalUptimeMillis))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)), Value(speechDspStat.totalDowntimeMillis))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)), Value(speechDspStat.totalCrashCount))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)), Value(speechDspStat.totalRecoverCount))); } LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const BatteryCausedShutdown& batteryCausedShutdown) { mLogdTimestampNs = wallClockTimestampNs; Loading cmds/statsd/src/logd/LogEvent.h +3 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,9 @@ public: explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const UsbPortOverheatEvent& usbPortOverheatEvent); explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const SpeechDspStat& speechDspStat); ~LogEvent(); /** Loading Loading
cmds/statsd/src/StatsService.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -1097,6 +1097,14 @@ hardware::Return<void> StatsService::reportUsbPortOverheatEvent( return hardware::Void(); } hardware::Return<void> StatsService::reportSpeechDspStat( const SpeechDspStat& speechDspStat) { LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), speechDspStat); mProcessor->OnLogEvent(&event); return hardware::Void(); } void StatsService::binderDied(const wp <IBinder>& who) { ALOGW("statscompanion service died"); StatsdStats::getInstance().noteSystemServerRestart(getWallClockSec()); Loading
cmds/statsd/src/StatsService.h +6 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,12 @@ public: virtual Return<void> reportUsbPortOverheatEvent( const UsbPortOverheatEvent& usbPortOverheatEvent) override; /** * Binder call to get Speech DSP state atom. */ virtual Return<void> reportSpeechDspStat( const SpeechDspStat& speechDspStat) override; /** IBinder::DeathRecipient */ virtual void binderDied(const wp<IBinder>& who) override; Loading
cmds/statsd/src/atoms.proto +16 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ message Atom { BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142; AttentionManagerServiceResultReported attention_manager_service_result_reported = 143; AdbConnectionChanged adb_connection_changed = 144; SpeechDspStatReported speech_dsp_stat_reported = 145; } // Pulled events will start at field 10000. Loading Loading @@ -4521,3 +4522,18 @@ message AdbConnectionChanged { // True if the 'always allow' option was selected for this system. optional bool always_allow = 4; } /* * Logs the reported speech DSP status. * * Logged from: * Vendor audio implementation. */ message SpeechDspStatReported { // The total Speech DSP uptime in milliseconds. optional int32 total_uptime_millis = 1; // The total Speech DSP downtime in milliseconds. optional int32 total_downtime_millis = 2; optional int32 total_crash_count = 3; optional int32 total_recover_count = 4; }
cmds/statsd/src/logd/LogEvent.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,22 @@ LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, con mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)), Value(slowIo.count))); } LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const SpeechDspStat& speechDspStat) { mLogdTimestampNs = wallClockTimestampNs; mElapsedTimestampNs = elapsedTimestampNs; mTagId = android::util::SPEECH_DSP_STAT_REPORTED; mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)), Value(speechDspStat.totalUptimeMillis))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)), Value(speechDspStat.totalDowntimeMillis))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)), Value(speechDspStat.totalCrashCount))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)), Value(speechDspStat.totalRecoverCount))); } LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const BatteryCausedShutdown& batteryCausedShutdown) { mLogdTimestampNs = wallClockTimestampNs; Loading
cmds/statsd/src/logd/LogEvent.h +3 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,9 @@ public: explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const UsbPortOverheatEvent& usbPortOverheatEvent); explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const SpeechDspStat& speechDspStat); ~LogEvent(); /** Loading