summaryrefslogtreecommitdiff
path: root/pixelstats/include/pixelstats/SysfsCollector.h
diff options
context:
space:
mode:
Diffstat (limited to 'pixelstats/include/pixelstats/SysfsCollector.h')
-rw-r--r--pixelstats/include/pixelstats/SysfsCollector.h53
1 files changed, 52 insertions, 1 deletions
diff --git a/pixelstats/include/pixelstats/SysfsCollector.h b/pixelstats/include/pixelstats/SysfsCollector.h
index 2baa53c5..1054cc54 100644
--- a/pixelstats/include/pixelstats/SysfsCollector.h
+++ b/pixelstats/include/pixelstats/SysfsCollector.h
@@ -22,8 +22,11 @@
#include "BatteryEEPROMReporter.h"
#include "BatteryHealthReporter.h"
+#include "BrownoutDetectedReporter.h"
#include "MitigationStatsReporter.h"
#include "MmMetricsReporter.h"
+#include "TempResidencyReporter.h"
+#include "ThermalStatsReporter.h"
namespace android {
namespace hardware {
@@ -56,10 +59,21 @@ class SysfsCollector {
const char *const ZramBdStatPath;
const char *const EEPROMPath;
const char *const MitigationPath;
+ const char *const BrownoutLogPath;
+ const char *const BrownoutReasonProp;
const char *const SpeakerTemperaturePath;
const char *const SpeakerExcursionPath;
const char *const SpeakerHeartBeatPath;
const std::vector<std::string> UFSErrStatsPath;
+ const int BlockStatsLength;
+ const char *const AmsRatePath;
+ const std::vector<std::string> ThermalStatsPaths;
+ const char *const CCARatePath;
+ const std::vector<std::pair<std::string, std::string>> TempResidencyAndResetPaths;
+ const char *const LongIRQMetricsPath;
+ const char *const ResumeLatencyMetricsPath;
+ const char *const ModemPcieLinkStatsPath;
+ const char *const WifiPcieLinkStatsPath;
};
SysfsCollector(const struct SysfsPaths &paths);
@@ -68,11 +82,15 @@ class SysfsCollector {
private:
bool ReadFileToInt(const std::string &path, int *val);
bool ReadFileToInt(const char *path, int *val);
+ void aggregatePer5Min();
+ void logOnce();
+ void logBrownout();
void logPerDay();
void logPerHour();
void logBatteryChargeCycles(const std::shared_ptr<IStats> &stats_client);
void logBatteryHealth(const std::shared_ptr<IStats> &stats_client);
+ void logBlockStatsReported(const std::shared_ptr<IStats> &stats_client);
void logCodecFailed(const std::shared_ptr<IStats> &stats_client);
void logCodec1Failed(const std::shared_ptr<IStats> &stats_client);
void logSlowIO(const std::shared_ptr<IStats> &stats_client);
@@ -82,18 +100,27 @@ class SysfsCollector {
void logUFSLifetime(const std::shared_ptr<IStats> &stats_client);
void logUFSErrorStats(const std::shared_ptr<IStats> &stats_client);
void logF2fsStats(const std::shared_ptr<IStats> &stats_client);
+ void logF2fsAtomicWriteInfo(const std::shared_ptr<IStats> &stats_client);
void logF2fsCompressionInfo(const std::shared_ptr<IStats> &stats_client);
void logF2fsGcSegmentInfo(const std::shared_ptr<IStats> &stats_client);
void logZramStats(const std::shared_ptr<IStats> &stats_client);
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 logThermalStats(const std::shared_ptr<IStats> &stats_client);
void reportSlowIoFromFile(const std::shared_ptr<IStats> &stats_client, const char *path,
const VendorSlowIo::IoOperation &operation_s);
+ void logTempResidencyStats(const std::shared_ptr<IStats> &stats_client);
void reportZramMmStat(const std::shared_ptr<IStats> &stats_client);
void reportZramBdStat(const std::shared_ptr<IStats> &stats_client);
int getReclaimedSegments(const std::string &mode);
+ void logVendorAudioHardwareStats(const std::shared_ptr<IStats> &stats_client);
+ void logVendorLongIRQStatsReported(const std::shared_ptr<IStats> &stats_client);
+ void logVendorResumeLatencyStats(const std::shared_ptr<IStats> &stats_client);
+ void logPartitionUsedSpace(const std::shared_ptr<IStats> &stats_client);
+ void logPcieLinkStats(const std::shared_ptr<IStats> &stats_client);
const char *const kSlowioReadCntPath;
const char *const kSlowioWriteCntPath;
@@ -113,17 +140,30 @@ class SysfsCollector {
const char *const kZramMmStatPath;
const char *const kZramBdStatPath;
const char *const kEEPROMPath;
+ const char *const kBrownoutLogPath;
+ const char *const kBrownoutReasonProp;
const char *const kPowerMitigationStatsPath;
const char *const kSpeakerTemperaturePath;
const char *const kSpeakerExcursionPath;
const char *const kSpeakerHeartbeatPath;
const std::vector<std::string> kUFSErrStatsPath;
+ const int kBlockStatsLength;
+ const char *const kAmsRatePath;
+ const std::vector<std::string> kThermalStatsPaths;
+ const char *const kCCARatePath;
+ const std::vector<std::pair<std::string, std::string>> kTempResidencyAndResetPaths;
+ const char *const kLongIRQMetricsPath;
+ const char *const kResumeLatencyMetricsPath;
+ const char *const kModemPcieLinkStatsPath;
+ const char *const kWifiPcieLinkStatsPath;
BatteryEEPROMReporter battery_EEPROM_reporter_;
MmMetricsReporter mm_metrics_reporter_;
MitigationStatsReporter mitigation_stats_reporter_;
+ BrownoutDetectedReporter brownout_detected_reporter_;
+ ThermalStatsReporter thermal_stats_reporter_;
BatteryHealthReporter battery_health_reporter_;
-
+ TempResidencyReporter temp_residency_reporter_;
// Proto messages are 1-indexed and VendorAtom field numbers start at 2, so
// store everything in the values array at the index of the field number
// -2.
@@ -131,6 +171,17 @@ class SysfsCollector {
bool log_once_reported = false;
int64_t prev_huge_pages_since_boot_ = -1;
+
+ struct perf_metrics_data {
+ int64_t softirq_count;
+ int64_t irq_count;
+ uint64_t resume_latency_sum_ms;
+ int64_t resume_count;
+ std::vector<int64_t> resume_latency_buckets;
+ int bucket_cnt;
+ };
+ struct perf_metrics_data prev_data;
+ const int kMaxResumeLatencyBuckets = 36;
};
} // namespace pixel