aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kamensky <[email protected]>2015-01-26 22:34:02 -0800
committerArnaldo Carvalho de Melo <[email protected]>2015-02-06 11:46:36 +0100
commitdc6254cf870732804b76a83ff2d8a72fea4365f6 (patch)
tree90136b5fc828a8962c00d05d51026400b539fbef
parent4886f2ca19f6ff22ebfbe8e78c79c699e572b89f (diff)
perf symbols: debuglink should take symfs option into account
Currently code that tries to read corresponding debug symbol file from .gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK) does not take in account symfs option, so filename__read_debuglink function cannot open ELF file, if symfs option is used. Fix is to add proper handling of symfs as it is done in other places: use __symbol__join_symfs function to get real file name of target ELF file. Signed-off-by: Victor Kamensky <[email protected]> Tested-by: David Ahern <[email protected]> Acked-by: David Ahern <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Avi Kivity <[email protected]> Cc: Dave Martin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Russell King <[email protected]> Cc: Waiman Long <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/dso.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index a8b3f18db1a5..814554d1b857 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso,
case DSO_BINARY_TYPE__DEBUGLINK: {
char *debuglink;
- strncpy(filename, dso->long_name, size);
- debuglink = filename + dso->long_name_len;
+ len = __symbol__join_symfs(filename, size, dso->long_name);
+ debuglink = filename + len;
while (debuglink != filename && *debuglink != '/')
debuglink--;
if (*debuglink == '/')
debuglink++;
- ret = filename__read_debuglink(dso->long_name, debuglink,
+ ret = filename__read_debuglink(filename, debuglink,
size - (debuglink - filename));
}
break;