]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
analyzer: Print also the total numer of processes printed
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 14 Jul 2010 19:19:35 +0000 (22:19 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 14 Jul 2010 19:19:35 +0000 (22:19 +0300)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
analyze.c

index 77ef1da87fc057b0f3a8012bbeeeb25c6adc41bd..56eaeeede4158b8f331fc6d439d0e82024f1939c 100644 (file)
--- a/analyze.c
+++ b/analyze.c
@@ -95,7 +95,7 @@ void print_pid_stats(struct pageframe *pf, struct process *process_list)
        struct process *ps;
        long int swapped, present, total;
        long int biggest = 0, second_biggest;
-       int count;
+       int count, processes = 0;
 
        /*
         * walk through all processes, find the one with most present
@@ -138,10 +138,13 @@ restart:
                        PAGE_TO_NICE(swapped), PAGE_TO_NICE_UNIT(swapped),
                        ps->pid, ps->name);
                count++;
+               processes++;
        }
 
        if (count > 0) {
                biggest = second_biggest;
                goto restart;
        }
+
+       printf("Total %d processes\n", processes);
 }