Skip to contentSkip to conversation

perf tools: Fix reading of build-id from vDSO

PATCH In review Ben Hutchings 3 participants 3 messages Jan 13, 2016 – Jan 19, 2016 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: Fix reading of build-id from vDSO

We need to use the long name (the filename) when reading the build-id from a DSO. Using the short name doesn't work for (at least) vDSOs.

---
 tools/perf/util/symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/symbol.c +1 -1
index cd08027..b60bc49 100644
@@ -1465,7 +1465,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 (filename__read_build_id(dso->name, build_id, BUILD_ID_SIZE) > 0)
+	if (filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
 		dso__set_build_id(dso, build_id);
 
 	/*
#1 lore raw

Em Wed, Jan 13, 2016 at 05:23:01PM +0000, Ben Hutchings escreveu:

Quoted 2 lines

We need to use the long name (the filename) when reading the build-id from a DSO. Using the short name doesn't work for (at least) vDSOs.

Thanks, we should really prefer the long_name, applied.

- Arnaldo

Quoted 18 lines
---
 tools/perf/util/symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/symbol.c +1 -1
index cd08027..b60bc49 100644
@@ -1465,7 +1465,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 (filename__read_build_id(dso->name, build_id, BUILD_ID_SIZE) > 0)
+	if (filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
 		dso__set_build_id(dso, build_id);
 
 	/*
#2 lore raw

[tip:perf/urgent] perf symbols: Fix reading of build-id from vDSO

In reply to Ben Hutchings
perf symbols: Fix reading of build-id from vDSO
Commit-ID:  40c4a0f92aed570cc529a1e5c24c7e04a0ce8b85
Gitweb:     http://git.kernel.org/tip/40c4a0f92aed570cc529a1e5c24c7e04a0ce8b85
Author:     Ben Hutchings <[email protected]>
AuthorDate: Wed, 13 Jan 2016 17:23:01 +0000
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 15 Jan 2016 16:31:58 -0300

perf symbols: Fix reading of build-id from vDSO

We need to use the long name (the filename) when reading the build-id from a DSO. Using the short name doesn't work for (at least) vDSOs.

---
 tools/perf/util/symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/symbol.c +1 -1
index 3b2de6e..ab02209 100644
@@ -1466,7 +1466,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 (filename__read_build_id(dso->name, build_id, BUILD_ID_SIZE) > 0)
+	if (filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
 		dso__set_build_id(dso, build_id);
 
 	/*