diff options
author | Ocean Chen <oceanchen@google.com> | 2022-03-10 02:49:40 +0800 |
---|---|---|
committer | Ocean Chen <oceanchen@google.com> | 2022-06-06 01:53:48 +0800 |
commit | 03e386a9c04d7853a1ee85aec493f0933709e7b0 (patch) | |
tree | 6c8ed82b9c4420b21a4046d49e0f68e0118b7005 /pixelstats | |
parent | efc8745e725f99ef86d95b17d35ad4bb9992055a (diff) |
pixelstats: upload F2fsSmartIdleMaintEnabledStateChanged
Upload the value of F2FS smart idle maintenance feature enabled
bug: 215443809
Change-Id: I01cde9e07b9103ea6b5981de2cdb1fd67f503caa
Signed-off-by: Ocean Chen <oceanchen@google.com>
Diffstat (limited to 'pixelstats')
-rw-r--r-- | pixelstats/SysfsCollector.cpp | 22 | ||||
-rw-r--r-- | pixelstats/include/pixelstats/SysfsCollector.h | 1 | ||||
-rw-r--r-- | pixelstats/pixelatoms.proto | 10 |
3 files changed, 33 insertions, 0 deletions
diff --git a/pixelstats/SysfsCollector.cpp b/pixelstats/SysfsCollector.cpp index 14cba98..a2ead23 100644 --- a/pixelstats/SysfsCollector.cpp +++ b/pixelstats/SysfsCollector.cpp @@ -47,6 +47,7 @@ using android::hardware::google::pixel::PixelAtoms::BootStatsInfo; using android::hardware::google::pixel::PixelAtoms::F2fsCompressionInfo; using android::hardware::google::pixel::PixelAtoms::F2fsGcSegmentInfo; using android::hardware::google::pixel::PixelAtoms::F2fsStatsInfo; +using android::hardware::google::pixel::PixelAtoms::F2fsSmartIdleMaintEnabledStateChanged; using android::hardware::google::pixel::PixelAtoms::StorageUfsHealth; using android::hardware::google::pixel::PixelAtoms::StorageUfsResetCount; using android::hardware::google::pixel::PixelAtoms::VendorChargeCycles; @@ -721,6 +722,26 @@ void SysfsCollector::logF2fsGcSegmentInfo(const std::shared_ptr<IStats> &stats_c } } +void SysfsCollector::logF2fsSmartIdleMaintEnabled(const std::shared_ptr<IStats> &stats_client) { + bool smart_idle_enabled = android::base::GetBoolProperty( + "persist.device_config.storage_native_boot.smart_idle_maint_enabled", false); + + // Load values array + VendorAtomValue tmp; + std::vector<VendorAtomValue> values(1); + tmp.set<VendorAtomValue::intValue>(smart_idle_enabled); + values[F2fsSmartIdleMaintEnabledStateChanged::kEnabledFieldNumber - kVendorAtomOffset] = tmp; + + // Send vendor atom to IStats HAL + VendorAtom event = {.reverseDomainName = PixelAtoms::ReverseDomainNames().pixel(), + .atomId = PixelAtoms::Atom::kF2FsSmartIdleMaintEnabledStateChanged, + .values = std::move(values)}; + const ndk::ScopedAStatus ret = stats_client->reportVendorAtom(event); + if (!ret.isOk()) { + ALOGE("Unable to report Boot stats to Stats service"); + } +} + void SysfsCollector::reportZramMmStat(const std::shared_ptr<IStats> &stats_client) { std::string file_contents; if (!kZramMmStatPath) { @@ -897,6 +918,7 @@ void SysfsCollector::logPerDay() { logF2fsStats(stats_client); logF2fsCompressionInfo(stats_client); logF2fsGcSegmentInfo(stats_client); + logF2fsSmartIdleMaintEnabled(stats_client); logSlowIO(stats_client); logSpeakerImpedance(stats_client); logSpeechDspStat(stats_client); diff --git a/pixelstats/include/pixelstats/SysfsCollector.h b/pixelstats/include/pixelstats/SysfsCollector.h index 2baa53c..51c8440 100644 --- a/pixelstats/include/pixelstats/SysfsCollector.h +++ b/pixelstats/include/pixelstats/SysfsCollector.h @@ -88,6 +88,7 @@ class SysfsCollector { void logBootStats(const std::shared_ptr<IStats> &stats_client); void logBatteryEEPROM(const std::shared_ptr<IStats> &stats_client); void logSpeakerHealthStats(const std::shared_ptr<IStats> &stats_client); + void logF2fsSmartIdleMaintEnabled(const std::shared_ptr<IStats> &stats_client); void reportSlowIoFromFile(const std::shared_ptr<IStats> &stats_client, const char *path, const VendorSlowIo::IoOperation &operation_s); diff --git a/pixelstats/pixelatoms.proto b/pixelstats/pixelatoms.proto index 9ffb708..1a61f3e 100644 --- a/pixelstats/pixelatoms.proto +++ b/pixelstats/pixelatoms.proto @@ -79,6 +79,7 @@ message Atom { BatteryHealthStatus battery_health_status = 105037; BatteryHealthUsage battery_health_usage = 105038; + F2fsSmartIdleMaintEnabledStateChanged f2fs_smart_idle_maint_enabled_state_changed = 105039; } // AOSP atom ID range ends at 109999 } @@ -1096,3 +1097,12 @@ message BatteryHealthUsage { // Time (s) accumulated only during discharge at the given thresholds. optional int32 discharge_time_secs = 5; } + +/* + * A Value of F2FS smart idle maintenance feature enabled + */ +message F2fsSmartIdleMaintEnabledStateChanged { + optional string reverse_domain_name = 1; + /* Smart idle maint is enabled */ + optional bool enabled = 2; +} |