diff options
Diffstat (limited to 'kernel/trace/trace_sched_wakeup.c')
-rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index e27adef0171a..f48957886102 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
@@ -25,6 +25,7 @@ static int __read_mostly tracer_enabled; | |||
25 | static struct task_struct *wakeup_task; | 25 | static struct task_struct *wakeup_task; |
26 | static int wakeup_cpu; | 26 | static int wakeup_cpu; |
27 | static unsigned wakeup_prio = -1; | 27 | static unsigned wakeup_prio = -1; |
28 | static int wakeup_rt; | ||
28 | 29 | ||
29 | static raw_spinlock_t wakeup_lock = | 30 | static raw_spinlock_t wakeup_lock = |
30 | (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; | 31 | (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; |
@@ -224,7 +225,7 @@ probe_wakeup(struct rq *rq, struct task_struct *p, int success) | |||
224 | tracing_record_cmdline(p); | 225 | tracing_record_cmdline(p); |
225 | tracing_record_cmdline(current); | 226 | tracing_record_cmdline(current); |
226 | 227 | ||
227 | if (likely(!rt_task(p)) || | 228 | if ((wakeup_rt && !rt_task(p)) || |
228 | p->prio >= wakeup_prio || | 229 | p->prio >= wakeup_prio || |
229 | p->prio >= current->prio) | 230 | p->prio >= current->prio) |
230 | return; | 231 | return; |
@@ -321,7 +322,7 @@ static void stop_wakeup_tracer(struct trace_array *tr) | |||
321 | unregister_trace_sched_wakeup(probe_wakeup); | 322 | unregister_trace_sched_wakeup(probe_wakeup); |
322 | } | 323 | } |
323 | 324 | ||
324 | static int wakeup_tracer_init(struct trace_array *tr) | 325 | static int __wakeup_tracer_init(struct trace_array *tr) |
325 | { | 326 | { |
326 | tracing_max_latency = 0; | 327 | tracing_max_latency = 0; |
327 | wakeup_trace = tr; | 328 | wakeup_trace = tr; |
@@ -329,6 +330,18 @@ static int wakeup_tracer_init(struct trace_array *tr) | |||
329 | return 0; | 330 | return 0; |
330 | } | 331 | } |
331 | 332 | ||
333 | static int wakeup_tracer_init(struct trace_array *tr) | ||
334 | { | ||
335 | wakeup_rt = 0; | ||
336 | return __wakeup_tracer_init(tr); | ||
337 | } | ||
338 | |||
339 | static int wakeup_rt_tracer_init(struct trace_array *tr) | ||
340 | { | ||
341 | wakeup_rt = 1; | ||
342 | return __wakeup_tracer_init(tr); | ||
343 | } | ||
344 | |||
332 | static void wakeup_tracer_reset(struct trace_array *tr) | 345 | static void wakeup_tracer_reset(struct trace_array *tr) |
333 | { | 346 | { |
334 | stop_wakeup_tracer(tr); | 347 | stop_wakeup_tracer(tr); |
@@ -360,6 +373,19 @@ static struct tracer wakeup_tracer __read_mostly = | |||
360 | #endif | 373 | #endif |
361 | }; | 374 | }; |
362 | 375 | ||
376 | static struct tracer wakeup_rt_tracer __read_mostly = | ||
377 | { | ||
378 | .name = "wakeup_rt", | ||
379 | .init = wakeup_rt_tracer_init, | ||
380 | .reset = wakeup_tracer_reset, | ||
381 | .start = wakeup_tracer_start, | ||
382 | .stop = wakeup_tracer_stop, | ||
383 | .print_max = 1, | ||
384 | #ifdef CONFIG_FTRACE_SELFTEST | ||
385 | .selftest = trace_selftest_startup_wakeup, | ||
386 | #endif | ||
387 | }; | ||
388 | |||
363 | __init static int init_wakeup_tracer(void) | 389 | __init static int init_wakeup_tracer(void) |
364 | { | 390 | { |
365 | int ret; | 391 | int ret; |
@@ -368,6 +394,10 @@ __init static int init_wakeup_tracer(void) | |||
368 | if (ret) | 394 | if (ret) |
369 | return ret; | 395 | return ret; |
370 | 396 | ||
397 | ret = register_tracer(&wakeup_rt_tracer); | ||
398 | if (ret) | ||
399 | return ret; | ||
400 | |||
371 | return 0; | 401 | return 0; |
372 | } | 402 | } |
373 | device_initcall(init_wakeup_tracer); | 403 | device_initcall(init_wakeup_tracer); |