sched/debug: Add load-tracking statistics to task
authorKamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Tue, 25 Jun 2013 08:03:36 +0000 (13:33 +0530)
committerAlex Shi <alex.shi@linaro.org>
Fri, 13 Dec 2013 06:45:21 +0000 (14:45 +0800)
At present we print per-entity load-tracking statistics for
cfs_rq of cgroups/runqueues. Given that per task statistics
is maintained, it can be used to know the contribution made
by the task to its parenting cfs_rq level.

This patch adds per-task load-tracking statistics to /proc/<PID>/sched.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130625080336.GA20175@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/debug.c

index fbd8caa83ef5b09ea6a21ee169ceb7459aead978..6b7b86cfabad1d08a39ef147ee772d72aacd031e 100644 (file)
@@ -569,6 +569,12 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
                   "nr_involuntary_switches", (long long)p->nivcsw);
 
        P(se.load.weight);
+#if defined(CONFIG_SMP) && defined(CONFIG_FAIR_GROUP_SCHED)
+       P(se.avg.runnable_avg_sum);
+       P(se.avg.runnable_avg_period);
+       P(se.avg.load_avg_contrib);
+       P(se.avg.decay_count);
+#endif
        P(policy);
        P(prio);
 #undef PN