提交 d62d77fd 编写于 作者: N Nick Piggin 提交者: Ingo Molnar

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: NNick 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: NIngo Molnar <mingo@elte.hu>
上级 c10edee2
......@@ -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;
}
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册