[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220106222030.227499-1-jolsa@kernel.org>
Date: Thu, 6 Jan 2022 23:20:30 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Christy Lee <christyc.y.lee@...il.com>,
lkml <linux-kernel@...r.kernel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Michael Petlan <mpetlan@...hat.com>,
Ian Rogers <irogers@...gle.com>,
linux-perf-users@...r.kernel.org
Subject: [PATCH] perf trace: Move SIGCHLD handler init to trace__run
When running perf trace with bpf object like:
# perf trace -e openat,/.../tools/perf/examples/bpf/hello.c
the event parsing eventually calls llvm__get_kbuild_opts function
that runs script and that ends up with SIGCHLD delivered to perf
trace handler, which assumes the workload process is done and quits
perf trace.
Moving the SIGCHLD handler setup directly to trace__run, where the
event is parsed and object already compiled.
Cc: Christy Lee <christyc.y.lee@...il.com>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
tools/perf/builtin-trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 94d62a92f1a1..4282ef9ec354 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -3925,6 +3925,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
bool draining = false;
trace->live = true;
+ signal(SIGCHLD, sig_handler);
if (!trace->raw_augmented_syscalls) {
if (trace->trace_syscalls && trace__add_syscall_newtp(trace))
@@ -4876,7 +4877,6 @@ int cmd_trace(int argc, const char **argv)
signal(SIGSEGV, sighandler_dump_stack);
signal(SIGFPE, sighandler_dump_stack);
- signal(SIGCHLD, sig_handler);
signal(SIGINT, sig_handler);
trace.evlist = evlist__new();
--
2.33.1
Powered by blists - more mailing lists