aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-01-21 14:36:52 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-22 04:26:50 -0500
commit5bc4564b224c3d9fe6dddafa25f56059bd978231 (patch)
tree22ddf4de8fe115ab7dd8d29c7ff2fa1bf318acd1 /kernel/trace
parent03b30d151a918364c1c7d08bcb3e167be0a3746f (diff)
trace: do not disable wake up tracer on output of trace
Impact: fix to erased trace output To try not to have the outputing of a trace interfere with the wakeup tracer, it would disable tracing while the output was printing. But if a trace had started when it was disabled, it can show a partial trace. To try to solve this, on closing of the tracer, it would clear the trace buffer. The latency tracers (wakeup and irqsoff) have two buffers. One for recording and one for holding the max trace that is printed. The clearing of the trace above should only affect the recording buffer. But for some reason it would move the erased trace to the print buffer. Probably due to a race with the closing of the trace and the saving ofhe max race. The above is all pretty useless, and if the user does not want the printing of the trace to be traced itself, then the user can manual disable tracing. This patch removes all the code that tries to keep the output of the tracer from modifying the trace. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_sched_wakeup.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
index 42ae1e77b6b3..e27adef0171a 100644
--- a/kernel/trace/trace_sched_wakeup.c
+++ b/kernel/trace/trace_sched_wakeup.c
@@ -262,12 +262,6 @@ out:
262 atomic_dec(&wakeup_trace->data[cpu]->disabled); 262 atomic_dec(&wakeup_trace->data[cpu]->disabled);
263} 263}
264 264
265/*
266 * save_tracer_enabled is used to save the state of the tracer_enabled
267 * variable when we disable it when we open a trace output file.
268 */
269static int save_tracer_enabled;
270
271static void start_wakeup_tracer(struct trace_array *tr) 265static void start_wakeup_tracer(struct trace_array *tr)
272{ 266{
273 int ret; 267 int ret;
@@ -306,13 +300,10 @@ static void start_wakeup_tracer(struct trace_array *tr)
306 300
307 register_ftrace_function(&trace_ops); 301 register_ftrace_function(&trace_ops);
308 302
309 if (tracing_is_enabled()) { 303 if (tracing_is_enabled())
310 tracer_enabled = 1; 304 tracer_enabled = 1;
311 save_tracer_enabled = 1; 305 else
312 } else {
313 tracer_enabled = 0; 306 tracer_enabled = 0;
314 save_tracer_enabled = 0;
315 }
316 307
317 return; 308 return;
318fail_deprobe_wake_new: 309fail_deprobe_wake_new:
@@ -324,7 +315,6 @@ fail_deprobe:
324static void stop_wakeup_tracer(struct trace_array *tr) 315static void stop_wakeup_tracer(struct trace_array *tr)
325{ 316{
326 tracer_enabled = 0; 317 tracer_enabled = 0;
327 save_tracer_enabled = 0;
328 unregister_ftrace_function(&trace_ops); 318 unregister_ftrace_function(&trace_ops);
329 unregister_trace_sched_switch(probe_wakeup_sched_switch); 319 unregister_trace_sched_switch(probe_wakeup_sched_switch);
330 unregister_trace_sched_wakeup_new(probe_wakeup); 320 unregister_trace_sched_wakeup_new(probe_wakeup);
@@ -350,28 +340,11 @@ static void wakeup_tracer_start(struct trace_array *tr)
350{ 340{
351 wakeup_reset(tr); 341 wakeup_reset(tr);
352 tracer_enabled = 1; 342 tracer_enabled = 1;
353 save_tracer_enabled = 1;
354} 343}
355 344
356static void wakeup_tracer_stop(struct trace_array *tr) 345static void wakeup_tracer_stop(struct trace_array *tr)
357{ 346{
358 tracer_enabled = 0; 347 tracer_enabled = 0;
359 save_tracer_enabled = 0;
360}
361
362static void wakeup_tracer_open(struct trace_iterator *iter)
363{
364 /* stop the trace while dumping */
365 tracer_enabled = 0;
366}
367
368static void wakeup_tracer_close(struct trace_iterator *iter)
369{
370 /* forget about any processes we were recording */
371 if (save_tracer_enabled) {
372 wakeup_reset(iter->tr);
373 tracer_enabled = 1;
374 }
375} 348}
376 349
377static struct tracer wakeup_tracer __read_mostly = 350static struct tracer wakeup_tracer __read_mostly =
@@ -381,8 +354,6 @@ static struct tracer wakeup_tracer __read_mostly =
381 .reset = wakeup_tracer_reset, 354 .reset = wakeup_tracer_reset,
382 .start = wakeup_tracer_start, 355 .start = wakeup_tracer_start,
383 .stop = wakeup_tracer_stop, 356 .stop = wakeup_tracer_stop,
384 .open = wakeup_tracer_open,
385 .close = wakeup_tracer_close,
386 .print_max = 1, 357 .print_max = 1,
387#ifdef CONFIG_FTRACE_SELFTEST 358#ifdef CONFIG_FTRACE_SELFTEST
388 .selftest = trace_selftest_startup_wakeup, 359 .selftest = trace_selftest_startup_wakeup,