diff options
Diffstat (limited to 'storaged/include')
-rw-r--r-- | storaged/include/storaged.h | 11 | ||||
-rw-r--r-- | storaged/include/storaged_uid_monitor.h | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/storaged/include/storaged.h b/storaged/include/storaged.h index 7e5048fc4..a16be27db 100644 --- a/storaged/include/storaged.h +++ b/storaged/include/storaged.h @@ -257,6 +257,7 @@ public: #define DEFAULT_PERIODIC_CHORES_INTERVAL_DISK_STATS_PUBLISH ( 3600 ) #define DEFAULT_PERIODIC_CHORES_INTERVAL_EMMC_INFO_PUBLISH ( 86400 ) #define DEFAULT_PERIODIC_CHORES_INTERVAL_UID_IO ( 3600 ) +#define DEFAULT_PERIODIC_CHORES_INTERVAL_UID_IO_LIMIT (300) // UID IO threshold in bytes #define DEFAULT_PERIODIC_CHORES_UID_IO_THRESHOLD ( 1024 * 1024 * 1024ULL ) @@ -300,8 +301,14 @@ public: std::unordered_map<uint32_t, struct uid_info> get_uids(void) { return mUidm.get_uid_io_stats(); } - std::map<uint64_t, std::vector<struct uid_record>> get_uid_records(int hours) { - return mUidm.dump(hours); + std::map<uint64_t, std::vector<struct uid_record>> get_uid_records( + int hours, uint64_t threshold) { + return mUidm.dump(hours, threshold); + } + void update_uid_io_interval(int interval) { + if (interval >= DEFAULT_PERIODIC_CHORES_INTERVAL_UID_IO_LIMIT) { + mConfig.periodic_chores_interval_uid_io = interval; + } } void init_battery_service(); diff --git a/storaged/include/storaged_uid_monitor.h b/storaged/include/storaged_uid_monitor.h index 07e6daa3e..ae850167d 100644 --- a/storaged/include/storaged_uid_monitor.h +++ b/storaged/include/storaged_uid_monitor.h @@ -91,7 +91,7 @@ public: // called by storaged -u std::unordered_map<uint32_t, struct uid_info> get_uid_io_stats(); // called by dumpsys - std::map<uint64_t, std::vector<struct uid_record>> dump(int hours); + std::map<uint64_t, std::vector<struct uid_record>> dump(int hours, uint64_t threshold); // called by battery properties listener void set_charger_state(charger_stat_t stat); // called by storaged periodic_chore |