Skip to content

Commit ff89855

Browse files
namhyungacmel
authored andcommitted
perf synthetic-events: Ignore dead threads during event synthesis
When it synthesize various task events, it scans the list of task first and then accesses later. There's a window threads can die between the two and proc entries may not be available. Instead of bailing out, we can ignore that thread and move on. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 363afa3 commit ff89855

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/perf/util/synthetic-events.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,12 @@ static int __event__synthesize_thread(union perf_event *comm_event,
767767
if (*end)
768768
continue;
769769

770-
rc = -1;
770+
/* some threads may exit just after scan, ignore it */
771771
if (perf_event__prepare_comm(comm_event, pid, _pid, machine,
772772
&tgid, &ppid, &kernel_thread) != 0)
773-
break;
773+
continue;
774774

775+
rc = -1;
775776
if (perf_event__synthesize_fork(tool, fork_event, _pid, tgid,
776777
ppid, process, machine) < 0)
777778
break;

0 commit comments

Comments
 (0)