Commit 6d491b37 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf annotate browser: Add '<' and '>' keys for navigation

hists__find_annotations() allows to move to next or previous symbols for
annotation using the arrow keys.  But TUI annotate_browser__run() uses
the RIGHT key as ENTER to handle jump/call instructions.  That makes the
navigation to the next function impossible.

I'd like to change it back to move the next symbol but I'm afraid if
some users get confused.  So I added a new pair of keys to handle that.
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230511062725.514752-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 94f0705e
...@@ -342,7 +342,7 @@ static void hists__find_annotations(struct hists *hists, ...@@ -342,7 +342,7 @@ static void hists__find_annotations(struct hists *hists,
notes = symbol__annotation(he->ms.sym); notes = symbol__annotation(he->ms.sym);
if (notes->src == NULL) { if (notes->src == NULL) {
find_next: find_next:
if (key == K_LEFT) if (key == K_LEFT || key == '<')
nd = rb_prev(nd); nd = rb_prev(nd);
else else
nd = rb_next(nd); nd = rb_next(nd);
...@@ -378,9 +378,11 @@ static void hists__find_annotations(struct hists *hists, ...@@ -378,9 +378,11 @@ static void hists__find_annotations(struct hists *hists,
return; return;
/* fall through */ /* fall through */
case K_RIGHT: case K_RIGHT:
case '>':
next = rb_next(nd); next = rb_next(nd);
break; break;
case K_LEFT: case K_LEFT:
case '<':
next = rb_prev(nd); next = rb_prev(nd);
break; break;
default: default:
......
...@@ -781,9 +781,9 @@ static int annotate_browser__run(struct annotate_browser *browser, ...@@ -781,9 +781,9 @@ static int annotate_browser__run(struct annotate_browser *browser,
ui_browser__help_window(&browser->b, ui_browser__help_window(&browser->b,
"UP/DOWN/PGUP\n" "UP/DOWN/PGUP\n"
"PGDN/SPACE Navigate\n" "PGDN/SPACE Navigate\n"
"</> Move to prev/next symbol\n"
"q/ESC/CTRL+C Exit\n\n" "q/ESC/CTRL+C Exit\n\n"
"ENTER Go to target\n" "ENTER Go to target\n"
"ESC Exit\n"
"H Go to hottest instruction\n" "H Go to hottest instruction\n"
"TAB/shift+TAB Cycle thru hottest instructions\n" "TAB/shift+TAB Cycle thru hottest instructions\n"
"j Toggle showing jump to target arrows\n" "j Toggle showing jump to target arrows\n"
...@@ -913,6 +913,8 @@ static int annotate_browser__run(struct annotate_browser *browser, ...@@ -913,6 +913,8 @@ static int annotate_browser__run(struct annotate_browser *browser,
annotation__toggle_full_addr(notes, ms); annotation__toggle_full_addr(notes, ms);
continue; continue;
case K_LEFT: case K_LEFT:
case '<':
case '>':
case K_ESC: case K_ESC:
case 'q': case 'q':
case CTRL('c'): case CTRL('c'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment