Skip to contentSkip to conversation

sched/debug: Add load-tracking statistics to task

PATCH New Kamalesh Babulal 2 participants 2 messages Jun 25, 2013 – Jun 27, 2013 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/debug: Add load-tracking statistics to task

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.

---
 kernel/sched/debug.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/sched/debug.c +6 -0
index d1c0c81..375225b 100644
@@ -567,6 +567,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

--
1.7.11.6

#1 lore raw
sched/debug: Add load-tracking statistics to task
Commit-ID:  939fd731eb88a0cdd9058d0b0143563172a217d7
Gitweb:     http://git.kernel.org/tip/939fd731eb88a0cdd9058d0b0143563172a217d7
Author:     Kamalesh Babulal <[email protected]>
AuthorDate: Tue, 25 Jun 2013 13:33:36 +0530
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 27 Jun 2013 10:07:46 +0200

sched/debug: Add load-tracking statistics to task

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.

---
 kernel/sched/debug.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/sched/debug.c +6 -0
index d803989..62632098 100644
@@ -566,6 +566,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