diff options
Diffstat (limited to 'kernel/trace/trace_sched_wakeup.c')
-rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 33 |
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 | */ | ||
269 | static int save_tracer_enabled; | ||
270 | |||
271 | static void start_wakeup_tracer(struct trace_array *tr) | 265 | static 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; |
318 | fail_deprobe_wake_new: | 309 | fail_deprobe_wake_new: |
@@ -324,7 +315,6 @@ fail_deprobe: | |||
324 | static void stop_wakeup_tracer(struct trace_array *tr) | 315 | static 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 | ||
356 | static void wakeup_tracer_stop(struct trace_array *tr) | 345 | static 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 | |||
362 | static void wakeup_tracer_open(struct trace_iterator *iter) | ||
363 | { | ||
364 | /* stop the trace while dumping */ | ||
365 | tracer_enabled = 0; | ||
366 | } | ||
367 | |||
368 | static 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 | ||
377 | static struct tracer wakeup_tracer __read_mostly = | 350 | static 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, |