Skip to content

Commit

Permalink
perf annotate: Allocate history size correctly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nick Piggin authored and Ingo Molnar committed Nov 17, 2009
1 parent c10edee commit d62d77f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int v)
*curr = rb_entry(nd, struct symbol, rb_node);

prev->end = curr->start - 1;
if (prev->hist) {
free(prev->hist);
prev->hist = calloc(sizeof(u64), prev->end - prev->start);
}
prevnd = nd;
}

Expand Down Expand Up @@ -883,6 +887,10 @@ static inline void dso__fill_symbol_holes(struct dso *self)
pos->end = prev->end;
else if (hole)
pos->end = prev->start - 1;
if (pos->hist) {
free(pos->hist);
pos->hist = calloc(sizeof(u64), pos->end - pos->start);
}
}
}
prev = pos;
Expand Down

0 comments on commit d62d77f

Please sign in to comment.