diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-04-08 17:19:43 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-04-10 10:45:43 -0300 |
commit | e2fbc15124a38eb4eafbdb171b1eca4acc64174b (patch) | |
tree | 2287a61efc2e549faa53242553f5a8419beab318 /tools/perf/ui/browser.c | |
parent | f16552393191f0e0801d8640f2030fe2103912b9 (diff) |
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>
Diffstat (limited to 'tools/perf/ui/browser.c')
-rw-r--r-- | tools/perf/ui/browser.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index 19503e838738..115aa1af5a02 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c @@ -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; |