All of lore.kernel.org
 help / color / mirror / Atom feed
* 'perf test' failed on ARM
@ 2010-11-23  8:07 ` Ming Lei
  0 siblings, 0 replies; 7+ messages in thread
From: Ming Lei @ 2010-11-23  8:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

'perf test' is failed on linux 2.6.37-rc2/rc3, follows log info:

root at beagleboard:/mnt/omap/linux-2.6-omap/tools/perf# ./perf test -v 3
 1: vmlinux symtab matches kallsyms:
--- start ---
dso__find_symbol_by_name ---- end ----
vmlinux symtab matches kallsyms: FAILED!

Any suggestions?

-- 
Lei Ming

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

* 'perf test' failed on ARM
@ 2010-11-23  8:07 ` Ming Lei
  0 siblings, 0 replies; 7+ messages in thread
From: Ming Lei @ 2010-11-23  8:07 UTC (permalink / raw)
  To: Ian Munsie, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Tom Zanussi, Thomas Gleixner
  Cc: Linux Kernel Mailing List, linux-arm-kernel

Hi,

'perf test' is failed on linux 2.6.37-rc2/rc3, follows log info:

root@beagleboard:/mnt/omap/linux-2.6-omap/tools/perf# ./perf test -v 3
 1: vmlinux symtab matches kallsyms:
--- start ---
dso__find_symbol_by_name ---- end ----
vmlinux symtab matches kallsyms: FAILED!

Any suggestions?

-- 
Lei Ming

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

* 'perf test' failed on ARM
  2010-11-23  8:07 ` Ming Lei
@ 2010-11-23 16:38   ` Rabin Vincent
  -1 siblings, 0 replies; 7+ messages in thread
From: Rabin Vincent @ 2010-11-23 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 23, 2010 at 04:07:39PM +0800, Ming Lei wrote:
> 'perf test' is failed on linux 2.6.37-rc2/rc3, follows log info:
> 
> root at beagleboard:/mnt/omap/linux-2.6-omap/tools/perf# ./perf test -v 3
>  1: vmlinux symtab matches kallsyms:
> --- start ---
> dso__find_symbol_by_name ---- end ----
> vmlinux symtab matches kallsyms: FAILED!
> 
> Any suggestions?

There seems to be a problem with the symbol handling code.  Patch below.
With this patch the command executes further, but the test fails because
of other reasons:

   1: vmlinux symtab matches kallsyms:
  --- start ---
  map_groups__set_modules_path_dir: cannot open /lib/modules/2.6.37-rc3-next-20101122+/kernel dir
  Problems creating module maps, continuing anyway...
  map_groups__set_modules_path_dir: cannot open /lib/modules/2.6.37-rc3-next-20101122+/kernel dir
  Problems creating module maps, continuing anyway...
  Looking at the vmlinux_path (6 entries long)
  Using vmlinux for symbols
  0xc011ab68: diff end addr for __kprobes_text_start v: 0xc012b87f k: 0xc011b353
  0xc012b880: kallsyms_addresses not on kallsyms
  0xc0138c90: kallsyms_num_syms not on kallsyms
  0xc0138ca0: kallsyms_names not on kallsyms
  0xc015c010: kallsyms_markers not on kallsyms
  0xc015c0f0: kallsyms_token_table not on kallsyms
  0xc015c490: kallsyms_token_index not on kallsyms
  Maps only in vmlinux:
   c0014c5c-ffffffff 0 [kernel].init
  Maps in vmlinux with a different name in kallsyms:
  Maps only in kallsyms:
  ---- end ----
  vmlinux symtab matches kallsyms: FAILED!

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

* Re: 'perf test' failed on ARM
@ 2010-11-23 16:38   ` Rabin Vincent
  0 siblings, 0 replies; 7+ messages in thread
From: Rabin Vincent @ 2010-11-23 16:38 UTC (permalink / raw)
  To: Ming Lei
  Cc: Ian Munsie, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Tom Zanussi, Thomas Gleixner,
	Linux Kernel Mailing List, linux-arm-kernel

On Tue, Nov 23, 2010 at 04:07:39PM +0800, Ming Lei wrote:
> 'perf test' is failed on linux 2.6.37-rc2/rc3, follows log info:
> 
> root@beagleboard:/mnt/omap/linux-2.6-omap/tools/perf# ./perf test -v 3
>  1: vmlinux symtab matches kallsyms:
> --- start ---
> dso__find_symbol_by_name ---- end ----
> vmlinux symtab matches kallsyms: FAILED!
> 
> Any suggestions?

There seems to be a problem with the symbol handling code.  Patch below.
With this patch the command executes further, but the test fails because
of other reasons:

   1: vmlinux symtab matches kallsyms:
  --- start ---
  map_groups__set_modules_path_dir: cannot open /lib/modules/2.6.37-rc3-next-20101122+/kernel dir
  Problems creating module maps, continuing anyway...
  map_groups__set_modules_path_dir: cannot open /lib/modules/2.6.37-rc3-next-20101122+/kernel dir
  Problems creating module maps, continuing anyway...
  Looking at the vmlinux_path (6 entries long)
  Using vmlinux for symbols
  0xc011ab68: diff end addr for __kprobes_text_start v: 0xc012b87f k: 0xc011b353
  0xc012b880: kallsyms_addresses not on kallsyms
  0xc0138c90: kallsyms_num_syms not on kallsyms
  0xc0138ca0: kallsyms_names not on kallsyms
  0xc015c010: kallsyms_markers not on kallsyms
  0xc015c0f0: kallsyms_token_table not on kallsyms
  0xc015c490: kallsyms_token_index not on kallsyms
  Maps only in vmlinux:
   c0014c5c-ffffffff 0 [kernel].init
  Maps in vmlinux with a different name in kallsyms:
  Maps only in kallsyms:
  ---- end ----
  vmlinux symtab matches kallsyms: FAILED!

>From e48b8a0dc149e3b8f249f46dc6e9c25e2cc58601 Mon Sep 17 00:00:00 2001
From: Rabin Vincent <rabin@rab.in>
Date: Tue, 23 Nov 2010 21:35:56 +0530
Subject: [PATCH] perf symbols: remove incorrect open-coded container_of()

At least on ARM, padding is inserted between rb_node and sym in struct
symbol_name_rb_node, causing "((void *)sym) - sizeof(struct rb_node)" to
point inside rb_node rather than to the symbol_name_rb_node.  Fix this
by converting the code to use container_of().

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 tools/perf/util/symbol.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index b39f499..0500895 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -295,7 +295,9 @@ static void symbols__insert_by_name(struct rb_root *self, struct symbol *sym)
 {
 	struct rb_node **p = &self->rb_node;
 	struct rb_node *parent = NULL;
-	struct symbol_name_rb_node *symn = ((void *)sym) - sizeof(*parent), *s;
+	struct symbol_name_rb_node *symn, *s;
+
+	symn = container_of(sym, struct symbol_name_rb_node, sym);
 
 	while (*p != NULL) {
 		parent = *p;
-- 
1.7.2.3


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

* 'perf test' failed on ARM
  2010-11-23 16:38   ` Rabin Vincent
@ 2010-11-23 18:17     ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-11-23 18:17 UTC (permalink / raw)
  To: linux-arm-kernel

Em Tue, Nov 23, 2010 at 10:08:18PM +0530, Rabin Vincent escreveu:
> On Tue, Nov 23, 2010 at 04:07:39PM +0800, Ming Lei wrote:
> > 'perf test' is failed on linux 2.6.37-rc2/rc3, follows log info:
> > 
> > root at beagleboard:/mnt/omap/linux-2.6-omap/tools/perf# ./perf test -v 3
> >  1: vmlinux symtab matches kallsyms:
> > --- start ---
> > dso__find_symbol_by_name ---- end ----
> > vmlinux symtab matches kallsyms: FAILED!
> > 
> > Any suggestions?
> 
> There seems to be a problem with the symbol handling code.  Patch below.
> With this patch the command executes further, but the test fails because
> of other reasons:
> 
>    1: vmlinux symtab matches kallsyms:
>   --- start ---
>   map_groups__set_modules_path_dir: cannot open /lib/modules/2.6.37-rc3-next-20101122+/kernel dir
>   Problems creating module maps, continuing anyway...
>   map_groups__set_modules_path_dir: cannot open /lib/modules/2.6.37-rc3-next-20101122+/kernel dir
>   Problems creating module maps, continuing anyway...
>   Looking at the vmlinux_path (6 entries long)
>   Using vmlinux for symbols
>   0xc011ab68: diff end addr for __kprobes_text_start v: 0xc012b87f k: 0xc011b353
>   0xc012b880: kallsyms_addresses not on kallsyms
>   0xc0138c90: kallsyms_num_syms not on kallsyms
>   0xc0138ca0: kallsyms_names not on kallsyms
>   0xc015c010: kallsyms_markers not on kallsyms
>   0xc015c0f0: kallsyms_token_table not on kallsyms
>   0xc015c490: kallsyms_token_index not on kallsyms
>   Maps only in vmlinux:
>    c0014c5c-ffffffff 0 [kernel].init
>   Maps in vmlinux with a different name in kallsyms:
>   Maps only in kallsyms:
>   ---- end ----
>   vmlinux symtab matches kallsyms: FAILED!
> 
> >From e48b8a0dc149e3b8f249f46dc6e9c25e2cc58601 Mon Sep 17 00:00:00 2001
> From: Rabin Vincent <rabin@rab.in>
> Date: Tue, 23 Nov 2010 21:35:56 +0530
> Subject: [PATCH] perf symbols: remove incorrect open-coded container_of()
> 
> At least on ARM, padding is inserted between rb_node and sym in struct
> symbol_name_rb_node, causing "((void *)sym) - sizeof(struct rb_node)" to
> point inside rb_node rather than to the symbol_name_rb_node.  Fix this
> by converting the code to use container_of().
> 
> Signed-off-by: Rabin Vincent <rabin@rab.in>

Ouch, thanks for the patch, container_of is much cleaner.

- Arnaldo

>  tools/perf/util/symbol.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index b39f499..0500895 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -295,7 +295,9 @@ static void symbols__insert_by_name(struct rb_root *self, struct symbol *sym)
>  {
>  	struct rb_node **p = &self->rb_node;
>  	struct rb_node *parent = NULL;
> -	struct symbol_name_rb_node *symn = ((void *)sym) - sizeof(*parent), *s;
> +	struct symbol_name_rb_node *symn, *s;
> +
> +	symn = container_of(sym, struct symbol_name_rb_node, sym);
>  
>  	while (*p != NULL) {
>  		parent = *p;
> -- 
> 1.7.2.3

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

* Re: 'perf test' failed on ARM
@ 2010-11-23 18:17     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-11-23 18:17 UTC (permalink / raw)
  To: Rabin Vincent
  Cc: Ming Lei, Ian Munsie, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Tom Zanussi, Thomas Gleixner, Linux Kernel Mailing List,
	linux-arm-kernel

Em Tue, Nov 23, 2010 at 10:08:18PM +0530, Rabin Vincent escreveu:
> On Tue, Nov 23, 2010 at 04:07:39PM +0800, Ming Lei wrote:
> > 'perf test' is failed on linux 2.6.37-rc2/rc3, follows log info:
> > 
> > root@beagleboard:/mnt/omap/linux-2.6-omap/tools/perf# ./perf test -v 3
> >  1: vmlinux symtab matches kallsyms:
> > --- start ---
> > dso__find_symbol_by_name ---- end ----
> > vmlinux symtab matches kallsyms: FAILED!
> > 
> > Any suggestions?
> 
> There seems to be a problem with the symbol handling code.  Patch below.
> With this patch the command executes further, but the test fails because
> of other reasons:
> 
>    1: vmlinux symtab matches kallsyms:
>   --- start ---
>   map_groups__set_modules_path_dir: cannot open /lib/modules/2.6.37-rc3-next-20101122+/kernel dir
>   Problems creating module maps, continuing anyway...
>   map_groups__set_modules_path_dir: cannot open /lib/modules/2.6.37-rc3-next-20101122+/kernel dir
>   Problems creating module maps, continuing anyway...
>   Looking at the vmlinux_path (6 entries long)
>   Using vmlinux for symbols
>   0xc011ab68: diff end addr for __kprobes_text_start v: 0xc012b87f k: 0xc011b353
>   0xc012b880: kallsyms_addresses not on kallsyms
>   0xc0138c90: kallsyms_num_syms not on kallsyms
>   0xc0138ca0: kallsyms_names not on kallsyms
>   0xc015c010: kallsyms_markers not on kallsyms
>   0xc015c0f0: kallsyms_token_table not on kallsyms
>   0xc015c490: kallsyms_token_index not on kallsyms
>   Maps only in vmlinux:
>    c0014c5c-ffffffff 0 [kernel].init
>   Maps in vmlinux with a different name in kallsyms:
>   Maps only in kallsyms:
>   ---- end ----
>   vmlinux symtab matches kallsyms: FAILED!
> 
> >From e48b8a0dc149e3b8f249f46dc6e9c25e2cc58601 Mon Sep 17 00:00:00 2001
> From: Rabin Vincent <rabin@rab.in>
> Date: Tue, 23 Nov 2010 21:35:56 +0530
> Subject: [PATCH] perf symbols: remove incorrect open-coded container_of()
> 
> At least on ARM, padding is inserted between rb_node and sym in struct
> symbol_name_rb_node, causing "((void *)sym) - sizeof(struct rb_node)" to
> point inside rb_node rather than to the symbol_name_rb_node.  Fix this
> by converting the code to use container_of().
> 
> Signed-off-by: Rabin Vincent <rabin@rab.in>

Ouch, thanks for the patch, container_of is much cleaner.

- Arnaldo

>  tools/perf/util/symbol.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index b39f499..0500895 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -295,7 +295,9 @@ static void symbols__insert_by_name(struct rb_root *self, struct symbol *sym)
>  {
>  	struct rb_node **p = &self->rb_node;
>  	struct rb_node *parent = NULL;
> -	struct symbol_name_rb_node *symn = ((void *)sym) - sizeof(*parent), *s;
> +	struct symbol_name_rb_node *symn, *s;
> +
> +	symn = container_of(sym, struct symbol_name_rb_node, sym);
>  
>  	while (*p != NULL) {
>  		parent = *p;
> -- 
> 1.7.2.3

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

* [tip:perf/urgent] perf symbols: Remove incorrect open-coded container_of()
  2010-11-23 16:38   ` Rabin Vincent
  (?)
  (?)
@ 2010-11-23 19:52   ` tip-bot for Rabin Vincent
  -1 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Rabin Vincent @ 2010-11-23 19:52 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, tzanussi, rabin,
	a.p.zijlstra, imunsie, tglx, tom.leiming, mingo

Commit-ID:  02a9d03772aa1ff33a26180a2da0bfb191240eda
Gitweb:     http://git.kernel.org/tip/02a9d03772aa1ff33a26180a2da0bfb191240eda
Author:     Rabin Vincent <rabin@rab.in>
AuthorDate: Tue, 23 Nov 2010 22:08:18 +0530
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 23 Nov 2010 16:30:32 -0200

perf symbols: Remove incorrect open-coded container_of()

At least on ARM, padding is inserted between rb_node and sym in struct
symbol_name_rb_node, causing "((void *)sym) - sizeof(struct rb_node)" to
point inside rb_node rather than to the symbol_name_rb_node.  Fix this
by converting the code to use container_of().

Cc: Ian Munsie <imunsie@au1.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ming Lei <tom.leiming@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <20101123163106.GA25677@debian>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index b39f499..0500895 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -295,7 +295,9 @@ static void symbols__insert_by_name(struct rb_root *self, struct symbol *sym)
 {
 	struct rb_node **p = &self->rb_node;
 	struct rb_node *parent = NULL;
-	struct symbol_name_rb_node *symn = ((void *)sym) - sizeof(*parent), *s;
+	struct symbol_name_rb_node *symn, *s;
+
+	symn = container_of(sym, struct symbol_name_rb_node, sym);
 
 	while (*p != NULL) {
 		parent = *p;

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

end of thread, other threads:[~2010-11-23 19:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23  8:07 'perf test' failed on ARM Ming Lei
2010-11-23  8:07 ` Ming Lei
2010-11-23 16:38 ` Rabin Vincent
2010-11-23 16:38   ` Rabin Vincent
2010-11-23 18:17   ` Arnaldo Carvalho de Melo
2010-11-23 18:17     ` Arnaldo Carvalho de Melo
2010-11-23 19:52   ` [tip:perf/urgent] perf symbols: Remove incorrect open-coded container_of() tip-bot for Rabin Vincent

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.