Loading cmds/statsd/src/StatsService.cpp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -1089,6 +1089,14 @@ hardware::Return<void> StatsService::reportBatteryCausedShutdown( return hardware::Void(); return hardware::Void(); } } hardware::Return<void> StatsService::reportUsbPortOverheatEvent( const UsbPortOverheatEvent& usbPortOverheatEvent) { LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), usbPortOverheatEvent); mProcessor->OnLogEvent(&event); return hardware::Void(); } void StatsService::binderDied(const wp <IBinder>& who) { void StatsService::binderDied(const wp <IBinder>& who) { ALOGW("statscompanion service died"); ALOGW("statscompanion service died"); StatsdStats::getInstance().noteSystemServerRestart(getWallClockSec()); StatsdStats::getInstance().noteSystemServerRestart(getWallClockSec()); Loading cmds/statsd/src/StatsService.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -199,6 +199,12 @@ public: virtual Return<void> reportBatteryCausedShutdown( virtual Return<void> reportBatteryCausedShutdown( const BatteryCausedShutdown& batteryCausedShutdown) override; const BatteryCausedShutdown& batteryCausedShutdown) override; /** * Binder call to get UsbPortOverheatEvent atom. */ virtual Return<void> reportUsbPortOverheatEvent( const UsbPortOverheatEvent& usbPortOverheatEvent) override; /** IBinder::DeathRecipient */ /** IBinder::DeathRecipient */ virtual void binderDied(const wp<IBinder>& who) override; virtual void binderDied(const wp<IBinder>& who) override; Loading cmds/statsd/src/atoms.proto +19 −0 Original line number Original line Diff line number Diff line Loading @@ -193,6 +193,7 @@ message Atom { LowStorageStateChanged low_storage_state_changed = 130; LowStorageStateChanged low_storage_state_changed = 130; GnssNfwNotificationReported gnss_nfw_notification_reported = 131; GnssNfwNotificationReported gnss_nfw_notification_reported = 131; GnssConfigurationReported gnss_configuration_reported = 132; GnssConfigurationReported gnss_configuration_reported = 132; UsbPortOverheatEvent usb_port_overheat_event_reported = 133; } } // Pulled events will start at field 10000. // Pulled events will start at field 10000. Loading Loading @@ -2495,6 +2496,24 @@ message BinaryPushStateChanged { optional State state = 3; optional State state = 3; } } /** Represents USB port overheat event. */ message UsbPortOverheatEvent { /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */ optional int32 plug_temperature_deci_c = 1; /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */ optional int32 max_temperature_deci_c = 2; /* Time between USB plug event and overheat threshold trip, in seconds. */ optional int32 time_to_overheat_secs = 3; /* Time between overheat threshold trip and hysteresis, in seconds. */ optional int32 time_to_hysteresis_secs = 4; /* Time between hysteresis and active mitigation ending, in seconds. */ optional int32 time_to_inactive_secs = 5; }; /* /* * Logs when a connection becomes available and lost. * Logs when a connection becomes available and lost. * Logged in StatsCompanionService.java * Logged in StatsCompanionService.java Loading cmds/statsd/src/logd/LogEvent.cpp +18 −0 Original line number Original line Diff line number Diff line Loading @@ -276,6 +276,24 @@ LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, Value(batteryCausedShutdown.voltageMicroV))); Value(batteryCausedShutdown.voltageMicroV))); } } LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const UsbPortOverheatEvent& usbPortOverheatEvent) { mLogdTimestampNs = wallClockTimestampNs; mElapsedTimestampNs = elapsedTimestampNs; mTagId = android::util::USB_PORT_OVERHEAT_EVENT_REPORTED; mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)), Value(usbPortOverheatEvent.plugTemperatureDeciC))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)), Value(usbPortOverheatEvent.maxTemperatureDeciC))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)), Value(usbPortOverheatEvent.timeToOverheat))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)), Value(usbPortOverheatEvent.timeToHysteresis))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(5)), Value(usbPortOverheatEvent.timeToInactive))); } LogEvent::LogEvent(int32_t tagId, int64_t timestampNs) : LogEvent(tagId, timestampNs, 0) {} LogEvent::LogEvent(int32_t tagId, int64_t timestampNs) : LogEvent(tagId, timestampNs, 0) {} LogEvent::LogEvent(int32_t tagId, int64_t timestampNs, int32_t uid) { LogEvent::LogEvent(int32_t tagId, int64_t timestampNs, int32_t uid) { Loading cmds/statsd/src/logd/LogEvent.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -118,6 +118,9 @@ public: explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const BatteryCausedShutdown& batteryCausedShutdown); const BatteryCausedShutdown& batteryCausedShutdown); explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const UsbPortOverheatEvent& usbPortOverheatEvent); ~LogEvent(); ~LogEvent(); /** /** Loading Loading
cmds/statsd/src/StatsService.cpp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -1089,6 +1089,14 @@ hardware::Return<void> StatsService::reportBatteryCausedShutdown( return hardware::Void(); return hardware::Void(); } } hardware::Return<void> StatsService::reportUsbPortOverheatEvent( const UsbPortOverheatEvent& usbPortOverheatEvent) { LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), usbPortOverheatEvent); mProcessor->OnLogEvent(&event); return hardware::Void(); } void StatsService::binderDied(const wp <IBinder>& who) { void StatsService::binderDied(const wp <IBinder>& who) { ALOGW("statscompanion service died"); ALOGW("statscompanion service died"); StatsdStats::getInstance().noteSystemServerRestart(getWallClockSec()); StatsdStats::getInstance().noteSystemServerRestart(getWallClockSec()); Loading
cmds/statsd/src/StatsService.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -199,6 +199,12 @@ public: virtual Return<void> reportBatteryCausedShutdown( virtual Return<void> reportBatteryCausedShutdown( const BatteryCausedShutdown& batteryCausedShutdown) override; const BatteryCausedShutdown& batteryCausedShutdown) override; /** * Binder call to get UsbPortOverheatEvent atom. */ virtual Return<void> reportUsbPortOverheatEvent( const UsbPortOverheatEvent& usbPortOverheatEvent) override; /** IBinder::DeathRecipient */ /** IBinder::DeathRecipient */ virtual void binderDied(const wp<IBinder>& who) override; virtual void binderDied(const wp<IBinder>& who) override; Loading
cmds/statsd/src/atoms.proto +19 −0 Original line number Original line Diff line number Diff line Loading @@ -193,6 +193,7 @@ message Atom { LowStorageStateChanged low_storage_state_changed = 130; LowStorageStateChanged low_storage_state_changed = 130; GnssNfwNotificationReported gnss_nfw_notification_reported = 131; GnssNfwNotificationReported gnss_nfw_notification_reported = 131; GnssConfigurationReported gnss_configuration_reported = 132; GnssConfigurationReported gnss_configuration_reported = 132; UsbPortOverheatEvent usb_port_overheat_event_reported = 133; } } // Pulled events will start at field 10000. // Pulled events will start at field 10000. Loading Loading @@ -2495,6 +2496,24 @@ message BinaryPushStateChanged { optional State state = 3; optional State state = 3; } } /** Represents USB port overheat event. */ message UsbPortOverheatEvent { /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */ optional int32 plug_temperature_deci_c = 1; /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */ optional int32 max_temperature_deci_c = 2; /* Time between USB plug event and overheat threshold trip, in seconds. */ optional int32 time_to_overheat_secs = 3; /* Time between overheat threshold trip and hysteresis, in seconds. */ optional int32 time_to_hysteresis_secs = 4; /* Time between hysteresis and active mitigation ending, in seconds. */ optional int32 time_to_inactive_secs = 5; }; /* /* * Logs when a connection becomes available and lost. * Logs when a connection becomes available and lost. * Logged in StatsCompanionService.java * Logged in StatsCompanionService.java Loading
cmds/statsd/src/logd/LogEvent.cpp +18 −0 Original line number Original line Diff line number Diff line Loading @@ -276,6 +276,24 @@ LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, Value(batteryCausedShutdown.voltageMicroV))); Value(batteryCausedShutdown.voltageMicroV))); } } LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const UsbPortOverheatEvent& usbPortOverheatEvent) { mLogdTimestampNs = wallClockTimestampNs; mElapsedTimestampNs = elapsedTimestampNs; mTagId = android::util::USB_PORT_OVERHEAT_EVENT_REPORTED; mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)), Value(usbPortOverheatEvent.plugTemperatureDeciC))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)), Value(usbPortOverheatEvent.maxTemperatureDeciC))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)), Value(usbPortOverheatEvent.timeToOverheat))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)), Value(usbPortOverheatEvent.timeToHysteresis))); mValues.push_back(FieldValue(Field(mTagId, getSimpleField(5)), Value(usbPortOverheatEvent.timeToInactive))); } LogEvent::LogEvent(int32_t tagId, int64_t timestampNs) : LogEvent(tagId, timestampNs, 0) {} LogEvent::LogEvent(int32_t tagId, int64_t timestampNs) : LogEvent(tagId, timestampNs, 0) {} LogEvent::LogEvent(int32_t tagId, int64_t timestampNs, int32_t uid) { LogEvent::LogEvent(int32_t tagId, int64_t timestampNs, int32_t uid) { Loading
cmds/statsd/src/logd/LogEvent.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -118,6 +118,9 @@ public: explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const BatteryCausedShutdown& batteryCausedShutdown); const BatteryCausedShutdown& batteryCausedShutdown); explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const UsbPortOverheatEvent& usbPortOverheatEvent); ~LogEvent(); ~LogEvent(); /** /** Loading