linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Add basic support for PE binary format
@ 2020-06-01 11:19 Rémi Bernon
  2020-06-01 11:19 ` [RFC PATCH 1/2] perf dso: Use libbfd to read build_id and .gnu_debuglink section Rémi Bernon
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rémi Bernon @ 2020-06-01 11:19 UTC (permalink / raw)
  To: linux-kernel, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: Rémi Bernon

Hi,

I'm currently trying to improve compatibility between Wine and perf, and
I would like to have you opinion on this approach.

The main problem is that Wine uses PE binary format for most of its code
(and of course the Windows application it runs are also using PE binary
format), and perf is currently unable to parse them to get the symbol
table or even to find the debug file location from build_id or
.gnu_debuglink section.

I know that there's the possibility to use a perfmap file to map address
ranges to symbols, but it requires the runtime to generate it. And in
this case the information is already there in the PE files, just not in
a format that perf supports.

I also have some alternate ways to make it work, using perf-specific
tweaks in Wine for instance. But I believe that having better support of
PE binary format in perf could be generally useful, although for now
Wine is the only use-case I know.

This first starts using libbfd to parse the build_id and .gnu_debuglink
section, to make sure perf gets the debug file location even if the code
modules are in PE binary format.

Then, as Wine also generates debug files in PE or PDB format by default,
it also tries to use libbfd to parse the symbol table from the debug
file if libelf failed.

Of course, advanced features will still lack, but this makes it possible
to have perf report symbols and source-level annotations for any Windows
code running in Wine, assuming the modules aren't stripped.

Cheers,

Rémi Bernon (2):
  perf dso: Use libbfd to read build_id and .gnu_debuglink section
  perf symbols: Try reading the symbol table with libbfd

 tools/perf/util/symbol-elf.c |  65 +++++++++++++++++-
 tools/perf/util/symbol.c     | 124 +++++++++++++++++++++++++++++++++++
 2 files changed, 186 insertions(+), 3 deletions(-)

-- 
2.26.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-13  0:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01 11:19 [RFC PATCH 0/2] Add basic support for PE binary format Rémi Bernon
2020-06-01 11:19 ` [RFC PATCH 1/2] perf dso: Use libbfd to read build_id and .gnu_debuglink section Rémi Bernon
2020-06-01 17:48   ` Jiri Olsa
2020-07-13  0:57   ` [perf dso] 7816ab73f2: perf-sanity-tests.Probe_SDT_events.fail kernel test robot
2020-06-01 11:19 ` [RFC PATCH 2/2] perf symbols: Try reading the symbol table with libbfd Rémi Bernon
2020-06-01 17:45   ` Jiri Olsa
2020-06-01 15:01 ` [RFC PATCH 0/2] Add basic support for PE binary format Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).