perf dso: Use libbfd to read build_id and .gnu_debuglink section
authorRemi Bernon <rbernon@codeweavers.com>
Fri, 21 Aug 2020 16:52:36 +0000 (18:52 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 4 Sep 2020 17:38:15 +0000 (14:38 -0300)
commitba0509dcb7f806403b23234320711c45be9dccec
tree9722722208c5d892cae6590d8a3e46ff000f74eb
parente71e19a9ea70952a53d58a99971820ce6c1794a8
perf dso: Use libbfd to read build_id and .gnu_debuglink section

Wine generates PE binaries for most of its modules and perf is unable to
parse these files to get build_id or .gnu_debuglink section.

Using libbfd when available, instead of libelf, makes it possible to
resolve debug file location regardless of the dso binary format.

Committer notes:

Made the filename__read_build_id() variant that uses abfd->build_id
depend on the feature test that defines HAVE_LIBBFD_BUILDID_SUPPORT, to
get this to continue building with older libbfd/binutils.

Signed-off-by: Remi Bernon <rbernon@codeweavers.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jacek Caban <jacek@codeweavers.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20200821165238.1340315-1-rbernon@codeweavers.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol-elf.c