mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, "Daniel K." <dk@uw.no>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 06/10] sched: debug: add some rt debug output
Date: Thu, 19 Jun 2008 14:22:24 +0200	[thread overview]
Message-ID: <20080619123314.113080419@chello.nl> (raw)
In-Reply-To: <20080619122218.971447669@chello.nl>

[-- Attachment #1: sched-rt-bw-debug.patch --]
[-- Type: text/plain, Size: 2805 bytes --]

Also display rt_rq information in /proc/sched_debug

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 kernel/sched_debug.c |   40 +++++++++++++++++++++++++++++++++++++---
 kernel/sched_rt.c    |   14 ++++++++++++++
 2 files changed, 51 insertions(+), 3 deletions(-)

Index: linux-2.6/kernel/sched_debug.c
===================================================================
--- linux-2.6.orig/kernel/sched_debug.c
+++ linux-2.6/kernel/sched_debug.c
@@ -119,9 +119,7 @@ void print_cfs_rq(struct seq_file *m, in
 	struct sched_entity *last;
 	unsigned long flags;
 
-#if !defined(CONFIG_CGROUP_SCHED) || !defined(CONFIG_USER_SCHED)
-	SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
-#else
+#if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
 	char path[128] = "";
 	struct cgroup *cgroup = NULL;
 	struct task_group *tg = cfs_rq->tg;
@@ -133,6 +131,8 @@ void print_cfs_rq(struct seq_file *m, in
 		cgroup_path(cgroup, path, sizeof(path));
 
 	SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
+#else
+	SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
 #endif
 
 	SEQ_printf(m, "  .%-30s: %Ld.%06ld\n", "exec_clock",
@@ -169,6 +169,39 @@ void print_cfs_rq(struct seq_file *m, in
 			cfs_rq->nr_spread_over);
 }
 
+void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq)
+{
+#if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_RT_GROUP_SCHED)
+	char path[128] = "";
+	struct cgroup *cgroup = NULL;
+	struct task_group *tg = rt_rq->tg;
+
+	if (tg)
+		cgroup = tg->css.cgroup;
+
+	if (cgroup)
+		cgroup_path(cgroup, path, sizeof(path));
+
+	SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, path);
+#else
+	SEQ_printf(m, "\nrt_rq[%d]:\n", cpu);
+#endif
+
+
+#define P(x) \
+	SEQ_printf(m, "  .%-30s: %Ld\n", #x, (long long)(rt_rq->x))
+#define PN(x) \
+	SEQ_printf(m, "  .%-30s: %Ld.%06ld\n", #x, SPLIT_NS(rt_rq->x))
+
+	P(rt_nr_running);
+	P(rt_throttled);
+	PN(rt_time);
+	PN(rt_runtime);
+
+#undef PN
+#undef P
+}
+
 static void print_cpu(struct seq_file *m, int cpu)
 {
 	struct rq *rq = &per_cpu(runqueues, cpu);
@@ -208,6 +241,7 @@ static void print_cpu(struct seq_file *m
 #undef PN
 
 	print_cfs_stats(m, cpu);
+	print_rt_stats(m, cpu);
 
 	print_rq(m, rq, cpu);
 }
Index: linux-2.6/kernel/sched_rt.c
===================================================================
--- linux-2.6.orig/kernel/sched_rt.c
+++ linux-2.6/kernel/sched_rt.c
@@ -1447,3 +1447,17 @@ static const struct sched_class rt_sched
 	.prio_changed		= prio_changed_rt,
 	.switched_to		= switched_to_rt,
 };
+
+#ifdef CONFIG_SCHED_DEBUG
+extern void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq);
+
+static void print_rt_stats(struct seq_file *m, int cpu)
+{
+	struct rt_rq *rt_rq;
+
+	rcu_read_lock();
+	for_each_leaf_rt_rq(rt_rq, cpu_rq(cpu))
+		print_rt_rq(m, cpu, rt_rq);
+	rcu_read_unlock();
+}
+#endif

-- 


  parent reply	other threads:[~2008-06-19 12:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 12:22 [PATCH 00/10] sched: rt bandwidth/group fixes Peter Zijlstra
2008-06-19 12:22 ` [PATCH 01/10] sched: NULL pointer dereference while setting sched_rt_period_us Peter Zijlstra
2008-06-19 12:22 ` [PATCH 02/10] sched: rt-group: fix hierarchy Peter Zijlstra
2008-06-19 12:22 ` [PATCH 03/10] sched: rt-group: heirarchy aware throttle Peter Zijlstra
2008-06-19 12:22 ` [PATCH 04/10] sched: rt-group: fix RR buglet Peter Zijlstra
2008-06-19 12:22 ` [PATCH 05/10] sched: rt-bandwidth: fix cpu-hotplug interaction Peter Zijlstra
2008-06-19 12:22 ` Peter Zijlstra [this message]
2008-06-19 12:22 ` [PATCH 07/10] sched: rt: fix SMP bandwidth balancing for throttled groups Peter Zijlstra
2008-06-19 12:22 ` [PATCH 08/10] sched: rt: move some code around Peter Zijlstra
2008-06-19 12:22 ` [PATCH 09/10] sched: rt: fix the bandwidth contraint computations Peter Zijlstra
2008-06-19 12:22 ` [PATCH 10/10] sched: rt: dont stop the period timer when there are tasks wanting to run Peter Zijlstra
2008-06-19 20:10   ` Daniel K.
2008-06-19 20:16     ` Peter Zijlstra
2008-06-20  9:06       ` Ingo Molnar
2008-06-20  8:47 ` [PATCH 00/10] sched: rt bandwidth/group fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080619123314.113080419@chello.nl \
    --to=a.p.zijlstra@chello.nl \
    --cc=dk@uw.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome