summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJin Qian2017-03-14 14:40:06 -0500
committerJin Qian2017-03-14 14:43:40 -0500
commit4bcc8b65268851ac012a16bf2633a09dd0005cb7 (patch)
tree1fb8315292edc6e979141a5303562b1bc4aabaf5 /storaged
parent9b1aeae7306cfd19e0c4704db5807edf8c0c14b7 (diff)
downloadplatform-system-core-4bcc8b65268851ac012a16bf2633a09dd0005cb7.tar.gz
platform-system-core-4bcc8b65268851ac012a16bf2633a09dd0005cb7.tar.xz
platform-system-core-4bcc8b65268851ac012a16bf2633a09dd0005cb7.zip
storaged: clean up output format
make it easy to use scripts parsing output Test: adb shell storaged -u Change-Id: I459078c4ddf6e18fe1eb05d25d564e6e6d03e87e
Diffstat (limited to 'storaged')
-rw-r--r--storaged/storaged_service.cpp18
-rw-r--r--storaged/storaged_utils.cpp18
2 files changed, 12 insertions, 24 deletions
diff --git a/storaged/storaged_service.cpp b/storaged/storaged_service.cpp
index c099048ba..33e85e3bc 100644
--- a/storaged/storaged_service.cpp
+++ b/storaged/storaged_service.cpp
@@ -136,16 +136,16 @@ status_t Storaged::dump(int fd, const Vector<String16>& args) {
136 last_ts = it.first; 136 last_ts = it.first;
137 137
138 for (const auto& record : it.second.entries) { 138 for (const auto& record : it.second.entries) {
139 dprintf(fd, "%s %llu %llu %llu %llu %llu %llu %llu %llu\n", 139 dprintf(fd, "%s %ju %ju %ju %ju %ju %ju %ju %ju\n",
140 record.name.c_str(), 140 record.name.c_str(),
141 (unsigned long long)record.ios.bytes[READ][FOREGROUND][CHARGER_OFF], 141 record.ios.bytes[READ][FOREGROUND][CHARGER_OFF],
142 (unsigned long long)record.ios.bytes[WRITE][FOREGROUND][CHARGER_OFF], 142 record.ios.bytes[WRITE][FOREGROUND][CHARGER_OFF],
143 (unsigned long long)record.ios.bytes[READ][BACKGROUND][CHARGER_OFF], 143 record.ios.bytes[READ][BACKGROUND][CHARGER_OFF],
144 (unsigned long long)record.ios.bytes[WRITE][BACKGROUND][CHARGER_OFF], 144 record.ios.bytes[WRITE][BACKGROUND][CHARGER_OFF],
145 (unsigned long long)record.ios.bytes[READ][FOREGROUND][CHARGER_ON], 145 record.ios.bytes[READ][FOREGROUND][CHARGER_ON],
146 (unsigned long long)record.ios.bytes[WRITE][FOREGROUND][CHARGER_ON], 146 record.ios.bytes[WRITE][FOREGROUND][CHARGER_ON],
147 (unsigned long long)record.ios.bytes[READ][BACKGROUND][CHARGER_ON], 147 record.ios.bytes[READ][BACKGROUND][CHARGER_ON],
148 (unsigned long long)record.ios.bytes[WRITE][BACKGROUND][CHARGER_ON]); 148 record.ios.bytes[WRITE][BACKGROUND][CHARGER_ON]);
149 } 149 }
150 } 150 }
151 151
diff --git a/storaged/storaged_utils.cpp b/storaged/storaged_utils.cpp
index 5df018581..9fcf1fa8a 100644
--- a/storaged/storaged_utils.cpp
+++ b/storaged/storaged_utils.cpp
@@ -270,23 +270,11 @@ void sort_running_uids_info(std::vector<struct uid_info> &uids) {
270 270
271// Logging functions 271// Logging functions
272void log_console_running_uids_info(std::vector<struct uid_info> uids) { 272void log_console_running_uids_info(std::vector<struct uid_info> uids) {
273// Sample Output: 273 printf("name/uid fg_rchar fg_wchar fg_rbytes fg_wbytes "
274// Application FG Read FG Write FG Read FG Write BG Read BG Write BG Read BG Write 274 "bg_rchar bg_wchar bg_rbytes bg_wbytes fg_fsync bg_fsync\n");
275// NAME/UID Characters Characters Bytes Bytes Characters Characters Bytes Bytes
276// ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
277// com.google.android.gsf.login 0 0 0 0 57195097 5137089 176386048 6512640
278// com.google.android.googlequicksearchbox 0 0 0 0 4196821 12123468 34295808 13225984
279// 1037 4572 537 0 0 131352 5145643 34263040 5144576
280// com.google.android.youtube 2182 70 0 0 63969383 482939 38731776 466944
281
282 // Title
283 printf("Per-UID I/O stats\n");
284 printf(" Application FG Read FG Write FG Read FG Write BG Read BG Write BG Read BG Write FG fsync BG fsync\n"
285 " NAME/UID Characters Characters Bytes Bytes Characters Characters Bytes Bytes \n"
286 " ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------\n");
287 275
288 for (const auto& uid : uids) { 276 for (const auto& uid : uids) {
289 printf("%50s%15ju%15ju%15ju%15ju%15ju%15ju%15ju%15ju%15ju%15ju\n", uid.name.c_str(), 277 printf("%s %ju %ju %ju %ju %ju %ju %ju %ju %ju %ju\n", uid.name.c_str(),
290 uid.io[0].rchar, uid.io[0].wchar, uid.io[0].read_bytes, uid.io[0].write_bytes, 278 uid.io[0].rchar, uid.io[0].wchar, uid.io[0].read_bytes, uid.io[0].write_bytes,
291 uid.io[1].rchar, uid.io[1].wchar, uid.io[1].read_bytes, uid.io[1].write_bytes, 279 uid.io[1].rchar, uid.io[1].wchar, uid.io[1].read_bytes, uid.io[1].write_bytes,
292 uid.io[0].fsync, uid.io[1].fsync); 280 uid.io[0].fsync, uid.io[1].fsync);