aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-11-19 15:11:09 -0500
committerIngo Molnar <mingo@elte.hu>2010-11-23 04:29:08 -0500
commit5bb6b1ea67a73f0665a41726dd7138977b992c6c (patch)
treed16d962dded41088032250b24f0cbee735f3c97c
parent51a96c77815e7f139892a6e9c8275a50e9baebdf (diff)
sched: Add some clock info to sched_debug
Add more clock information to /proc/sched_debug, Thomas wanted to see the sched_clock_stable state. Requested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/sched_clock.c2
-rw-r--r--kernel/sched_debug.c31
2 files changed, 28 insertions, 5 deletions
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index 52f1a149bfb1..9d8af0b3fb64 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -79,7 +79,7 @@ unsigned long long __attribute__((weak)) sched_clock(void)
79} 79}
80EXPORT_SYMBOL_GPL(sched_clock); 80EXPORT_SYMBOL_GPL(sched_clock);
81 81
82static __read_mostly int sched_clock_running; 82__read_mostly int sched_clock_running;
83 83
84#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK 84#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
85__read_mostly int sched_clock_stable; 85__read_mostly int sched_clock_stable;
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index e6590e7312e8..e95b77414a99 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -250,6 +250,8 @@ void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq)
250#undef P 250#undef P
251} 251}
252 252
253extern __read_mostly int sched_clock_running;
254
253static void print_cpu(struct seq_file *m, int cpu) 255static void print_cpu(struct seq_file *m, int cpu)
254{ 256{
255 struct rq *rq = cpu_rq(cpu); 257 struct rq *rq = cpu_rq(cpu);
@@ -321,21 +323,42 @@ static const char *sched_tunable_scaling_names[] = {
321 323
322static int sched_debug_show(struct seq_file *m, void *v) 324static int sched_debug_show(struct seq_file *m, void *v)
323{ 325{
324 u64 now = ktime_to_ns(ktime_get()); 326 u64 ktime, sched_clk, cpu_clk;
327 unsigned long flags;
325 int cpu; 328 int cpu;
326 329
327 SEQ_printf(m, "Sched Debug Version: v0.09, %s %.*s\n", 330 local_irq_save(flags);
331 ktime = ktime_to_ns(ktime_get());
332 sched_clk = sched_clock();
333 cpu_clk = local_clock();
334 local_irq_restore(flags);
335
336 SEQ_printf(m, "Sched Debug Version: v0.10, %s %.*s\n",
328 init_utsname()->release, 337 init_utsname()->release,
329 (int)strcspn(init_utsname()->version, " "), 338 (int)strcspn(init_utsname()->version, " "),
330 init_utsname()->version); 339 init_utsname()->version);
331 340
332 SEQ_printf(m, "now at %Lu.%06ld msecs\n", SPLIT_NS(now)); 341#define P(x) \
342 SEQ_printf(m, "%-40s: %Ld\n", #x, (long long)(x))
343#define PN(x) \
344 SEQ_printf(m, "%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x))
345 PN(ktime);
346 PN(sched_clk);
347 PN(cpu_clk);
348 P(jiffies);
349#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
350 P(sched_clock_stable);
351#endif
352#undef PN
353#undef P
354
355 SEQ_printf(m, "\n");
356 SEQ_printf(m, "sysctl_sched\n");
333 357
334#define P(x) \ 358#define P(x) \
335 SEQ_printf(m, " .%-40s: %Ld\n", #x, (long long)(x)) 359 SEQ_printf(m, " .%-40s: %Ld\n", #x, (long long)(x))
336#define PN(x) \ 360#define PN(x) \
337 SEQ_printf(m, " .%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x)) 361 SEQ_printf(m, " .%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x))
338 P(jiffies);
339 PN(sysctl_sched_latency); 362 PN(sysctl_sched_latency);
340 PN(sysctl_sched_min_granularity); 363 PN(sysctl_sched_min_granularity);
341 PN(sysctl_sched_wakeup_granularity); 364 PN(sysctl_sched_wakeup_granularity);