diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-19 02:38:50 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-19 02:38:50 -0400 |
commit | 97eb3f24352ec6632c2127b35d8087d2a809a9b9 (patch) | |
tree | 722948059bbd325bbca232269490124231df80d4 /tools/perf/builtin-annotate.c | |
parent | 439581ec07fa9cf3f519dd461a2cf41cfd3adcb4 (diff) | |
parent | def179c271ac9b5020deca798470521f14d11edd (diff) |
Merge branch 'next' into for-linus
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 6d5604d8df95..8879463807e4 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -58,12 +58,12 @@ static int hists__add_entry(struct hists *self, struct addr_location *al) | |||
58 | return hist_entry__inc_addr_samples(he, al->addr); | 58 | return hist_entry__inc_addr_samples(he, al->addr); |
59 | } | 59 | } |
60 | 60 | ||
61 | static int process_sample_event(event_t *event, struct perf_session *session) | 61 | static int process_sample_event(event_t *event, struct sample_data *sample, |
62 | struct perf_session *session) | ||
62 | { | 63 | { |
63 | struct addr_location al; | 64 | struct addr_location al; |
64 | struct sample_data data; | ||
65 | 65 | ||
66 | if (event__preprocess_sample(event, session, &al, &data, NULL) < 0) { | 66 | if (event__preprocess_sample(event, session, &al, sample, NULL) < 0) { |
67 | pr_warning("problem processing %d event, skipping it.\n", | 67 | pr_warning("problem processing %d event, skipping it.\n", |
68 | event->header.type); | 68 | event->header.type); |
69 | return -1; | 69 | return -1; |
@@ -212,7 +212,7 @@ get_source_line(struct hist_entry *he, int len, const char *filename) | |||
212 | continue; | 212 | continue; |
213 | 213 | ||
214 | offset = start + i; | 214 | offset = start + i; |
215 | sprintf(cmd, "addr2line -e %s %016llx", filename, offset); | 215 | sprintf(cmd, "addr2line -e %s %016" PRIx64, filename, offset); |
216 | fp = popen(cmd, "r"); | 216 | fp = popen(cmd, "r"); |
217 | if (!fp) | 217 | if (!fp) |
218 | continue; | 218 | continue; |
@@ -270,9 +270,9 @@ static void hist_entry__print_hits(struct hist_entry *self) | |||
270 | 270 | ||
271 | for (offset = 0; offset < len; ++offset) | 271 | for (offset = 0; offset < len; ++offset) |
272 | if (h->ip[offset] != 0) | 272 | if (h->ip[offset] != 0) |
273 | printf("%*Lx: %Lu\n", BITS_PER_LONG / 2, | 273 | printf("%*" PRIx64 ": %" PRIu64 "\n", BITS_PER_LONG / 2, |
274 | sym->start + offset, h->ip[offset]); | 274 | sym->start + offset, h->ip[offset]); |
275 | printf("%*s: %Lu\n", BITS_PER_LONG / 2, "h->sum", h->sum); | 275 | printf("%*s: %" PRIu64 "\n", BITS_PER_LONG / 2, "h->sum", h->sum); |
276 | } | 276 | } |
277 | 277 | ||
278 | static int hist_entry__tty_annotate(struct hist_entry *he) | 278 | static int hist_entry__tty_annotate(struct hist_entry *he) |
@@ -375,6 +375,8 @@ static struct perf_event_ops event_ops = { | |||
375 | .mmap = event__process_mmap, | 375 | .mmap = event__process_mmap, |
376 | .comm = event__process_comm, | 376 | .comm = event__process_comm, |
377 | .fork = event__process_task, | 377 | .fork = event__process_task, |
378 | .ordered_samples = true, | ||
379 | .ordering_requires_timestamps = true, | ||
378 | }; | 380 | }; |
379 | 381 | ||
380 | static int __cmd_annotate(void) | 382 | static int __cmd_annotate(void) |
@@ -382,7 +384,7 @@ static int __cmd_annotate(void) | |||
382 | int ret; | 384 | int ret; |
383 | struct perf_session *session; | 385 | struct perf_session *session; |
384 | 386 | ||
385 | session = perf_session__new(input_name, O_RDONLY, force, false); | 387 | session = perf_session__new(input_name, O_RDONLY, force, false, &event_ops); |
386 | if (session == NULL) | 388 | if (session == NULL) |
387 | return -ENOMEM; | 389 | return -ENOMEM; |
388 | 390 | ||