aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/ui/browsers/hists.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-10-13 07:31:22 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-10-13 07:53:18 -0400
commited7e5662ddff6a60bdae830ff65547c2eeed6f9a (patch)
tree6a36c0963619426f2220330d0b9216cf00262110 /tools/perf/util/ui/browsers/hists.c
parent3af6e33867b3814a73c3f3ba991a13d7304ad23a (diff)
perf ui browser: Remove ui_browser__add_exit_keys
Users (hist_browser, etc) should just handle all keys, discarding the ones they don't handle. 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-fjouann12v2k58t6vdd2wawb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/ui/browsers/hists.c')
-rw-r--r--tools/perf/util/ui/browsers/hists.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index 603d6ee5a0d7..662b7217a031 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -302,9 +302,6 @@ static int hist_browser__run(struct hist_browser *self, const char *ev_name,
302{ 302{
303 int key; 303 int key;
304 char title[160]; 304 char title[160];
305 int sym_exit_keys[] = { 'a', 'h', 'C', 'd', 'E', 't', 0, };
306 int exit_keys[] = { '?', 'h', 'D', NEWT_KEY_LEFT, NEWT_KEY_RIGHT,
307 NEWT_KEY_TAB, NEWT_KEY_UNTAB, NEWT_KEY_ENTER, 0, };
308 305
309 self->b.entries = &self->hists->entries; 306 self->b.entries = &self->hists->entries;
310 self->b.nr_entries = self->hists->nr_entries; 307 self->b.nr_entries = self->hists->nr_entries;
@@ -317,10 +314,6 @@ static int hist_browser__run(struct hist_browser *self, const char *ev_name,
317 "Press '?' for help on key bindings") < 0) 314 "Press '?' for help on key bindings") < 0)
318 return -1; 315 return -1;
319 316
320 ui_browser__add_exit_keys(&self->b, exit_keys);
321 if (self->has_symbols)
322 ui_browser__add_exit_keys(&self->b, sym_exit_keys);
323
324 while (1) { 317 while (1) {
325 key = ui_browser__run(&self->b, delay_secs); 318 key = ui_browser__run(&self->b, delay_secs);
326 319
@@ -921,8 +914,11 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
921 !ui__dialog_yesno("Do you really want to exit?")) 914 !ui__dialog_yesno("Do you really want to exit?"))
922 continue; 915 continue;
923 /* Fall thru */ 916 /* Fall thru */
924 default: 917 case 'q':
918 case CTRL('c'):
925 goto out_free_stack; 919 goto out_free_stack;
920 default:
921 continue;
926 } 922 }
927 923
928 if (!browser->has_symbols) 924 if (!browser->has_symbols)
@@ -1056,7 +1052,6 @@ static int perf_evsel_menu__run(struct perf_evsel_menu *menu,
1056 int nr_events, const char *help, 1052 int nr_events, const char *help,
1057 void(*timer)(void *arg), void *arg, int delay_secs) 1053 void(*timer)(void *arg), void *arg, int delay_secs)
1058{ 1054{
1059 int exit_keys[] = { NEWT_KEY_ENTER, NEWT_KEY_RIGHT, 0, };
1060 struct perf_evlist *evlist = menu->b.priv; 1055 struct perf_evlist *evlist = menu->b.priv;
1061 struct perf_evsel *pos; 1056 struct perf_evsel *pos;
1062 const char *ev_name, *title = "Available samples"; 1057 const char *ev_name, *title = "Available samples";
@@ -1066,8 +1061,6 @@ static int perf_evsel_menu__run(struct perf_evsel_menu *menu,
1066 "ESC: exit, ENTER|->: Browse histograms") < 0) 1061 "ESC: exit, ENTER|->: Browse histograms") < 0)
1067 return -1; 1062 return -1;
1068 1063
1069 ui_browser__add_exit_keys(&menu->b, exit_keys);
1070
1071 while (1) { 1064 while (1) {
1072 key = ui_browser__run(&menu->b, delay_secs); 1065 key = ui_browser__run(&menu->b, delay_secs);
1073 1066
@@ -1091,15 +1084,6 @@ browse_hists:
1091 break; 1084 break;
1092 case NEWT_KEY_LEFT: 1085 case NEWT_KEY_LEFT:
1093 continue; 1086 continue;
1094 case NEWT_KEY_ESCAPE:
1095 if (!ui__dialog_yesno("Do you really want to exit?"))
1096 continue;
1097 /* Fall thru */
1098 default:
1099 goto out;
1100 }
1101
1102 switch (key) {
1103 case NEWT_KEY_TAB: 1087 case NEWT_KEY_TAB:
1104 if (pos->node.next == &evlist->entries) 1088 if (pos->node.next == &evlist->entries)
1105 pos = list_entry(evlist->entries.next, struct perf_evsel, node); 1089 pos = list_entry(evlist->entries.next, struct perf_evsel, node);
@@ -1114,6 +1098,10 @@ browse_hists:
1114 pos = list_entry(pos->node.prev, struct perf_evsel, node); 1098 pos = list_entry(pos->node.prev, struct perf_evsel, node);
1115 perf_evlist__set_selected(evlist, pos); 1099 perf_evlist__set_selected(evlist, pos);
1116 goto browse_hists; 1100 goto browse_hists;
1101 case NEWT_KEY_ESCAPE:
1102 if (!ui__dialog_yesno("Do you really want to exit?"))
1103 continue;
1104 /* Fall thru */
1117 case 'q': 1105 case 'q':
1118 case CTRL('c'): 1106 case CTRL('c'):
1119 goto out; 1107 goto out;