diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-02-25 07:30:29 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-02-25 07:30:29 -0500 |
commit | c16bfe9ac389b13a37ff617a09682ecc0685960f (patch) | |
tree | f11a9006f1e58d7c6e760aa123adbb0cb05bc4bf /tools/perf/util/ui/browsers | |
parent | 170ae6bc24e1d7f9bd921a484ec9ea2825497970 (diff) |
perf top browser: Fix up exit keys
The left key was exiting 'perf top --tui' when it really shouldn't, it
was too easy to leave the live annotation window and then press one too
many <- and get out of the tool altogether.
Do just like the report TUI does, ignore the left key for exit and also
ask the user when pressing ESC if that is really what is wanted.
Reported-by: Mike Galbraith <efault@gmx.de>
Suggested-by: Ingo Molnar <mingo@elte.hu>
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/browsers')
-rw-r--r-- | tools/perf/util/ui/browsers/top.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/ui/browsers/top.c b/tools/perf/util/ui/browsers/top.c index 2f47224426b6..e9381ec9bfb1 100644 --- a/tools/perf/util/ui/browsers/top.c +++ b/tools/perf/util/ui/browsers/top.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include "../../annotate.h" | 10 | #include "../../annotate.h" |
11 | #include "../helpline.h" | 11 | #include "../helpline.h" |
12 | #include "../libslang.h" | 12 | #include "../libslang.h" |
13 | #include "../util.h" | ||
13 | #include "../../evlist.h" | 14 | #include "../../evlist.h" |
14 | #include "../../hist.h" | 15 | #include "../../hist.h" |
15 | #include "../../sort.h" | 16 | #include "../../sort.h" |
@@ -174,6 +175,12 @@ static int perf_top_browser__run(struct perf_top_browser *browser) | |||
174 | if (browser->selection) | 175 | if (browser->selection) |
175 | perf_top_browser__annotate(browser); | 176 | perf_top_browser__annotate(browser); |
176 | break; | 177 | break; |
178 | case NEWT_KEY_LEFT: | ||
179 | continue; | ||
180 | case NEWT_KEY_ESCAPE: | ||
181 | if (!ui__dialog_yesno("Do you really want to exit?")) | ||
182 | continue; | ||
183 | /* Fall thru */ | ||
177 | default: | 184 | default: |
178 | goto out; | 185 | goto out; |
179 | } | 186 | } |