Skip to content

Commit c88f209

Browse files
Jiri OlsaIngo Molnar
authored andcommitted
perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path
Revert PERF_EVENT_STATE_EXIT check on read syscall path. It breaks standard way to read counter, which is to open the counter, wait for the monitored process to die and read the counter. Reported-by: Stephane Eranian <eranian@google.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Stephane Eranian <eranian@google.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Stephane Eranian <eranian@google.com> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/20140908143107.GG17728@krava.brq.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent a08b676 commit c88f209

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/events/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,8 +3601,7 @@ perf_read_hw(struct perf_event *event, char __user *buf, size_t count)
36013601
* error state (i.e. because it was pinned but it couldn't be
36023602
* scheduled on to the CPU at some point).
36033603
*/
3604-
if ((event->state == PERF_EVENT_STATE_ERROR) ||
3605-
(event->state == PERF_EVENT_STATE_EXIT))
3604+
if (event->state == PERF_EVENT_STATE_ERROR)
36063605
return 0;
36073606

36083607
if (count < event->read_size)

0 commit comments

Comments
 (0)