| Subject: ftrace-crap.patch |
| From: Thomas Gleixner <tglx@linutronix.de> |
| Date: Fri, 09 Sep 2011 16:55:53 +0200 |
| |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| --- |
| kernel/trace/trace.c | 26 ++++++++++++++++++++++++-- |
| kernel/trace/trace.h | 1 - |
| 2 files changed, 24 insertions(+), 3 deletions(-) |
| |
| Index: linux-stable/kernel/trace/trace.c |
| =================================================================== |
| --- linux-stable.orig/kernel/trace/trace.c |
| +++ linux-stable/kernel/trace/trace.c |
| @@ -402,11 +402,13 @@ EXPORT_SYMBOL_GPL(tracing_is_on); |
| */ |
| void trace_wake_up(void) |
| { |
| +#ifndef CONFIG_PREEMPT_RT_FULL |
| const unsigned long delay = msecs_to_jiffies(2); |
| |
| if (trace_flags & TRACE_ITER_BLOCK) |
| return; |
| schedule_delayed_work(&wakeup_work, delay); |
| +#endif |
| } |
| |
| static int __init set_buf_size(char *str) |
| @@ -756,6 +758,12 @@ update_max_tr_single(struct trace_array |
| } |
| #endif /* CONFIG_TRACER_MAX_TRACE */ |
| |
| +#ifndef CONFIG_PREEMPT_RT_FULL |
| +static void default_wait_pipe(struct trace_iterator *iter); |
| +#else |
| +#define default_wait_pipe poll_wait_pipe |
| +#endif |
| + |
| /** |
| * register_tracer - register a tracer with the ftrace system. |
| * @type - the plugin for the tracer |
| @@ -3365,6 +3373,7 @@ static int tracing_release_pipe(struct i |
| return 0; |
| } |
| |
| +#ifndef CONFIG_PREEMPT_RT_FULL |
| static unsigned int |
| tracing_poll_pipe(struct file *filp, poll_table *poll_table) |
| { |
| @@ -3386,8 +3395,7 @@ tracing_poll_pipe(struct file *filp, pol |
| } |
| } |
| |
| - |
| -void default_wait_pipe(struct trace_iterator *iter) |
| +static void default_wait_pipe(struct trace_iterator *iter) |
| { |
| DEFINE_WAIT(wait); |
| |
| @@ -3398,6 +3406,20 @@ void default_wait_pipe(struct trace_iter |
| |
| finish_wait(&trace_wait, &wait); |
| } |
| +#else |
| +static unsigned int |
| +tracing_poll_pipe(struct file *filp, poll_table *poll_table) |
| +{ |
| + struct trace_iterator *iter = filp->private_data; |
| + |
| + if ((trace_flags & TRACE_ITER_BLOCK) || !trace_empty(iter)) |
| + return POLLIN | POLLRDNORM; |
| + poll_wait_pipe(iter); |
| + if (!trace_empty(iter)) |
| + return POLLIN | POLLRDNORM; |
| + return 0; |
| +} |
| +#endif |
| |
| /* |
| * This is a make-shift waitqueue. |
| Index: linux-stable/kernel/trace/trace.h |
| =================================================================== |
| --- linux-stable.orig/kernel/trace/trace.h |
| +++ linux-stable/kernel/trace/trace.h |
| @@ -367,7 +367,6 @@ void trace_init_global_iter(struct trace |
| |
| void tracing_iter_reset(struct trace_iterator *iter, int cpu); |
| |
| -void default_wait_pipe(struct trace_iterator *iter); |
| void poll_wait_pipe(struct trace_iterator *iter); |
| |
| void ftrace(struct trace_array *tr, |