summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'storaged/storaged_service.cpp')
-rw-r--r--storaged/storaged_service.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/storaged/storaged_service.cpp b/storaged/storaged_service.cpp
index d81e0e54f..66354314e 100644
--- a/storaged/storaged_service.cpp
+++ b/storaged/storaged_service.cpp
@@ -99,20 +99,26 @@ status_t Storaged::dump(int fd, const Vector<String16>& args) {
99 } 99 }
100 } 100 }
101 101
102 const std::vector<struct uid_event>& events = storaged.get_uid_events(hours); 102 const std::map<uint64_t, std::vector<struct uid_record>>& records =
103 for (const auto& event : events) { 103 storaged.get_uid_records(hours);
104 dprintf(fd, "%llu %s %llu %llu %llu %llu\n", 104 for (const auto& it : records) {
105 (unsigned long long)event.ts, 105 dprintf(fd, "%llu\n", (unsigned long long)it.first);
106 event.name.c_str(), 106 for (const auto& record : it.second) {
107 (unsigned long long)event.fg_read_bytes, 107 dprintf(fd, "%s %llu %llu %llu %llu %llu %llu %llu %llu\n",
108 (unsigned long long)event.fg_write_bytes, 108 record.name.c_str(),
109 (unsigned long long)event.bg_read_bytes, 109 (unsigned long long)record.ios.bytes[READ][FOREGROUND][CHARGER_OFF],
110 (unsigned long long)event.bg_write_bytes); 110 (unsigned long long)record.ios.bytes[WRITE][FOREGROUND][CHARGER_OFF],
111 (unsigned long long)record.ios.bytes[READ][BACKGROUND][CHARGER_OFF],
112 (unsigned long long)record.ios.bytes[WRITE][BACKGROUND][CHARGER_OFF],
113 (unsigned long long)record.ios.bytes[READ][FOREGROUND][CHARGER_ON],
114 (unsigned long long)record.ios.bytes[WRITE][FOREGROUND][CHARGER_ON],
115 (unsigned long long)record.ios.bytes[READ][BACKGROUND][CHARGER_ON],
116 (unsigned long long)record.ios.bytes[WRITE][BACKGROUND][CHARGER_ON]);
117 }
111 } 118 }
112 return NO_ERROR; 119 return NO_ERROR;
113} 120}
114 121
115
116sp<IStoraged> get_storaged_service() { 122sp<IStoraged> get_storaged_service() {
117 sp<IServiceManager> sm = defaultServiceManager(); 123 sp<IServiceManager> sm = defaultServiceManager();
118 if (sm == NULL) return NULL; 124 if (sm == NULL) return NULL;