All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: use right filename to test
@ 2016-07-05 12:27 Song Shan Gong
  2016-07-05 13:24 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 2+ messages in thread
From: Song Shan Gong @ 2016-07-05 12:27 UTC (permalink / raw)
  To: acme, jolsa; +Cc: dsahern, linux-kernel, Song Shan Gong

When trying to read buildid from file in function
tools/perf/util/symbol.c:dso_load(), perf used wrong filename to test. The
variable 'name' has just allocated and uninitialized before this
sentence.Obviously, the test 'is_regular_file()' is for the latter
'filename__read_build_id()', so the right filename ought to be 'dso->long_name'.

Signed-off-by: Song Shan Gong <gongss@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 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 54c4ff2..7044742 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.3.0

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

end of thread, other threads:[~2016-07-05 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-05 12:27 [PATCH] perf: use right filename to test Song Shan Gong
2016-07-05 13:24 ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.