From: Jiri Olsa <jolsa@redhat.com>
To: "Rémi Bernon" <rbernon@codeweavers.com>
Cc: linux-kernel@vger.kernel.org,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Jacek Caban <jacek@codeweavers.com>
Subject: Re: [PATCH 2/3] perf symbols: Try reading the symbol table with libbfd
Date: Wed, 8 Jul 2020 20:33:51 +0200 [thread overview]
Message-ID: <20200708183351.GB3581918@krava> (raw)
In-Reply-To: <32a0da28-aca7-34b0-adb2-b0f61021fba8@codeweavers.com>
On Wed, Jul 08, 2020 at 11:44:24AM +0200, Rémi Bernon wrote:
> On 2020-06-24 15:40, Rémi Bernon wrote:
> > On 2020-06-24 15:25, Jiri Olsa wrote:
> > > On Wed, Jun 24, 2020 at 12:30:40PM +0200, Remi Bernon wrote:
> > >
> > > SNIP
> > >
> > > > +
> > > > + symbols__insert(&dso->symbols, symbol);
> > > > + }
> > > > +#ifdef bfd_get_section
> > > > +#undef bfd_asymbol_section
> > > > +#endif
> > > > +
> > > > + symbols__fixup_end(&dso->symbols);
> > > > + symbols__fixup_duplicate(&dso->symbols);
> > > > + dso->adjust_symbols = 1;
> > > > +
> > > > + err = 0;
> > > > +out_free:
> > > > + free(symbols);
> > > > +out_close:
> > > > + bfd_close(abfd);
> > > > + return err;
> > > > +}
> > > > +#endif
> > > > +
> > > > static bool dso__is_compatible_symtab_type(struct dso *dso, bool kmod,
> > > > enum dso_binary_type type)
> > > > {
> > > > @@ -1695,6 +1816,7 @@ int dso__load(struct dso *dso, struct map *map)
> > > > bool next_slot = false;
> > > > bool is_reg;
> > > > bool nsexit;
> > > > + int bfdrc = -1;
> > > > int sirc = -1;
> > > > enum dso_binary_type symtab_type = binary_type_symtab[i];
> > > > @@ -1713,12 +1835,19 @@ int dso__load(struct dso *dso, struct map *map)
> > > > nsinfo__mountns_exit(&nsc);
> > > > is_reg = is_regular_file(name);
> > > > +#ifdef HAVE_LIBBFD_SUPPORT
> > > > if (is_reg)
> > > > + bfdrc = dso__load_bfd_symbols(dso, name);
> > > > +#endif
> > >
> > > so the comment says that we try bfd when the libelf fails,
> > > but the code seems to do the oposite.. starts with bfd
> > > and skip libelf if it's ok
> > >
> > > jirka
> > >
> >
> > Ah, sorry I forgot to reword the commit comment to match the changes,
> > thanks for noticing. It should probably be something like that:
> >
> > Trying to read symbols on non-ELF binaries with libbfd, when
> > supported, makes it possible for perf to report symbols and
> > annotations for Windows applications running under Wine.
> >
> > As you suggested, the libbfd code now tries to detect the binary format,
> > and early rejects if ELF is detected, so it then falls back to the
> > libelf code path.
>
> Hi, it doesn't seem there's more comments, should I just resend the series
> with the updated commit message?
yes, please fix the changelog.. patches look good to me, but
I'd like somebody else with better bfd knowledge to review them ;-)
jirka
next prev parent reply other threads:[~2020-07-08 18:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 10:30 [PATCH 1/3] perf dso: Use libbfd to read build_id and .gnu_debuglink section Remi Bernon
2020-06-24 10:30 ` [PATCH 2/3] perf symbols: Try reading the symbol table with libbfd Remi Bernon
2020-06-24 13:25 ` Jiri Olsa
2020-06-24 13:40 ` Rémi Bernon
[not found] ` <32a0da28-aca7-34b0-adb2-b0f61021fba8@codeweavers.com>
2020-07-08 18:33 ` Jiri Olsa [this message]
2020-06-24 10:30 ` [PATCH 3/3] perf tests: Add test for PE binary format support Remi Bernon
2020-06-24 13:10 ` Jiri Olsa
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=20200708183351.GB3581918@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jacek@codeweavers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rbernon@codeweavers.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