perf top browser: Handle empty active symbols list

Fixing a SEGV. An empty list could happen when not being able to resolve
symbols, for instance when --vmlinux invalid-file is used.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent b210b3bb
...@@ -76,6 +76,12 @@ static void perf_top_browser__update_rb_tree(struct perf_top_browser *browser) ...@@ -76,6 +76,12 @@ static void perf_top_browser__update_rb_tree(struct perf_top_browser *browser)
browser->root = RB_ROOT; browser->root = RB_ROOT;
browser->b.top = NULL; browser->b.top = NULL;
browser->sum_ksamples = perf_top__decay_samples(top, &browser->root); browser->sum_ksamples = perf_top__decay_samples(top, &browser->root);
/*
* No active symbols
*/
if (top->rb_entries == 0)
return;
perf_top__find_widths(top, &browser->root, &browser->dso_width, perf_top__find_widths(top, &browser->root, &browser->dso_width,
&browser->dso_short_width, &browser->dso_short_width,
&browser->sym_width); &browser->sym_width);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment