[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200601174545.GF1031432@krava>
Date: Mon, 1 Jun 2020 19:45:45 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Rémi Bernon <rbernon@...eweavers.com>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Mark Rutland <mark.rutland@....com>,
Namhyung Kim <namhyung@...nel.org>,
Jacek Caban <jacek@...eweavers.com>
Subject: Re: [RFC PATCH 2/2] perf symbols: Try reading the symbol table with
libbfd
On Mon, Jun 01, 2020 at 01:19:15PM +0200, Rémi Bernon wrote:
> Wine generates PE binaries for its code modules and also generates
> debug files in PE or PDB formats, which perf cannot parse either.
>
> Trying libbfd, when supported, if the default libelf symbol parsing
> failed, makes it possible to read the symbol table from any binary
> format supported by it, and lets perf report symbols and annotations
> for Windows applications running under Wine.
>
> Because libbfd doesn't provide symbol size (probably because of some
> backends not supporting it), we compute it by first sorting the symbols
> by addresses and then considering that they are sequential in a given
> section.
hi,
would you have some example for easy test on this?
SNIP
> static bool dso__is_compatible_symtab_type(struct dso *dso, bool kmod,
> enum dso_binary_type type)
> {
> @@ -1691,6 +1806,7 @@ int dso__load(struct dso *dso, struct map *map)
> bool next_slot = false;
> bool is_reg;
> bool nsexit;
> + bool bfd_syms = false;
> int sirc = -1;
>
> enum dso_binary_type symtab_type = binary_type_symtab[i];
> @@ -1712,9 +1828,17 @@ int dso__load(struct dso *dso, struct map *map)
> if (is_reg)
> sirc = symsrc__init(ss, dso, name, symtab_type);
>
> +#ifdef HAVE_LIBBFD_SUPPORT
> + if (is_reg && sirc < 0)
> + bfd_syms = dso__load_bfd_symbols(dso, name);
> +#endif
hum, would it be better to find out is it's PE object
and call it directly instead of the failover?
jirka
> +
> if (nsexit)
> nsinfo__mountns_enter(dso->nsinfo, &nsc);
>
> + if (bfd_syms)
> + break;
> +
> if (!is_reg || sirc < 0)
> continue;
>
> --
> 2.26.1
>
Powered by blists - more mailing lists