Commit d19ca30874f2ad343d054e0b5c0576744afeecd4

Authored by Peter Zijlstra
Committed by Ingo Molnar
1 parent 18d95a2832

sched: debug: add some debug code to handle the full hierarchy

Add some extra debug output so we can get a better overview of the
full hierarchy.

We print the cgroup path after each cfs_rq, so we can see what group
we're looking at.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 32 additions and 3 deletions Side-by-side Diff

kernel/sched_debug.c
... ... @@ -67,14 +67,24 @@
67 67 (long long)(p->nvcsw + p->nivcsw),
68 68 p->prio);
69 69 #ifdef CONFIG_SCHEDSTATS
70   - SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld\n",
  70 + SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
71 71 SPLIT_NS(p->se.vruntime),
72 72 SPLIT_NS(p->se.sum_exec_runtime),
73 73 SPLIT_NS(p->se.sum_sleep_runtime));
74 74 #else
75   - SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld\n",
  75 + SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld",
76 76 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
77 77 #endif
  78 +
  79 +#ifdef CONFIG_CGROUP_SCHED
  80 + {
  81 + char path[64];
  82 +
  83 + cgroup_path(task_group(p)->css.cgroup, path, sizeof(path));
  84 + SEQ_printf(m, " %s", path);
  85 + }
  86 +#endif
  87 + SEQ_printf(m, "\n");
78 88 }
79 89  
80 90 static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
81 91  
... ... @@ -109,8 +119,22 @@
109 119 struct sched_entity *last;
110 120 unsigned long flags;
111 121  
112   - SEQ_printf(m, "\ncfs_rq\n");
  122 +#ifndef CONFIG_CGROUP_SCHED
  123 + SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
  124 +#else
  125 + char path[128] = "";
  126 + struct cgroup *cgroup = NULL;
  127 + struct task_group *tg = cfs_rq->tg;
113 128  
  129 + if (tg)
  130 + cgroup = tg->css.cgroup;
  131 +
  132 + if (cgroup)
  133 + cgroup_path(cgroup, path, sizeof(path));
  134 +
  135 + SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
  136 +#endif
  137 +
114 138 SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
115 139 SPLIT_NS(cfs_rq->exec_clock));
116 140  
... ... @@ -143,6 +167,11 @@
143 167 #endif
144 168 SEQ_printf(m, " .%-30s: %ld\n", "nr_spread_over",
145 169 cfs_rq->nr_spread_over);
  170 +#ifdef CONFIG_FAIR_GROUP_SCHED
  171 +#ifdef CONFIG_SMP
  172 + SEQ_printf(m, " .%-30s: %lu\n", "shares", cfs_rq->shares);
  173 +#endif
  174 +#endif
146 175 }
147 176  
148 177 static void print_cpu(struct seq_file *m, int cpu)