diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-10-05 18:35:54 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-10-07 16:00:09 -0400 |
commit | 34958544b3da17e98d98d7b872c6516995ad66bb (patch) | |
tree | 02a028e28e3f996be6fe2b0ff2258241361a05a0 /tools/perf/builtin-annotate.c | |
parent | 19d4ac3c1039fb952f4c073fd0898e9295a836c8 (diff) |
perf annotate browser: Allow navigation to called functions
I.e. when in the annotate TUI window, if Enter is pressed over an
assembly line with a 'callq' it will try to open another TUI window with
that symbol.
This is just a proof of concept and works only on x86_64, more work is
needed to support kernel modules, userland, other arches, etc, but
should already be useful as-is.
Suggested-by: Ingo Molnar <mingo@elte.hu>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-opyvskw5na3qdmkv8vxi3zbr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r-- | tools/perf/builtin-annotate.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 39e3d382b2d8..24db9d2db7b4 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -114,7 +114,8 @@ static int hist_entry__tty_annotate(struct hist_entry *he, int evidx) | |||
114 | print_line, full_paths, 0, 0); | 114 | print_line, full_paths, 0, 0); |
115 | } | 115 | } |
116 | 116 | ||
117 | static void hists__find_annotations(struct hists *self, int evidx) | 117 | static void hists__find_annotations(struct hists *self, int evidx, |
118 | int nr_events) | ||
118 | { | 119 | { |
119 | struct rb_node *nd = rb_first(&self->entries), *next; | 120 | struct rb_node *nd = rb_first(&self->entries), *next; |
120 | int key = KEY_RIGHT; | 121 | int key = KEY_RIGHT; |
@@ -137,7 +138,8 @@ find_next: | |||
137 | } | 138 | } |
138 | 139 | ||
139 | if (use_browser > 0) { | 140 | if (use_browser > 0) { |
140 | key = hist_entry__tui_annotate(he, evidx, NULL, NULL, 0); | 141 | key = hist_entry__tui_annotate(he, evidx, nr_events, |
142 | NULL, NULL, 0); | ||
141 | switch (key) { | 143 | switch (key) { |
142 | case KEY_RIGHT: | 144 | case KEY_RIGHT: |
143 | next = rb_next(nd); | 145 | next = rb_next(nd); |
@@ -215,7 +217,8 @@ static int __cmd_annotate(void) | |||
215 | total_nr_samples += nr_samples; | 217 | total_nr_samples += nr_samples; |
216 | hists__collapse_resort(hists); | 218 | hists__collapse_resort(hists); |
217 | hists__output_resort(hists); | 219 | hists__output_resort(hists); |
218 | hists__find_annotations(hists, pos->idx); | 220 | hists__find_annotations(hists, pos->idx, |
221 | session->evlist->nr_entries); | ||
219 | } | 222 | } |
220 | } | 223 | } |
221 | 224 | ||