mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-15 17:56:26 -05:00
perf ui browser: Add a warn on unhandled hotkey helper
Will be used by the various browsers, looks like:
┌─Warning!───────────────────────────────────────────┐
29.15 │ 3c: cmpl $0x3,(%rbx) │ │
3.77 │ ↓ je 51 │'Ctrl+V' key not associated, use 'h' to see actions!│
16.59 │ movq 0x3b0(%rbx),%rdx │ │
30.65 │ movl 0x8(%rdx),%eax │ │
3.77 │ cmpl %eax,%edi │Press any key... │
0.25 │ ↓ jb 82 └────────────────────────────────────────────────────┘
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:
@@ -233,6 +233,14 @@ int ui_browser__warning(struct ui_browser *browser, int timeout,
|
||||
return key;
|
||||
}
|
||||
|
||||
int ui_browser__warn_unhandled_hotkey(struct ui_browser *browser, int key, int timeout, const char *help)
|
||||
{
|
||||
char kname[32];
|
||||
|
||||
key_name(key, kname, sizeof(kname));
|
||||
return ui_browser__warning(browser, timeout, "\n'%s' key not associated%s!\n", kname, help ?: "");
|
||||
}
|
||||
|
||||
int ui_browser__help_window(struct ui_browser *browser, const char *text)
|
||||
{
|
||||
int key;
|
||||
|
||||
@@ -66,6 +66,7 @@ void __ui_browser__vline(struct ui_browser *browser, unsigned int column,
|
||||
|
||||
int ui_browser__warning(struct ui_browser *browser, int timeout,
|
||||
const char *format, ...);
|
||||
int ui_browser__warn_unhandled_hotkey(struct ui_browser *browser, int key, int timeout, const char *help);
|
||||
int ui_browser__help_window(struct ui_browser *browser, const char *text);
|
||||
bool ui_browser__dialog_yesno(struct ui_browser *browser, const char *text);
|
||||
int ui_browser__input_window(const char *title, const char *text, char *input,
|
||||
|
||||
Reference in New Issue
Block a user