diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-29 13:18:39 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-29 13:18:39 -0400 |
commit | 4d439517561d009e170e2fe20be1ba25e19abe75 (patch) | |
tree | 5d15d0b5bb4a214641d31cf740c9478495d0dbd5 /tools | |
parent | 1dfd7b494b3d8fb1e8a7383a8095f77eb058cd83 (diff) |
perf symbols: Properly align symbol_conf.priv_size
If symbol_conf.priv_size is not a multiple of "sizeof(u64)" we'll bus
error on sparc64 in symbol__new because the "struct symbol *" pointer
is computed by adding symbol_conf.priv_size to the memory allocated.
We cannot isolate the fix to symbol__new and symbol__delete since the
private area is computed by subtracting the priv_size value from a
"struct symbol" pointer, so then the private area can still be
potentially unaligned.
So, simply align the symbol_conf.priv_size value in symbol__init()
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20110328.175849.112593455.davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/symbol.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 8f73907a959e..f06c10f092ba 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -2406,6 +2406,8 @@ int symbol__init(void) | |||
2406 | if (symbol_conf.initialized) | 2406 | if (symbol_conf.initialized) |
2407 | return 0; | 2407 | return 0; |
2408 | 2408 | ||
2409 | symbol_conf.priv_size = ALIGN(symbol_conf.priv_size, sizeof(u64)); | ||
2410 | |||
2409 | elf_version(EV_CURRENT); | 2411 | elf_version(EV_CURRENT); |
2410 | if (symbol_conf.sort_by_name) | 2412 | if (symbol_conf.sort_by_name) |
2411 | symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) - | 2413 | symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) - |