linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf symbols: Fix reading build id
@ 2016-07-21  7:09 Uwe Kleine-König
  2016-07-21  7:21 ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2016-07-21  7:09 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: kernel, Alexander Shishkin, Jiri Olsa, linux-kernel,
	Uwe Kleine-König

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

When is_regular_file(name) is called name points to a freshly allocated
and uninitialized chunk of memory, so is_regular_file(name) is usually
false and reading build id is skipped which makes it impossible to
find debug infos when a build id based system is in use.

Fixes: 403567217d3f ("perf symbols: Do not read symbols/data from device files")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 tools/perf/util/symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 54c4ff2b1cee..7044742c828f 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1430,7 +1430,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	 * Read the build id if possible. This is required for
 	 * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
 	 */
-	if (is_regular_file(name) &&
+	if (is_regular_file(dso->long_name) &&
 	    filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
 		dso__set_build_id(dso, build_id);
 
-- 
2.8.1

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

end of thread, other threads:[~2016-07-22  7:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21  7:09 [PATCH] perf symbols: Fix reading build id Uwe Kleine-König
2016-07-21  7:21 ` Marc Kleine-Budde
2016-07-21  7:53   ` Jiri Olsa
2016-07-22  7:34     ` Uwe Kleine-König

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).