perf trace: Avoid early exit due SIGCHLD from non-workload processes
authorChangbin Du <changbin.du@gmail.com>
Tue, 8 Feb 2022 14:07:25 +0000 (22:07 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 14 Feb 2022 19:02:04 +0000 (16:02 -0300)
commit7069f8873119c69d7863dd0e1fac40a715e3d0e6
tree1a9f41ac84ed8e5c63384231bfae201018eafcb7
parent0bc2ba49101f4ca35e0c878968adb5660ffa2517
perf trace: Avoid early exit due SIGCHLD from non-workload processes

The function trace__symbols_init() runs "perf-read-vdso32" and that ends up
with a SIGCHLD delivered to 'perf'. And this SIGCHLD make perf exit early.

'perf trace' should exit only if the SIGCHLD is from our workload process.
So let's use sigaction() instead of signal() to match such condition.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220208140725.3947-1-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c