mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
perf ui browser hists: Provide feedback on unhandled hotkeys
Don't just eat unknown keys without providing visual feedback and instructions on how to see which ones are assigned. Suggested-by: Ingo Molnar <mingo@kernel.org> Tested-by: Ingo Molnar <mingo@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/Z_TYux5fUg2pW-pF@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
62787c90b8
commit
3ceca92c28
|
|
@ -3308,6 +3308,8 @@ static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *h
|
|||
/* Fall thru */
|
||||
default:
|
||||
helpline = "Press '?' for help on key bindings";
|
||||
ui_browser__warn_unhandled_hotkey(&browser->b, key, delay_secs,
|
||||
", use 'h'/'?'/F1 to see actions");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -3568,6 +3570,7 @@ static int perf_evsel_menu__run(struct evsel_menu *menu,
|
|||
case CTRL('c'):
|
||||
goto out;
|
||||
default:
|
||||
ui_browser__warn_unhandled_hotkey(&menu->b, key, delay_secs, NULL);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -3693,7 +3696,7 @@ int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
|
|||
struct popup_action action;
|
||||
char *br_cntr_text = NULL;
|
||||
static const char help[] =
|
||||
" q Quit \n"
|
||||
" q/ESC Quit \n"
|
||||
" B Branch counter abbr list (Optional)\n";
|
||||
|
||||
browser = hist_browser__new(hists);
|
||||
|
|
@ -3720,6 +3723,7 @@ int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
|
|||
|
||||
switch (key) {
|
||||
case 'q':
|
||||
case K_ESC:
|
||||
goto out;
|
||||
case '?':
|
||||
ui_browser__help_window(&browser->b, help);
|
||||
|
|
@ -3746,7 +3750,9 @@ int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
|
|||
}
|
||||
continue;
|
||||
default:
|
||||
break;
|
||||
ui_browser__warn_unhandled_hotkey(&browser->b, key, 0,
|
||||
", use '?' to see actions");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user