diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-14 13:13:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-14 13:13:22 -0500 |
commit | 2205afa7d13ec716935dfd4b8ff71059ee7aeb0c (patch) | |
tree | 19e63ed8040e8a82c3cdd331458d246247466a28 /tools/perf/builtin-annotate.c | |
parent | 491424c0f46c282a854b88830212bdb0763e93dc (diff) | |
parent | 2cd9046cc53dd2625e2cf5854d6cbb1ba61de914 (diff) |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf sched: Fix build failure on sparc
perf bench: Add "all" pseudo subsystem and "all" pseudo suite
perf tools: Introduce perf_session class
perf symbols: Ditch dso->find_symbol
perf symbols: Allow lookups by symbol name too
perf symbols: Add missing "Variables" entry to map_type__name
perf symbols: Add support for 'variable' symtabs
perf symbols: Introduce ELF counterparts to symbol_type__is_a
perf symbols: Introduce symbol_type__is_a
perf symbols: Rename kthreads to kmaps, using another abstraction for it
perf tools: Allow building for ARM
hw-breakpoints: Handle bad modify_user_hw_breakpoint off-case return value
perf tools: Allow cross compiling
tracing, slab: Fix no callsite ifndef CONFIG_KMEMTRACE
tracing, slab: Define kmem_cache_alloc_notrace ifdef CONFIG_TRACING
Trivial conflict due to different fixes to modify_user_hw_breakpoint()
in include/linux/hw_breakpoint.h
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r-- | tools/perf/builtin-annotate.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 0bf2e8f9af57..21a78d30d53d 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "util/thread.h" | 25 | #include "util/thread.h" |
26 | #include "util/sort.h" | 26 | #include "util/sort.h" |
27 | #include "util/hist.h" | 27 | #include "util/hist.h" |
28 | #include "util/session.h" | ||
28 | #include "util/data_map.h" | 29 | #include "util/data_map.h" |
29 | 30 | ||
30 | static char const *input_name = "perf.data"; | 31 | static char const *input_name = "perf.data"; |
@@ -462,21 +463,23 @@ static struct perf_file_handler file_handler = { | |||
462 | 463 | ||
463 | static int __cmd_annotate(void) | 464 | static int __cmd_annotate(void) |
464 | { | 465 | { |
465 | struct perf_header *header; | 466 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, force); |
466 | struct thread *idle; | 467 | struct thread *idle; |
467 | int ret; | 468 | int ret; |
468 | 469 | ||
470 | if (session == NULL) | ||
471 | return -ENOMEM; | ||
472 | |||
469 | idle = register_idle_thread(); | 473 | idle = register_idle_thread(); |
470 | register_perf_file_handler(&file_handler); | 474 | register_perf_file_handler(&file_handler); |
471 | 475 | ||
472 | ret = mmap_dispatch_perf_file(&header, input_name, 0, 0, | 476 | ret = perf_session__process_events(session, 0, &event__cwdlen, &event__cwd); |
473 | &event__cwdlen, &event__cwd); | ||
474 | if (ret) | 477 | if (ret) |
475 | return ret; | 478 | goto out_delete; |
476 | 479 | ||
477 | if (dump_trace) { | 480 | if (dump_trace) { |
478 | event__print_totals(); | 481 | event__print_totals(); |
479 | return 0; | 482 | goto out_delete; |
480 | } | 483 | } |
481 | 484 | ||
482 | if (verbose > 3) | 485 | if (verbose > 3) |
@@ -489,6 +492,8 @@ static int __cmd_annotate(void) | |||
489 | output__resort(event__total[0]); | 492 | output__resort(event__total[0]); |
490 | 493 | ||
491 | find_annotations(); | 494 | find_annotations(); |
495 | out_delete: | ||
496 | perf_session__delete(session); | ||
492 | 497 | ||
493 | return ret; | 498 | return ret; |
494 | } | 499 | } |