aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 69760cd4cc44..b59abf5aba36 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -639,13 +639,10 @@ static int perf_session_queue_event(struct perf_session *s, event_t *event,
639 return 0; 639 return 0;
640} 640}
641 641
642static void callchain__dump(struct sample_data *sample) 642static void callchain__printf(struct sample_data *sample)
643{ 643{
644 unsigned int i; 644 unsigned int i;
645 645
646 if (!dump_trace)
647 return;
648
649 printf("... chain: nr:%Lu\n", sample->callchain->nr); 646 printf("... chain: nr:%Lu\n", sample->callchain->nr);
650 647
651 for (i = 0; i < sample->callchain->nr; i++) 648 for (i = 0; i < sample->callchain->nr; i++)
@@ -675,27 +672,29 @@ static void dump_event(struct perf_session *session, event_t *event,
675 if (!dump_trace) 672 if (!dump_trace)
676 return; 673 return;
677 674
678 dump_printf("\n%#Lx [%#x]: event: %d\n", file_offset, 675 printf("\n%#Lx [%#x]: event: %d\n", file_offset, event->header.size,
679 event->header.size, event->header.type); 676 event->header.type);
680 677
681 trace_event(event); 678 trace_event(event);
682 679
683 if (sample) 680 if (sample)
684 perf_session__print_tstamp(session, event, sample); 681 perf_session__print_tstamp(session, event, sample);
685 682
686 dump_printf("%#Lx [%#x]: PERF_RECORD_%s", 683 printf("%#Lx [%#x]: PERF_RECORD_%s", file_offset, event->header.size,
687 file_offset, event->header.size, 684 event__get_event_name(event->header.type));
688 event__get_event_name(event->header.type));
689} 685}
690 686
691static void dump_sample(struct perf_session *session, event_t *event, 687static void dump_sample(struct perf_session *session, event_t *event,
692 struct sample_data *sample) 688 struct sample_data *sample)
693{ 689{
694 dump_printf("(IP, %d): %d/%d: %#Lx period: %Ld\n", event->header.misc, 690 if (!dump_trace)
695 sample->pid, sample->tid, sample->ip, sample->period); 691 return;
692
693 printf("(IP, %d): %d/%d: %#Lx period: %Ld\n", event->header.misc,
694 sample->pid, sample->tid, sample->ip, sample->period);
696 695
697 if (session->sample_type & PERF_SAMPLE_CALLCHAIN) 696 if (session->sample_type & PERF_SAMPLE_CALLCHAIN)
698 callchain__dump(sample); 697 callchain__printf(sample);
699} 698}
700 699
701static int perf_session_deliver_event(struct perf_session *session, 700static int perf_session_deliver_event(struct perf_session *session,