aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2024-04-21 09:51:33 -0700
committerSeongJae Park <sj@kernel.org>2024-04-21 09:55:34 -0700
commite302633d18f864bbb1988966849e45dd9e00bd14 (patch)
treeec2a45ebcf9c9ce4653efd4865c0e245c4a39342
parent176b497476a64303d0530ab29282c729bf255c61 (diff)
downloaddamo-e302633d18f864bbb1988966849e45dd9e00bd14.tar.gz
damo_report_footprint: Calculate footprint in bytes
Signed-off-by: SeongJae Park <sj@kernel.org>
-rw-r--r--damo_report_footprint.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/damo_report_footprint.py b/damo_report_footprint.py
index a8d50642..e7c3241e 100644
--- a/damo_report_footprint.py
+++ b/damo_report_footprint.py
@@ -84,17 +84,17 @@ def main(args):
footprint_snapshots = _damo_records.load_mem_footprint(args.input)
dists = []
for snapshot in footprint_snapshots:
- footprint_pages = 0
+ footprint_bytes = 0
for pid, fp in snapshot.footprints.items():
# ignore SysMemFootprint
if pid is None:
continue
+ # todo: get real page size of the system
if args.metric == 'vsz':
- footprint_pages += fp.size
+ footprint_bytes += fp.size * 4096
elif args.metric == 'rss':
- footprint_pages += fp.resident
- # todo: get real page size of the system
- dists.append(footprint_pages * 4096)
+ footprint_bytes += fp.resident * 4096
+ dists.append(footprint_bytes)
if args.sortby == 'size':
dists.sort()