aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2024-04-21 09:54:37 -0700
committerSeongJae Park <sj@kernel.org>2024-04-21 09:55:34 -0700
commit2072ae696069dea6681034e9c08dae3432d558b7 (patch)
treefa40ddbd409ed5e083d1409cb705c0b3692bbcd6
parente302633d18f864bbb1988966849e45dd9e00bd14 (diff)
downloaddamo-2072ae696069dea6681034e9c08dae3432d558b7.tar.gz
damo_report_footprint: Support system-level used memory metric, sys_used
Signed-off-by: SeongJae Park <sj@kernel.org>
-rw-r--r--damo_report_footprint.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/damo_report_footprint.py b/damo_report_footprint.py
index e7c3241e..bcbf8d40 100644
--- a/damo_report_footprint.py
+++ b/damo_report_footprint.py
@@ -51,7 +51,7 @@ def pr_dists(dists, percentiles, raw_number, nr_cols_bar, pr_all_footprints):
print(line)
def set_argparser(parser):
- parser.add_argument('metric', choices=['vsz', 'rss'],
+ parser.add_argument('metric', choices=['vsz', 'rss', 'sys_used'],
help='memory footprint metric to show')
parser.add_argument('--input', '-i', type=str, metavar='<file>',
default='damon.data.mem_footprint',
@@ -86,6 +86,10 @@ def main(args):
for snapshot in footprint_snapshots:
footprint_bytes = 0
for pid, fp in snapshot.footprints.items():
+ if args.metric == 'sys_used':
+ if pid is not None:
+ continue
+ footprint_bytes = (fp.total - fp.free) * 1024
# ignore SysMemFootprint
if pid is None:
continue