Ver Fonte

ftrace: return EOF in trace_pipe on change of tracer

Break out of while loop with EOF when the current_trace changes.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Steven Rostedt há 17 anos atrás
pai
commit
845279972f
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      kernel/trace/trace.c

+ 3 - 0
kernel/trace/trace.c

@@ -2253,6 +2253,9 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
 		if (signal_pending(current))
 			return -EINTR;
 
+		if (iter->trace != current_trace)
+			return 0;
+
 		/*
 		 * We block until we read something and tracing is disabled.
 		 * We still block if tracing is disabled, but we have never