mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
perf evlist: We need to poll all event file descriptors
Because we want to notice when they get POLLHUP'ed, so that we can figure out when all threads exited in a workload being monitored. We can't just monitor the fds that were mmaped, we need to notice when all the fds that were PERF_EVENT_IOC_SET_OUTPUT'ed too, because the mmap stays even after the fd that originally was used to do the mmap call went away, its only when all the set-output fds for a mmap are gone that the mmap is. Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Don Zickus <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
1 parent
8179672c2f
commit
033fa713db
1 file changed
+2
-2
@@ -717,8 +717,6 @@ static int __perf_evlist__mmap(struct perf_evlist *evlist, int idx,
|
||||
evlist->mmap[idx].base = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
perf_evlist__add_pollfd(evlist, fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -745,6 +743,8 @@ static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx,
|
||||
return -1;
|
||||
}
|
||||
|
||||
perf_evlist__add_pollfd(evlist, fd);
|
||||
|
||||
if ((evsel->attr.read_format & PERF_FORMAT_ID) &&
|
||||
perf_evlist__id_add_fd(evlist, evsel, cpu, thread, fd) < 0)
|
||||
return -1;
|
||||
|
||||
Reference in new issue
Block a user