aboutsummaryrefslogtreecommitdiffstats
path: root/src/firemon/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firemon/cpu.c')
-rw-r--r--src/firemon/cpu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/firemon/cpu.c b/src/firemon/cpu.c
index 20fba33d6..47c935686 100644
--- a/src/firemon/cpu.c
+++ b/src/firemon/cpu.c
@@ -48,18 +48,20 @@ static void print_cpu(int pid) {
48 free(file); 48 free(file);
49} 49}
50 50
51void cpu(pid_t pid) { 51void cpu(pid_t pid, int print_procs) {
52 pid_read(pid); 52 pid_read(pid);
53 53
54 // print processes 54 // print processes
55 int i; 55 int i;
56 for (i = 0; i < max_pids; i++) { 56 for (i = 0; i < max_pids; i++) {
57 if (pids[i].level == 1) { 57 if (pids[i].level == 1) {
58 pid_print_list(i, 0); 58 if (print_procs || pid == 0)
59 pid_print_list(i, 0);
59 int child = find_child(i); 60 int child = find_child(i);
60 if (child != -1) 61 if (child != -1)
61 print_cpu(child); 62 print_cpu(child);
62 } 63 }
63 } 64 }
65 printf("\n");
64} 66}
65 67