ftrace: restore iterator trace in pipe read
authorSteven Rostedt <rostedt@goodmis.org>
Mon, 12 May 2008 19:20:58 +0000 (21:20 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 23 May 2008 19:46:53 +0000 (21:46 +0200)
The trace iterator is reset in the read. We still need to restore the tracer
that the trace_pipe was opened with.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/trace/trace.c

index fd4ecc2..d141fc9 100644 (file)
@@ -2202,6 +2202,8 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
 {
        struct trace_iterator *iter = filp->private_data;
        struct trace_array_cpu *data;
+       struct trace_array *tr = iter->tr;
+       struct tracer *tracer = iter->trace;
        static cpumask_t mask;
        static int start;
        unsigned long flags;
@@ -2274,7 +2276,8 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
                cnt = PAGE_SIZE - 1;
 
        memset(iter, 0, sizeof(*iter));
-       iter->tr = &global_trace;
+       iter->tr = tr;
+       iter->trace = tracer;
        iter->pos = -1;
 
        /*