diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-17 17:50:13 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-25 08:37:15 -0400 |
commit | ba361c92e73c771fcbbbd24c2c03c322e2de2e31 (patch) | |
tree | 77ee1c1273490cc8703fdff6e6a86771b762f903 /tools | |
parent | 6ca2a9c6543dd1a307c0250991d4de93550209ce (diff) |
perf tools: Don't stop synthesizing threads when one vanishes
The perf_event__synthesize_threads routine synthesizes all the existing
threads in the system, because we don't have any kernel facilities to
ask for PERF_RECORD_{FORK,MMAP,COMM} for existing threads.
It was returning an error as soon as one thread couldn't be synthesized,
which is a bit extreme when, for instance, a forkish workload is
running, like a kernel compile.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-i7oas1eodpoer2bx38fwyasv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/event.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 0ae444ef1429..ca9ca285406a 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -405,16 +405,15 @@ int perf_event__synthesize_threads(struct perf_tool *tool, | |||
405 | 405 | ||
406 | if (*end) /* only interested in proper numerical dirents */ | 406 | if (*end) /* only interested in proper numerical dirents */ |
407 | continue; | 407 | continue; |
408 | 408 | /* | |
409 | if (__event__synthesize_thread(comm_event, mmap_event, pid, 1, | 409 | * We may race with exiting thread, so don't stop just because |
410 | process, tool, machine) != 0) { | 410 | * one thread couldn't be synthesized. |
411 | err = -1; | 411 | */ |
412 | goto out_closedir; | 412 | __event__synthesize_thread(comm_event, mmap_event, pid, 1, |
413 | } | 413 | process, tool, machine); |
414 | } | 414 | } |
415 | 415 | ||
416 | err = 0; | 416 | err = 0; |
417 | out_closedir: | ||
418 | closedir(proc); | 417 | closedir(proc); |
419 | out_free_mmap: | 418 | out_free_mmap: |
420 | free(mmap_event); | 419 | free(mmap_event); |