From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: cclaudio@linux.ibm.com, Jiri Olsa <jolsa@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH] perf trace: Fix SIGSEGV when processing augmented args
Date: Wed, 16 Mar 2022 17:36:57 -0300 [thread overview]
Message-ID: <YjJKaSanKI7LQdEk@kernel.org> (raw)
In-Reply-To: <YjDSRb1wwswKpJNJ@kernel.org>
Em Tue, Mar 15, 2022 at 02:52:05PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Mar 15, 2022 at 10:57:57PM +0530, Naveen N. Rao escreveu:
> > Yes, it looks like the current check in 'perf' isn't working. The below
> > patch also resolves the crash we are seeing:
>
> > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> > index 2f1d20553a0aa3..86b459f4ebdd61 100644
> > --- a/tools/perf/builtin-trace.c
> > +++ b/tools/perf/builtin-trace.c
> > @@ -2326,7 +2326,7 @@ static int trace__sys_enter(struct trace *trace, struct evsel *evsel,
> > * thinking that the extra 2 u64 args are the augmented filename, so just check
> > * here and avoid using augmented syscalls when the evsel is the raw_syscalls one.
> > */
> > - if (evsel != trace->syscalls.events.sys_enter)
> > + if (strcmp(evsel__name(evsel), "raw_syscalls:sys_enter"))
> > augmented_args = syscall__augmented_args(sc, sample, &augmented_args_size, trace->raw_augmented_syscalls_args_size);
> > ttrace->entry_time = sample->time;
> > msg = ttrace->entry_str;
>
> Interesting, that should be equivalent :-\ humm, not really, understood,
> when processing perf.data files we don't setup
> trace->syscalls.events.sys_enter...
>
> switching from strcmp() to something cheaper but equivalent should be
> the fix for now.
I'll add a trace->use_augmented_args boolean that will do this test
once, and then use it in this case and will audit to check if this
should be used in other places.
- Arnaldo
next prev parent reply other threads:[~2022-03-16 20:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 10:47 [PATCH] perf trace: Fix SIGSEGV when processing augmented args Naveen N. Rao
2022-03-14 22:09 ` Arnaldo Carvalho de Melo
2022-03-15 17:27 ` Naveen N. Rao
2022-03-15 17:52 ` Arnaldo Carvalho de Melo
2022-03-16 20:36 ` Arnaldo Carvalho de Melo [this message]
2022-03-17 13:24 ` Naveen N. Rao
2022-07-06 12:31 ` Naveen N. Rao
2022-07-06 15:50 ` Arnaldo Carvalho de Melo
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=YjJKaSanKI7LQdEk@kernel.org \
--to=acme@kernel.org \
--cc=cclaudio@linux.ibm.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox