diff options
author | Thierry Strudel <tstrudel@google.com> | 2015-12-08 14:59:46 -0800 |
---|---|---|
committer | Thierry Strudel <tstrudel@google.com> | 2015-12-08 14:59:49 -0800 |
commit | 76617ddbd19525a8d82e7304a0e4b1c771438329 (patch) | |
tree | c1ad85d6769d8617e620af318a95847fd790cc51 | |
parent | 9f82eca8b9ac9068e4ea86036b7f183006e4c248 (diff) | |
download | extras-76617ddbd19525a8d82e7304a0e4b1c771438329.tar.gz |
librank: fix pm_memusage_t init and layout
pm_memusage_t variables must be initialized to 0 or call initializer.
Bug: 26083907
Change-Id: I62882be13de9c546e73bcdc24ec43ed0d5251db1
-rw-r--r-- | librank/librank.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/librank/librank.c b/librank/librank.c index 28322b9a..5c7c64e7 100644 --- a/librank/librank.c +++ b/librank/librank.c @@ -316,6 +316,7 @@ int main(int argc, char *argv[]) { libraries = malloc(INIT_LIBRARIES * sizeof(struct library_info *)); libraries_count = 0; libraries_size = INIT_LIBRARIES; + pm_memusage_zero(&map_usage); error = pm_kernel_create(&ker); if (error) { @@ -376,7 +377,7 @@ int main(int argc, char *argv[]) { } } - printf(" %6s %6s %6s %6s %6s ", "RSStot", "VSS", "RSS", "PSS", "USS"); + printf(" %6s %7s %6s %6s %6s ", "RSStot", "VSS", "RSS", "PSS", "USS"); if (has_swap) { printf(" %6s ", "Swap"); @@ -390,7 +391,7 @@ int main(int argc, char *argv[]) { for (i = 0; i < libraries_count; i++) { li = libraries[i]; - printf("%6zdK %6s %6s %6s %6s ", li->total_usage.pss / 1024, "", "", "", ""); + printf("%6zdK %7s %6s %6s %6s ", li->total_usage.pss / 1024, "", "", "", ""); if (has_swap) { printf(" %6s ", ""); } @@ -402,7 +403,7 @@ int main(int argc, char *argv[]) { for (j = 0; j < li->mappings_count; j++) { mi = li->mappings[j]; pi = mi->proc; - printf( " %6s %6zdK %6zdK %6zdK %6zdK ", "", + printf( " %6s %7zdK %6zdK %6zdK %6zdK ", "", mi->usage.vss / 1024, mi->usage.rss / 1024, mi->usage.pss / 1024, |