perf symbol: Do not apply symfs for an absolute vmlinux path
Namhyung Kim
maintainerPATCH 1/1 perf symbol: Do not apply symfs for an absolute vmlinux path
From: Namhyung Kim <[email protected]>
If an user gives both of --symfs and --vmlinux option, the vmlinux will be searched under the symfs directory. This is somewhat confusing since vmlinux often lives in kernel build directory or somewhere other than user space binaries.
So it'd be better not adding symfs prefix for a vmlinux if it has an absolute pathname.
--- tools/perf/util/symbol.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
tools/perf/util/symbol.c +5 -2
@@ -888,8 +888,11 @@ int dso__load_vmlinux(struct dso *dso, struct map *map,char symfs_vmlinux[PATH_MAX ];enum dso_binary_type symtab_type; -snprintf (symfs_vmlinux,sizeof (symfs_vmlinux),"%s%s" , - symbol_conf.symfs, vmlinux); +if (vmlinux[0 ] =='/' ) +snprintf (symfs_vmlinux,sizeof (symfs_vmlinux),"%s" , vmlinux); +else +snprintf (symfs_vmlinux,sizeof (symfs_vmlinux),"%s%s" , + symbol_conf.symfs, vmlinux);if (dso->kernel ==DSO_TYPE_GUEST_KERNEL ) symtab_type =DSO_BINARY_TYPE__GUEST_VMLINUX ;
Signature · 1 line
1.7.11.7
Quoted 7 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
If an user gives both of --symfs and --vmlinux option, the vmlinux will be searched under the symfs directory. This is somewhat confusing since vmlinux often lives in kernel build directory or somewhere other than user space binaries.
Quoted 5 lines
So it'd be better not adding symfs prefix for a vmlinux if it has an absolute pathname.
Reported-by Kwanghyun Yoo <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
Arnaldo Carvalho de Melo
AppliedEm Wed, Jul 17, 2013 at 07:31:32AM -0600, David Ahern escreveu:
Quoted 8 lines · Namhyung Kim
Quoted 7 lines
From: Namhyung Kim <[email protected]>
If an user gives both of --symfs and --vmlinux option, the vmlinux will be searched under the symfs directory. This is somewhat confusing since vmlinux often lives in kernel build directory or somewhere other than user space binaries.
Quoted 6 lines
Quoted 5 lines
So it'd be better not adding symfs prefix for a vmlinux if it has an absolute pathname.
Reported-by Kwanghyun Yoo <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
Thanks, applied.
- Arnaldo
tip-bot for Namhyung Kim
merge bot[tip:perf/core] perf symbols: Do not apply symfs for an absolute vmlinux path
In reply to Namhyung Kimperf symbols: Do not apply symfs for an absolute vmlinux path
Commit-ID: 5698d2c99ec11006b4c241ebad5252289902b358 Gitweb: http://git.kernel.org/tip/5698d2c99ec11006b4c241ebad5252289902b358 Author: Namhyung Kim <[email protected]> AuthorDate: Wed, 17 Jul 2013 17:08:15 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 17 Jul 2013 12:23:57 -0300
perf symbols: Do not apply symfs for an absolute vmlinux path
If an user gives both of --symfs and --vmlinux option, the vmlinux will be searched under the symfs directory. This is somewhat confusing since vmlinux often lives in kernel build directory or somewhere other than user space binaries.
So it'd be better not adding symfs prefix for a vmlinux if it has an absolute pathname.
--- tools/perf/util/symbol.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
tools/perf/util/symbol.c +5 -2
@@ -888,8 +888,11 @@ int dso__load_vmlinux(struct dso *dso, struct map *map,char symfs_vmlinux[PATH_MAX ];enum dso_binary_type symtab_type; -snprintf (symfs_vmlinux,sizeof (symfs_vmlinux),"%s%s" , - symbol_conf.symfs, vmlinux); +if (vmlinux[0 ] =='/' ) +snprintf (symfs_vmlinux,sizeof (symfs_vmlinux),"%s" , vmlinux); +else +snprintf (symfs_vmlinux,sizeof (symfs_vmlinux),"%s%s" , + symbol_conf.symfs, vmlinux);if (dso->kernel ==DSO_TYPE_GUEST_KERNEL ) symtab_type =DSO_BINARY_TYPE__GUEST_VMLINUX ;