aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/ui/browsers/hists.c
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2011-04-08 14:31:26 +0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-04-15 12:51:49 -0300
commitdb9a9cbc8142eed008e242e389938689c6feb1ba (patch)
treecb4311d8906cba65b0de09c18bd881986d0c2ed5 /tools/perf/util/ui/browsers/hists.c
parentperf_event: Fix cgrp event scheduling bug in perf_enable_on_exec() (diff)
downloadlinux-dev-db9a9cbc8142eed008e242e389938689c6feb1ba.tar.xz
linux-dev-db9a9cbc8142eed008e242e389938689c6feb1ba.zip
perf hists browser: Fix seg fault when annotate null symbol
In hists browser, press hotkey 'a' to annotate current symbol. Now it causes segment fault if 'a' is pressed on a null symbol. Here are 2 small bugs: - In perf_evsel__hists_browse, the condition check after 'a' is pressed is not correct, we should check ->sym instead of ->map. - In symbol__tui_annotate we must check whether sym is NULL or not before getting annotation structure. This patch fixes above 2 small bugs. Link: http://lkml.kernel.org/r/1302244286.4106.36.camel@minggr.sh.intel.com Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r--tools/perf/util/ui/browsers/hists.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index 798efdca3ead..5d767c622dfc 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -851,7 +851,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel,
goto out_free_stack;
case 'a':
if (browser->selection == NULL ||
- browser->selection->map == NULL ||
+ browser->selection->sym == NULL ||
browser->selection->map->dso->annotate_warned)
continue;
goto do_annotate;