diff options
| author | Nick Piggin <npiggin@suse.de> | 2009-11-17 06:29:38 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-11-17 10:47:09 -0500 |
| commit | d62d77fd18cc82e839e49b7ef3360e4411f7d2e5 (patch) | |
| tree | a00b21ffcc31d02e50b5edaad77d47e3d1c3a1b9 | |
| parent | c10edee2e1716f8cf217cf52ed01ae4742fcdf3c (diff) | |
perf annotate: Allocate history size correctly
Symbol offset history table size does not get updated properly
when it is being resized. This leads to garbage results in
perf annotate.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | tools/perf/util/symbol.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 226f44a2357d..cbac57549298 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
| @@ -227,6 +227,10 @@ static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int v) | |||
| 227 | *curr = rb_entry(nd, struct symbol, rb_node); | 227 | *curr = rb_entry(nd, struct symbol, rb_node); |
| 228 | 228 | ||
| 229 | prev->end = curr->start - 1; | 229 | prev->end = curr->start - 1; |
| 230 | if (prev->hist) { | ||
| 231 | free(prev->hist); | ||
| 232 | prev->hist = calloc(sizeof(u64), prev->end - prev->start); | ||
| 233 | } | ||
| 230 | prevnd = nd; | 234 | prevnd = nd; |
| 231 | } | 235 | } |
| 232 | 236 | ||
| @@ -883,6 +887,10 @@ static inline void dso__fill_symbol_holes(struct dso *self) | |||
| 883 | pos->end = prev->end; | 887 | pos->end = prev->end; |
| 884 | else if (hole) | 888 | else if (hole) |
| 885 | pos->end = prev->start - 1; | 889 | pos->end = prev->start - 1; |
| 890 | if (pos->hist) { | ||
| 891 | free(pos->hist); | ||
| 892 | pos->hist = calloc(sizeof(u64), pos->end - pos->start); | ||
| 893 | } | ||
| 886 | } | 894 | } |
| 887 | } | 895 | } |
| 888 | prev = pos; | 896 | prev = pos; |
