diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-11 12:16:52 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-11 13:56:16 -0500 |
commit | cc841580aa58ad7498b23e282859d07f8b721e24 (patch) | |
tree | 978472344a1ac34c202d07fd6afa9598b2063297 /tools | |
parent | bd3bfe9eda94d3c050830217c1e1c338808de5b2 (diff) |
perf top: Fix annotate segv
Before we had sym_counter, it was initialized to zero and we used that
as an index in the global attrs variable, now we have a list of evsel
entries, and sym_counter became sym_evsel, that remained initialized to
zero (NULL): b00m.
Fix it by initializing it to the first entry in the evsel list.
Bug-introduced: 69aad6f
Reported-by: Kirill Smelkov <kirr@mns.spb.ru>
Tested-by: Kirill Smelkov <kirr@mns.spb.ru>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Kirill Smelkov <kirr@mns.spb.ru>
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')
-rw-r--r-- | tools/perf/builtin-top.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 4b995ee099cf..568b1950e632 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1473,6 +1473,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __used) | |||
1473 | pos->attr.sample_period = default_interval; | 1473 | pos->attr.sample_period = default_interval; |
1474 | } | 1474 | } |
1475 | 1475 | ||
1476 | sym_evsel = list_entry(evsel_list.next, struct perf_evsel, node); | ||
1477 | |||
1476 | symbol_conf.priv_size = (sizeof(struct sym_entry) + | 1478 | symbol_conf.priv_size = (sizeof(struct sym_entry) + |
1477 | (nr_counters + 1) * sizeof(unsigned long)); | 1479 | (nr_counters + 1) * sizeof(unsigned long)); |
1478 | 1480 | ||