diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-04-20 11:35:50 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-04-22 17:03:09 -0400 |
commit | cb41a29076e9f95547da46578d5c8804f7b8845d (patch) | |
tree | ef6bcfbcd99ddbe366f1de94b6aa75da7c6ea55f /kernel | |
parent | 0637e029392386e6996f5d6574aadccee8315efa (diff) |
nohz: Add basic tracing
It's not obvious to find out why the full dynticks subsystem
doesn't always stop the tick: whether this is due to kthreads,
posix timers, perf events, etc...
These new tracepoints are here to help the user diagnose
the failures and test this feature.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Gilad Ben Yossef <gilad@benyossef.com>
Cc: Hakan Akkan <hakanakkan@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/tick-sched.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 12a900dbb819..85e05ab98253 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | #include "tick-internal.h" | 29 | #include "tick-internal.h" |
30 | 30 | ||
31 | #include <trace/events/timer.h> | ||
32 | |||
31 | /* | 33 | /* |
32 | * Per cpu nohz control structure | 34 | * Per cpu nohz control structure |
33 | */ | 35 | */ |
@@ -153,14 +155,20 @@ static bool can_stop_full_tick(void) | |||
153 | { | 155 | { |
154 | WARN_ON_ONCE(!irqs_disabled()); | 156 | WARN_ON_ONCE(!irqs_disabled()); |
155 | 157 | ||
156 | if (!sched_can_stop_tick()) | 158 | if (!sched_can_stop_tick()) { |
159 | trace_tick_stop(0, "more than 1 task in runqueue\n"); | ||
157 | return false; | 160 | return false; |
161 | } | ||
158 | 162 | ||
159 | if (!posix_cpu_timers_can_stop_tick(current)) | 163 | if (!posix_cpu_timers_can_stop_tick(current)) { |
164 | trace_tick_stop(0, "posix timers running\n"); | ||
160 | return false; | 165 | return false; |
166 | } | ||
161 | 167 | ||
162 | if (!perf_event_can_stop_tick()) | 168 | if (!perf_event_can_stop_tick()) { |
169 | trace_tick_stop(0, "perf events running\n"); | ||
163 | return false; | 170 | return false; |
171 | } | ||
164 | 172 | ||
165 | /* sched_clock_tick() needs us? */ | 173 | /* sched_clock_tick() needs us? */ |
166 | #ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | 174 | #ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK |
@@ -168,8 +176,10 @@ static bool can_stop_full_tick(void) | |||
168 | * TODO: kick full dynticks CPUs when | 176 | * TODO: kick full dynticks CPUs when |
169 | * sched_clock_stable is set. | 177 | * sched_clock_stable is set. |
170 | */ | 178 | */ |
171 | if (!sched_clock_stable) | 179 | if (!sched_clock_stable) { |
180 | trace_tick_stop(0, "unstable sched clock\n"); | ||
172 | return false; | 181 | return false; |
182 | } | ||
173 | #endif | 183 | #endif |
174 | 184 | ||
175 | return true; | 185 | return true; |
@@ -631,6 +641,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, | |||
631 | 641 | ||
632 | ts->last_tick = hrtimer_get_expires(&ts->sched_timer); | 642 | ts->last_tick = hrtimer_get_expires(&ts->sched_timer); |
633 | ts->tick_stopped = 1; | 643 | ts->tick_stopped = 1; |
644 | trace_tick_stop(1, " "); | ||
634 | } | 645 | } |
635 | 646 | ||
636 | /* | 647 | /* |