]> git.baikalelectronics.ru Git - kernel.git/commit
perf trace: Avoid early exit due to running SIGCHLD handler before it makes sense to
authorJiri Olsa <jolsa@redhat.com>
Thu, 6 Jan 2022 22:20:30 +0000 (23:20 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 7 Jan 2022 18:45:19 +0000 (15:45 -0300)
commit2c7d7501128702082f1a99667cb584595c636698
tree5121f205f5964447b1838056d3e23e89984aaa00
parentcca6182b3e24be7e2880930a4d55ff930e4a6edc
perf trace: Avoid early exit due to running SIGCHLD handler before it makes sense to

When running 'perf trace' with an BPF object like:

  # perf trace -e openat,tools/perf/examples/bpf/hello.c

the event parsing eventually calls llvm__get_kbuild_opts() that runs a
script and that ends up with SIGCHLD delivered to the 'perf trace'
handler, which assumes the workload process is done and quits 'perf
trace'.

Move the SIGCHLD handler setup directly to trace__run(), where the event
is parsed and the object is already compiled.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Christy Lee <christyc.y.lee@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20220106222030.227499-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c