Skip to content

Commit

Permalink
ftrace: restore iterator trace in pipe read
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Thomas Gleixner committed May 23, 2008
1 parent 8487c23 commit b5685ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

/*
Expand Down

0 comments on commit b5685ae

Please sign in to comment.