aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/ui/browsers/hists.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index 662b7217a031..4a3a7c96b9b6 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -1074,30 +1074,44 @@ static int perf_evsel_menu__run(struct perf_evsel_menu *menu,
1074 if (!menu->selection) 1074 if (!menu->selection)
1075 continue; 1075 continue;
1076 pos = menu->selection; 1076 pos = menu->selection;
1077 perf_evlist__set_selected(evlist, pos);
1078browse_hists: 1077browse_hists:
1078 perf_evlist__set_selected(evlist, pos);
1079 /*
1080 * Give the calling tool a chance to populate the non
1081 * default evsel resorted hists tree.
1082 */
1083 if (timer)
1084 timer(arg);
1079 ev_name = event_name(pos); 1085 ev_name = event_name(pos);
1080 key = perf_evsel__hists_browse(pos, nr_events, help, 1086 key = perf_evsel__hists_browse(pos, nr_events, help,
1081 ev_name, true, timer, 1087 ev_name, true, timer,
1082 arg, delay_secs); 1088 arg, delay_secs);
1083 ui_browser__show_title(&menu->b, title); 1089 ui_browser__show_title(&menu->b, title);
1084 break; 1090 switch (key) {
1091 case NEWT_KEY_TAB:
1092 if (pos->node.next == &evlist->entries)
1093 pos = list_entry(evlist->entries.next, struct perf_evsel, node);
1094 else
1095 pos = list_entry(pos->node.next, struct perf_evsel, node);
1096 goto browse_hists;
1097 case NEWT_KEY_UNTAB:
1098 if (pos->node.prev == &evlist->entries)
1099 pos = list_entry(evlist->entries.prev, struct perf_evsel, node);
1100 else
1101 pos = list_entry(pos->node.prev, struct perf_evsel, node);
1102 goto browse_hists;
1103 case NEWT_KEY_ESCAPE:
1104 if (!ui__dialog_yesno("Do you really want to exit?"))
1105 continue;
1106 /* Fall thru */
1107 case 'q':
1108 case CTRL('c'):
1109 goto out;
1110 default:
1111 continue;
1112 }
1085 case NEWT_KEY_LEFT: 1113 case NEWT_KEY_LEFT:
1086 continue; 1114 continue;
1087 case NEWT_KEY_TAB:
1088 if (pos->node.next == &evlist->entries)
1089 pos = list_entry(evlist->entries.next, struct perf_evsel, node);
1090 else
1091 pos = list_entry(pos->node.next, struct perf_evsel, node);
1092 perf_evlist__set_selected(evlist, pos);
1093 goto browse_hists;
1094 case NEWT_KEY_UNTAB:
1095 if (pos->node.prev == &evlist->entries)
1096 pos = list_entry(evlist->entries.prev, struct perf_evsel, node);
1097 else
1098 pos = list_entry(pos->node.prev, struct perf_evsel, node);
1099 perf_evlist__set_selected(evlist, pos);
1100 goto browse_hists;
1101 case NEWT_KEY_ESCAPE: 1115 case NEWT_KEY_ESCAPE:
1102 if (!ui__dialog_yesno("Do you really want to exit?")) 1116 if (!ui__dialog_yesno("Do you really want to exit?"))
1103 continue; 1117 continue;
@@ -1106,7 +1120,7 @@ browse_hists:
1106 case CTRL('c'): 1120 case CTRL('c'):
1107 goto out; 1121 goto out;
1108 default: 1122 default:
1109 break; 1123 continue;
1110 } 1124 }
1111 } 1125 }
1112 1126