diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-04-09 16:02:43 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-04-10 10:46:41 -0300 |
commit | 92c48ec231e2e73356418bdece2b8af855cf85b2 (patch) | |
tree | 604b708fffd087c41addbfbca857056b70b634ce | |
parent | bf5ea13bae3515ff1b6481a87e33b3a13f68096c (diff) |
perf ui browser: Accept the left arrow key as a Zoom out if done on the first column
In the past (like before 2015) we had the familiar workflow of using
ENTER to get the menu and then zoom on a pid or DSO, kernel, etc and
then use UP and DOWN to navigate further, etc, and then when wanting to
go to the previous level, i.e. to Zoom out, use the LEFT arrow key.
This way the right hand stays in the arrow keys block that is near the
enter and we can go around real quickly.
But then, when we started supporting horizontal scrolling by columns to
support things like 'perf c2c report' that has lots of columns, we
switched to using the LEFT key exclusively for that, horizontal
scrolling, requiring the user to press 'm' to get a "context menu" that
then would allow users to select the Zoom out operation.
Ingo recently reported this as not intuitive, which is true, so lets
overload the LEFT key with both meanings, by doing a Zoom out operation
if the LEFT key is pressed when we're on the first column, but use it
also for horizontal scrolling if it is pressed when the cursor is on
column > 1.
Reported-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>
-rw-r--r-- | tools/perf/ui/browser.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index 115aa1af5a02..dc88427b4ae5 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c @@ -459,6 +459,8 @@ int ui_browser__run(struct ui_browser *browser, int delay_secs) goto out; if (browser->horiz_scroll != 0) --browser->horiz_scroll; + else + goto out; break; case K_PGDN: case ' ': |