From: Victor Kamensky Date: Tue, 27 Jan 2015 06:34:02 +0000 (-0800) Subject: perf symbols: debuglink should take symfs option into account X-Git-Tag: v4.1-rc1~143^2~66^2~57 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dc6254cf870732804b76a83ff2d8a72fea4365f6;p=karo-tx-linux.git 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 Tested-by: David Ahern Acked-by: David Ahern Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Anton Blanchard Cc: Avi Kivity Cc: Dave Martin Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Russell King Cc: Waiman Long Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1422340442-4673-3-git-send-email-victor.kamensky@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- 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;