]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
Mark initially scanned pids in analyzer printouts
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 18 Aug 2010 16:34:19 +0000 (19:34 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 18 Aug 2010 17:59:51 +0000 (20:59 +0300)
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 <kaapeli@itanic.dy.fi>
analyze.c
pagemap.h
parse.c

index 4feb3ec73dd688eb4681165dd072bb2085e728ef..d5ac75dae8498c0c7258f980621ef92e3d3b74af 100644 (file)
--- 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++;
index 5a58c833e306e4fa140794a5e270aaf573b2d4de..c9a6d81b846618a9248f68d940a073756f8e709e 100644 (file)
--- 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 d4cae143389a67a7005c2a1dc6c66e901a4f4d40..b0afe7ace7923af5da6aea34c801d17db1818e56 100644 (file)
--- 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;