perf tui: Remove annotate from popup menu after failure

Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
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 0e8dc259
...@@ -914,6 +914,9 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na ...@@ -914,6 +914,9 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na
switch (toupper(es.u.key)) { switch (toupper(es.u.key)) {
case 'A': case 'A':
if (browser->selection->map == NULL &&
browser->selection->map->dso->annotate_warned)
continue;
goto do_annotate; goto do_annotate;
case 'D': case 'D':
goto zoom_dso; goto zoom_dso;
...@@ -957,6 +960,7 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na ...@@ -957,6 +960,7 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na
} }
if (browser->selection->sym != NULL && if (browser->selection->sym != NULL &&
!browser->selection->map->dso->annotate_warned &&
asprintf(&options[nr_options], "Annotate %s", asprintf(&options[nr_options], "Annotate %s",
browser->selection->sym->name) > 0) browser->selection->sym->name) > 0)
annotate = nr_options++; annotate = nr_options++;
...@@ -991,6 +995,7 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na ...@@ -991,6 +995,7 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na
struct hist_entry *he; struct hist_entry *he;
do_annotate: do_annotate:
if (browser->selection->map->dso->origin == DSO__ORIG_KERNEL) { if (browser->selection->map->dso->origin == DSO__ORIG_KERNEL) {
browser->selection->map->dso->annotate_warned = 1;
ui_helpline__puts("No vmlinux file found, can't " ui_helpline__puts("No vmlinux file found, can't "
"annotate with just a " "annotate with just a "
"kallsyms file"); "kallsyms file");
......
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