All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf symbol: Do not apply symfs for an absolute vmlinux path
@ 2013-07-17  8:08 Namhyung Kim
  2013-07-17 13:31 ` David Ahern
  2013-07-19  7:53 ` [tip:perf/core] perf symbols: " tip-bot for Namhyung Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2013-07-17  8:08 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Jiri Olsa, David Ahern

From: Namhyung Kim <namhyung.kim@lge.com>

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.

Reported-by: Kwanghyun Yoo <ykh815.yoo@lge.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/symbol.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index d5528e1cc03a..02718e728d59 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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;
-- 
1.7.11.7


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

* Re: [PATCH] perf symbol: Do not apply symfs for an absolute vmlinux path
  2013-07-17  8:08 [PATCH] perf symbol: Do not apply symfs for an absolute vmlinux path Namhyung Kim
@ 2013-07-17 13:31 ` David Ahern
  2013-07-17 15:29   ` Arnaldo Carvalho de Melo
  2013-07-19  7:53 ` [tip:perf/core] perf symbols: " tip-bot for Namhyung Kim
  1 sibling, 1 reply; 4+ messages in thread
From: David Ahern @ 2013-07-17 13:31 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Namhyung Kim, LKML, Jiri Olsa

On 7/17/13 2:08 AM, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
>
> 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.
>
> Reported-by: Kwanghyun Yoo <ykh815.yoo@lge.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Acked-by: David Ahern <dsahern@gmail.com>

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

* Re: [PATCH] perf symbol: Do not apply symfs for an absolute vmlinux path
  2013-07-17 13:31 ` David Ahern
@ 2013-07-17 15:29   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-07-17 15:29 UTC (permalink / raw)
  To: David Ahern
  Cc: Namhyung Kim, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Namhyung Kim, LKML, Jiri Olsa

Em Wed, Jul 17, 2013 at 07:31:32AM -0600, David Ahern escreveu:
> On 7/17/13 2:08 AM, Namhyung Kim wrote:
> >From: Namhyung Kim <namhyung.kim@lge.com>
> >
> >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.
> >
> >Reported-by: Kwanghyun Yoo <ykh815.yoo@lge.com>
> >Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> 

Thanks, applied.

- Arnaldo

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

* [tip:perf/core] perf symbols: Do not apply symfs for an absolute vmlinux path
  2013-07-17  8:08 [PATCH] perf symbol: Do not apply symfs for an absolute vmlinux path Namhyung Kim
  2013-07-17 13:31 ` David Ahern
@ 2013-07-19  7:53 ` tip-bot for Namhyung Kim
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Namhyung Kim @ 2013-07-19  7:53 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, ykh815.yoo, a.p.zijlstra,
	namhyung.kim, namhyung, jolsa, dsahern, tglx

Commit-ID:  5698d2c99ec11006b4c241ebad5252289902b358
Gitweb:     http://git.kernel.org/tip/5698d2c99ec11006b4c241ebad5252289902b358
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Wed, 17 Jul 2013 17:08:15 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Reported-by: Kwanghyun Yoo <ykh815.yoo@lge.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1374048495-3643-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index d5528e1..02718e7 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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;

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

end of thread, other threads:[~2013-07-19  7:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-17  8:08 [PATCH] perf symbol: Do not apply symfs for an absolute vmlinux path Namhyung Kim
2013-07-17 13:31 ` David Ahern
2013-07-17 15:29   ` Arnaldo Carvalho de Melo
2013-07-19  7:53 ` [tip:perf/core] perf symbols: " tip-bot for Namhyung Kim

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.