aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-12-13 16:50:29 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-14 10:57:17 -0500
commit4aa65636411ccb12f006a6ad593930655c445ff6 (patch)
tree0f494705a2a7631070a5372bb53f873684b001c2 /tools/perf/builtin-report.c
parentb3165f414416a717f72a376720564012af5a2e01 (diff)
perf session: Move kmaps to perf_session
There is still some more work to do to disentangle map creation from DSO loading, but this happens only for the kernel, and for the early adopters of perf diff, where this disentanglement matters most, we'll be testing different kernels, so no problem here. Further clarification: right now we create the kernel maps for the various modules and discontiguous kernel text maps when loading the DSO, we should do it as a two step process, first creating the maps, for multiple mappings with the same DSO store, then doing the dso load just once, for the first hit on one of the maps sharing this DSO backing store. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1260741029-4430-6-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index efa8147b8991..3487224670a8 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -414,6 +414,7 @@ static int call__match(struct symbol *sym)
414} 414}
415 415
416static struct symbol **resolve_callchain(struct thread *thread, 416static struct symbol **resolve_callchain(struct thread *thread,
417 struct perf_session *session,
417 struct ip_callchain *chain, 418 struct ip_callchain *chain,
418 struct symbol **parent) 419 struct symbol **parent)
419{ 420{
@@ -447,8 +448,8 @@ static struct symbol **resolve_callchain(struct thread *thread,
447 continue; 448 continue;
448 } 449 }
449 450
450 thread__find_addr_location(thread, cpumode, MAP__FUNCTION, 451 thread__find_addr_location(thread, session, cpumode,
451 ip, &al, NULL); 452 MAP__FUNCTION, ip, &al, NULL);
452 if (al.sym != NULL) { 453 if (al.sym != NULL) {
453 if (sort__has_parent && !*parent && 454 if (sort__has_parent && !*parent &&
454 call__match(al.sym)) 455 call__match(al.sym))
@@ -467,6 +468,7 @@ static struct symbol **resolve_callchain(struct thread *thread,
467 */ 468 */
468 469
469static int hist_entry__add(struct addr_location *al, 470static int hist_entry__add(struct addr_location *al,
471 struct perf_session *session,
470 struct ip_callchain *chain, u64 count) 472 struct ip_callchain *chain, u64 count)
471{ 473{
472 struct symbol **syms = NULL, *parent = NULL; 474 struct symbol **syms = NULL, *parent = NULL;
@@ -474,7 +476,7 @@ static int hist_entry__add(struct addr_location *al,
474 struct hist_entry *he; 476 struct hist_entry *he;
475 477
476 if ((sort__has_parent || callchain) && chain) 478 if ((sort__has_parent || callchain) && chain)
477 syms = resolve_callchain(al->thread, chain, &parent); 479 syms = resolve_callchain(al->thread, session, chain, &parent);
478 480
479 he = __hist_entry__add(al, parent, count, &hit); 481 he = __hist_entry__add(al, parent, count, &hit);
480 if (he == NULL) 482 if (he == NULL)
@@ -650,7 +652,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
650 652
651 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 653 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
652 654
653 thread__find_addr_location(thread, cpumode, 655 thread__find_addr_location(thread, session, cpumode,
654 MAP__FUNCTION, data.ip, &al, NULL); 656 MAP__FUNCTION, data.ip, &al, NULL);
655 /* 657 /*
656 * We have to do this here as we may have a dso with no symbol hit that 658 * We have to do this here as we may have a dso with no symbol hit that
@@ -669,7 +671,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
669 if (sym_list && al.sym && !strlist__has_entry(sym_list, al.sym->name)) 671 if (sym_list && al.sym && !strlist__has_entry(sym_list, al.sym->name))
670 return 0; 672 return 0;
671 673
672 if (hist_entry__add(&al, data.callchain, data.period)) { 674 if (hist_entry__add(&al, session, data.callchain, data.period)) {
673 pr_debug("problem incrementing symbol count, skipping event\n"); 675 pr_debug("problem incrementing symbol count, skipping event\n");
674 return -1; 676 return -1;
675 } 677 }
@@ -763,7 +765,7 @@ static int __cmd_report(void)
763 int ret; 765 int ret;
764 struct perf_session *session; 766 struct perf_session *session;
765 767
766 session = perf_session__new(input_name, O_RDONLY, force); 768 session = perf_session__new(input_name, O_RDONLY, force, &symbol_conf);
767 if (session == NULL) 769 if (session == NULL)
768 return -ENOMEM; 770 return -ENOMEM;
769 771