From 4958a1a0cc7e15e6b0b4baea9743ca6f9c131663 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 18 Aug 2010 19:34:19 +0300 Subject: [PATCH] Mark initially scanned pids in analyzer printouts Since the initial page mappings are are collected from one or more pids, they deserve to be marked on the analyzer output. That way the user will know which are the processes that have all of their pages counted and which have only those pages counted that are shared with any of the interesting processes. Signed-off-by: Timo Kokkonen --- analyze.c | 6 ++++-- pagemap.h | 2 ++ parse.c | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/analyze.c b/analyze.c index 4feb3ec..d5ac75d 100644 --- a/analyze.c +++ b/analyze.c @@ -118,7 +118,7 @@ void print_pid_stats(struct pageframe *pf, struct process *process_list, printf(" in ram swapped total pid"); if (opts->with_threads) printf(" tid"); - printf(" name\n"); + printf(" name\n"); restart: second_biggest = 0; @@ -148,7 +148,9 @@ restart: if (opts->with_threads) printf("%5d ", ps->tid); - printf("%s\n", ps->name); + printf("%c %s\n", + ps->is_initial_pid ? '*' : ' ', + ps->name); count++; processes++; diff --git a/pagemap.h b/pagemap.h index 5a58c83..c9a6d81 100644 --- a/pagemap.h +++ b/pagemap.h @@ -90,6 +90,8 @@ struct process { long int pages_present; long int pages_swapped; + + int is_initial_pid; }; #define PARSE_PID 0x1 diff --git a/parse.c b/parse.c index d4cae14..b0afe7a 100644 --- a/parse.c +++ b/parse.c @@ -337,6 +337,9 @@ static int read_pageframe(int pid, int tid, struct pageframe *pageframe, } } + if (!is_parse_option(opts, PARSE_NOADD_TREE)) + process->is_initial_pid = 1; + list_add_tail(&process->list, &process_list->list); return 1; -- 2.44.0