From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Christy Lee <christyc.y.lee@gmail.com>,
lkml <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Michael Petlan <mpetlan@redhat.com>,
Ian Rogers <irogers@google.com>,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf trace: Move SIGCHLD handler init to trace__run
Date: Fri, 7 Jan 2022 15:57:28 -0300 [thread overview]
Message-ID: <YdiNGGNPG3DpTEUe@kernel.org> (raw)
In-Reply-To: <20220106222030.227499-1-jolsa@kernel.org>
Em Thu, Jan 06, 2022 at 11:20:30PM +0100, Jiri Olsa escreveu:
> 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.
Thanks, reproduced the problem without the patch, applied, tested again,
works.
- Arnaldo
> Cc: Christy Lee <christyc.y.lee@gmail.com>
> Signed-off-by: Jiri Olsa <jolsa@kernel.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
--
- Arnaldo
prev parent reply other threads:[~2022-01-07 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-06 22:20 [PATCH] perf trace: Move SIGCHLD handler init to trace__run Jiri Olsa
2022-01-07 18:57 ` Arnaldo Carvalho de Melo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YdiNGGNPG3DpTEUe@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=alexander.shishkin@linux.intel.com \
--cc=christyc.y.lee@gmail.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=mpetlan@redhat.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.