aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-03-21 06:06:12 -0400
committerIngo Molnar <mingo@kernel.org>2013-03-21 06:06:12 -0400
commit0a11953851213fd1d3eebcb68b4a537d458c70c2 (patch)
tree3f6f7cae25b8c1a81d6f37b1ecfff5a45bb9df40 /tools/perf/builtin-annotate.c
parent3bf2391729822e591dcfbbd1e9dd2f450968cdcb (diff)
parentbc96b361cbf90e61d2665b1305cd2c4ac1fd9cfc (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Conflicts: tools/Makefile Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: . Honor parallel jobs, fix from Borislav Petkov . Introduce tools/lib/lk library, initially just removing duplication among tools/perf and tools/vm. from Borislav Petkov . Fix build on non-glibc systems due to libio.h absence, from Cody P Schafer. . Remove some perf_session and tracing dead code, from David Ahern. . Introduce perf stat --repeat forever, from Frederik Deweerdt. . Add perf test entries for checking --cpu in record and stat, from Jiri Olsa. . Add perf test entries for checking breakpoint overflow signal handler issues, from Jiri Olsa. . Add perf test entry for for checking number of EXIT events, from Namhyung Kim. . Simplify some perf_evlist methods and to allow 'stat' to share code with 'record' and 'trace'. . Remove dead code in related to libtraceevent integration, from Namhyung Kim. . Event group view for 'annotate' in --stdio, --tui and --gtk, from Namhyung Kim. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> [ resolved the trivial merge conflict with upstream ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 2e6961ea3184..ae36f3cb5410 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
112static int hist_entry__tty_annotate(struct hist_entry *he, int evidx, 112static 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
119static void hists__find_annotations(struct hists *self, int evidx, 120static 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,12 @@ 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
236 if (symbol_conf.event_group &&
237 !perf_evsel__is_group_leader(pos))
238 continue;
239
240 hists__find_annotations(hists, pos, ann);
234 } 241 }
235 } 242 }
236 243
@@ -312,6 +319,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
312 "Specify disassembler style (e.g. -M intel for intel syntax)"), 319 "Specify disassembler style (e.g. -M intel for intel syntax)"),
313 OPT_STRING(0, "objdump", &objdump_path, "path", 320 OPT_STRING(0, "objdump", &objdump_path, "path",
314 "objdump binary to use for disassembly and annotations"), 321 "objdump binary to use for disassembly and annotations"),
322 OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
323 "Show event group information together"),
315 OPT_END() 324 OPT_END()
316 }; 325 };
317 326