aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-12-14 11:23:00 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-14 11:34:56 -0500
commitc019879bcc5692ec9267c1cedad91f1794d0b693 (patch)
treeec499400b1ee0b1d93e961cc67b9dead9cd8c9a9 /tools/perf/builtin-report.c
parenta328626b61aeda1a7d00a80c475c76ca1b815e0d (diff)
perf session: Adopt the sample_type variable
All tools had copies, and perf diff would have to specify a sample_type_check method just for copying it. 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: <1260807780-19377-2-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.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 5141cdccbb6..142c475f991 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -52,8 +52,6 @@ static int exclude_other = 1;
52 52
53static char callchain_default_opt[] = "fractal,0.5"; 53static char callchain_default_opt[] = "fractal,0.5";
54 54
55static u64 sample_type;
56
57struct symbol_conf symbol_conf; 55struct symbol_conf symbol_conf;
58 56
59 57
@@ -557,7 +555,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
557 memset(&data, 0, sizeof(data)); 555 memset(&data, 0, sizeof(data));
558 data.period = 1; 556 data.period = 1;
559 557
560 event__parse_sample(event, sample_type, &data); 558 event__parse_sample(event, session->sample_type, &data);
561 559
562 dump_printf("(IP, %d): %d/%d: %p period: %Ld\n", 560 dump_printf("(IP, %d): %d/%d: %p period: %Ld\n",
563 event->header.misc, 561 event->header.misc,
@@ -565,7 +563,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
565 (void *)(long)data.ip, 563 (void *)(long)data.ip,
566 (long long)data.period); 564 (long long)data.period);
567 565
568 if (sample_type & PERF_SAMPLE_CALLCHAIN) { 566 if (session->sample_type & PERF_SAMPLE_CALLCHAIN) {
569 unsigned int i; 567 unsigned int i;
570 568
571 dump_printf("... chain: nr:%Lu\n", data.callchain->nr); 569 dump_printf("... chain: nr:%Lu\n", data.callchain->nr);
@@ -664,11 +662,9 @@ static int process_read_event(event_t *event, struct perf_session *session __use
664 return 0; 662 return 0;
665} 663}
666 664
667static int sample_type_check(u64 type, struct perf_session *session) 665static int sample_type_check(struct perf_session *session)
668{ 666{
669 sample_type = type; 667 if (!(session->sample_type & PERF_SAMPLE_CALLCHAIN)) {
670
671 if (!(sample_type & PERF_SAMPLE_CALLCHAIN)) {
672 if (sort__has_parent) { 668 if (sort__has_parent) {
673 fprintf(stderr, "selected --sort parent, but no" 669 fprintf(stderr, "selected --sort parent, but no"
674 " callchain data. Did you call" 670 " callchain data. Did you call"