diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-01 08:21:44 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-01 08:21:44 -0500 |
commit | 3166fc8fb6a2f52273d545e970297524e02c3e39 (patch) | |
tree | 6f3174295ca7df1edad287903e8ef6c4458a1e5f /tools/perf/util/ui | |
parent | b210b3bb1b002f27165325a5edb6ebce3c168e92 (diff) |
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: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/ui')
-rw-r--r-- | tools/perf/util/ui/browsers/top.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/ui/browsers/top.c b/tools/perf/util/ui/browsers/top.c index e9381ec9bfb1..5a06538532af 100644 --- a/tools/perf/util/ui/browsers/top.c +++ b/tools/perf/util/ui/browsers/top.c | |||
@@ -76,6 +76,12 @@ static void perf_top_browser__update_rb_tree(struct perf_top_browser *browser) | |||
76 | browser->root = RB_ROOT; | 76 | browser->root = RB_ROOT; |
77 | browser->b.top = NULL; | 77 | browser->b.top = NULL; |
78 | browser->sum_ksamples = perf_top__decay_samples(top, &browser->root); | 78 | browser->sum_ksamples = perf_top__decay_samples(top, &browser->root); |
79 | /* | ||
80 | * No active symbols | ||
81 | */ | ||
82 | if (top->rb_entries == 0) | ||
83 | return; | ||
84 | |||
79 | perf_top__find_widths(top, &browser->root, &browser->dso_width, | 85 | perf_top__find_widths(top, &browser->root, &browser->dso_width, |
80 | &browser->dso_short_width, | 86 | &browser->dso_short_width, |
81 | &browser->sym_width); | 87 | &browser->sym_width); |