diff options
| author | Namhyung Kim <namhyung.kim@lge.com> | 2013-03-05 00:53:21 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-03-15 12:06:04 -0400 |
| commit | db8fd07a541fc2d5e8076f0151286e19591465b3 (patch) | |
| tree | 50b9bd5d03c7f761ff6f295bdebdf0be49729662 /tools/perf/builtin-annotate.c | |
| parent | acf2892270dcc4288c572b1159474c81f3819749 (diff) | |
perf annotate: Pass evsel instead of evidx on annotation functions
Pass evsel instead of evidx. This is a preparation for supporting event
group view in annotation and no functional change is intended.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1362462812-30885-2-git-send-email-namhyung@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 | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 2e6961ea3184..2f015a99481b 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
| @@ -109,14 +109,16 @@ static int process_sample_event(struct perf_tool *tool, | |||
| 109 | return 0; | 109 | return 0; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static int hist_entry__tty_annotate(struct hist_entry *he, int evidx, | 112 | static int hist_entry__tty_annotate(struct hist_entry *he, |
| 113 | struct perf_evsel *evsel, | ||
| 113 | struct perf_annotate *ann) | 114 | struct perf_annotate *ann) |
| 114 | { | 115 | { |
| 115 | return symbol__tty_annotate(he->ms.sym, he->ms.map, evidx, | 116 | return symbol__tty_annotate(he->ms.sym, he->ms.map, evsel, |
| 116 | ann->print_line, ann->full_paths, 0, 0); | 117 | ann->print_line, ann->full_paths, 0, 0); |
| 117 | } | 118 | } |
| 118 | 119 | ||
| 119 | static void hists__find_annotations(struct hists *self, int evidx, | 120 | static void hists__find_annotations(struct hists *self, |
| 121 | struct perf_evsel *evsel, | ||
| 120 | struct perf_annotate *ann) | 122 | struct perf_annotate *ann) |
| 121 | { | 123 | { |
| 122 | struct rb_node *nd = rb_first(&self->entries), *next; | 124 | struct rb_node *nd = rb_first(&self->entries), *next; |
| @@ -142,14 +144,14 @@ find_next: | |||
| 142 | if (use_browser == 2) { | 144 | if (use_browser == 2) { |
| 143 | int ret; | 145 | int ret; |
| 144 | 146 | ||
| 145 | ret = hist_entry__gtk_annotate(he, evidx, NULL); | 147 | ret = hist_entry__gtk_annotate(he, evsel, NULL); |
| 146 | if (!ret || !ann->skip_missing) | 148 | if (!ret || !ann->skip_missing) |
| 147 | return; | 149 | return; |
| 148 | 150 | ||
| 149 | /* skip missing symbols */ | 151 | /* skip missing symbols */ |
| 150 | nd = rb_next(nd); | 152 | nd = rb_next(nd); |
| 151 | } else if (use_browser == 1) { | 153 | } else if (use_browser == 1) { |
| 152 | key = hist_entry__tui_annotate(he, evidx, NULL); | 154 | key = hist_entry__tui_annotate(he, evsel, NULL); |
| 153 | switch (key) { | 155 | switch (key) { |
| 154 | case -1: | 156 | case -1: |
| 155 | if (!ann->skip_missing) | 157 | if (!ann->skip_missing) |
| @@ -168,7 +170,7 @@ find_next: | |||
| 168 | if (next != NULL) | 170 | if (next != NULL) |
| 169 | nd = next; | 171 | nd = next; |
| 170 | } else { | 172 | } else { |
| 171 | hist_entry__tty_annotate(he, evidx, ann); | 173 | hist_entry__tty_annotate(he, evsel, ann); |
| 172 | nd = rb_next(nd); | 174 | nd = rb_next(nd); |
| 173 | /* | 175 | /* |
| 174 | * Since we have a hist_entry per IP for the same | 176 | * Since we have a hist_entry per IP for the same |
| @@ -230,7 +232,7 @@ static int __cmd_annotate(struct perf_annotate *ann) | |||
| 230 | total_nr_samples += nr_samples; | 232 | total_nr_samples += nr_samples; |
| 231 | hists__collapse_resort(hists); | 233 | hists__collapse_resort(hists); |
| 232 | hists__output_resort(hists); | 234 | hists__output_resort(hists); |
| 233 | hists__find_annotations(hists, pos->idx, ann); | 235 | hists__find_annotations(hists, pos, ann); |
| 234 | } | 236 | } |
| 235 | } | 237 | } |
| 236 | 238 | ||
