From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
linux-perf-users@vger.kernel.org, mingo@redhat.com,
jolsa@kernel.org, irogers@google.com
Subject: Re: [RFC PATCH v1] perf record: Correct address filters for duplicated symbols
Date: Wed, 11 Jan 2023 10:17:24 -0300 [thread overview]
Message-ID: <Y7625DUhEE+NUfWh@kernel.org> (raw)
In-Reply-To: <20230110104848.hty4upem76lkxj2y@ddolgov.remote.csb>
Em Tue, Jan 10, 2023 at 11:48:48AM +0100, Dmitry Dolgov escreveu:
> > On Mon, Jan 09, 2023 at 09:02:02AM +0200, Adrian Hunter wrote:
> > On 6/01/23 22:37, Dmitrii Dolgov wrote:
> > > It seems the logic to handle duplicated symbols is off. In case if the
> > > symbol index is specified it will:
> > >
> > > * find a match
> > > * continue searching
> > > * check that start is not null and idx is set on the next loop
> > > * exit with the error code 1
> > >
> > > My guess is the expectation was that at this point the second match is
> > > found (because *start is not null), although the new symbol hasn't pass
> > > dso_sym_match yet. Here is how it looks like:
> >
> > If *start && idx > 0 there is no need to match anymore. The
> > code is just getting *size. Looks to me like it should be:
> >
> > diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
> > index 265d20cc126b..c2e323cd7d49 100644
> > --- a/tools/perf/util/auxtrace.c
> > +++ b/tools/perf/util/auxtrace.c
> > @@ -2611,7 +2611,7 @@ static int find_dso_sym(struct dso *dso, const char *sym_name, u64 *start,
> > *size = sym->start - *start;
> > if (idx > 0) {
> > if (*size)
> > - return 1;
> > + return 0;
> > } else if (dso_sym_match(sym, sym_name, &cnt, idx)) {
> > print_duplicate_syms(dso, sym_name);
> > return -EINVAL;
>
> Yes, if there was no intention to continue searching symbols, this would
> work as well. Just in case I have verified this on my test, everything
> is fine. Would you send a patch for that?
So I'll take this as a:
Tested-by: Dmitry Dolgov <9erthalion6@gmail.com>
Ok?
- Arnaldo
next prev parent reply other threads:[~2023-01-11 13:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 20:37 [RFC PATCH v1] perf record: Correct address filters for duplicated symbols Dmitrii Dolgov
2023-01-09 7:02 ` Adrian Hunter
2023-01-10 10:48 ` Dmitry Dolgov
2023-01-11 13:17 ` Arnaldo Carvalho de Melo [this message]
2023-01-11 13:34 ` Dmitry Dolgov
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=Y7625DUhEE+NUfWh@kernel.org \
--to=acme@kernel.org \
--cc=9erthalion6@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.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 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.