Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf probe: Fix debuginfo__new() to enable build-id based debuginfo

Fix debuginfo__new() to set the build-id to dso before
dso__read_binary_type_filename() so that it can find
DSO_BINARY_TYPE__BUILDID_DEBUGINFO debuginfo correctly.

However, this may not change the result, because elfutils (libdwfl) has
its own debuginfo finder. With/without this patch, the perf probe
correctly find the debuginfo file.

This is just a failsafe and keep code's sanity (if you use
dso__read_binary_type_filename(), you must set the build-id to the dso.)

Reported-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Masami Hiramatsu <mhriamat@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Stefan Liebler <stli@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Link: http://lore.kernel.org/lkml/162532651863.393143.11692691321219235810.stgit@devnote2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Masami Hiramatsu and committed by
Arnaldo Carvalho de Melo
eb4717f7 44c2cd80

+5
+5
tools/perf/util/probe-finder.c
··· 118 118 char buf[PATH_MAX], nil = '\0'; 119 119 struct dso *dso; 120 120 struct debuginfo *dinfo = NULL; 121 + struct build_id bid; 121 122 122 123 /* Try to open distro debuginfo files */ 123 124 dso = dso__new(path); 124 125 if (!dso) 125 126 goto out; 127 + 128 + /* Set the build id for DSO_BINARY_TYPE__BUILDID_DEBUGINFO */ 129 + if (is_regular_file(path) && filename__read_build_id(path, &bid) > 0) 130 + dso__set_build_id(dso, &bid); 126 131 127 132 for (type = distro_dwarf_types; 128 133 !dinfo && *type != DSO_BINARY_TYPE__NOT_FOUND;