提交 dc6254cf 编写于 作者: V Victor Kamensky 提交者: Arnaldo Carvalho de Melo

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: NVictor Kamensky <victor.kamensky@linaro.org>
Tested-by: NDavid Ahern <dsahern@gmail.com>
Acked-by: NDavid Ahern <dsahern@gmail.com>
Acked-by: NNamhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Avi Kivity <avi@cloudius-systems.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Waiman Long <Waiman.Long@hp.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1422340442-4673-3-git-send-email-victor.kamensky@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 4886f2ca
...@@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso, ...@@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso,
case DSO_BINARY_TYPE__DEBUGLINK: { case DSO_BINARY_TYPE__DEBUGLINK: {
char *debuglink; char *debuglink;
strncpy(filename, dso->long_name, size); len = __symbol__join_symfs(filename, size, dso->long_name);
debuglink = filename + dso->long_name_len; debuglink = filename + len;
while (debuglink != filename && *debuglink != '/') while (debuglink != filename && *debuglink != '/')
debuglink--; debuglink--;
if (*debuglink == '/') if (*debuglink == '/')
debuglink++; debuglink++;
ret = filename__read_debuglink(dso->long_name, debuglink, ret = filename__read_debuglink(filename, debuglink,
size - (debuglink - filename)); size - (debuglink - filename));
} }
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册