Skip to content

Commit

Permalink
perf hists browser: Refuse 'a' hotkey on non symbolic views
Browse files Browse the repository at this point in the history
We don't allocate the histogram data structures for --sort lists without
"sym", so, just like was done for the menu, don't try to annotate when
'a' is pressed, just warn the user about it.

Reported-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-27mjg02s2mbw8lfxqv7jpzec@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Oct 21, 2011
1 parent cf95800 commit a6e51f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/perf/util/ui/browsers/hists.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,13 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
*/
goto out_free_stack;
case 'a':
if (!browser->has_symbols) {
ui__warning(
"Annotation is only available for symbolic views, "
"include \"sym\" in --sort to use it.");
continue;
}

if (browser->selection == NULL ||
browser->selection->sym == NULL ||
browser->selection->map->dso->annotate_warned)
Expand Down

0 comments on commit a6e51f9

Please sign in to comment.