aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
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 5141cdccbb65..142c475f9918 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"