perf session: Remove unneeded dump_printf calls

Since we check at the beginning of the callers, no need to ask if
dump_trace is set multiple times.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ian Munsie <imunsie@au1.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ba74f064
...@@ -639,13 +639,10 @@ static int perf_session_queue_event(struct perf_session *s, event_t *event, ...@@ -639,13 +639,10 @@ static int perf_session_queue_event(struct perf_session *s, event_t *event,
return 0; return 0;
} }
static void callchain__dump(struct sample_data *sample) static void callchain__printf(struct sample_data *sample)
{ {
unsigned int i; unsigned int i;
if (!dump_trace)
return;
printf("... chain: nr:%Lu\n", sample->callchain->nr); printf("... chain: nr:%Lu\n", sample->callchain->nr);
for (i = 0; i < sample->callchain->nr; i++) for (i = 0; i < sample->callchain->nr; i++)
...@@ -675,27 +672,29 @@ static void dump_event(struct perf_session *session, event_t *event, ...@@ -675,27 +672,29 @@ static void dump_event(struct perf_session *session, event_t *event,
if (!dump_trace) if (!dump_trace)
return; return;
dump_printf("\n%#Lx [%#x]: event: %d\n", file_offset, printf("\n%#Lx [%#x]: event: %d\n", file_offset, event->header.size,
event->header.size, event->header.type); event->header.type);
trace_event(event); trace_event(event);
if (sample) if (sample)
perf_session__print_tstamp(session, event, sample); perf_session__print_tstamp(session, event, sample);
dump_printf("%#Lx [%#x]: PERF_RECORD_%s", printf("%#Lx [%#x]: PERF_RECORD_%s", file_offset, event->header.size,
file_offset, event->header.size,
event__get_event_name(event->header.type)); event__get_event_name(event->header.type));
} }
static void dump_sample(struct perf_session *session, event_t *event, static void dump_sample(struct perf_session *session, event_t *event,
struct sample_data *sample) struct sample_data *sample)
{ {
dump_printf("(IP, %d): %d/%d: %#Lx period: %Ld\n", event->header.misc, if (!dump_trace)
return;
printf("(IP, %d): %d/%d: %#Lx period: %Ld\n", event->header.misc,
sample->pid, sample->tid, sample->ip, sample->period); sample->pid, sample->tid, sample->ip, sample->period);
if (session->sample_type & PERF_SAMPLE_CALLCHAIN) if (session->sample_type & PERF_SAMPLE_CALLCHAIN)
callchain__dump(sample); callchain__printf(sample);
} }
static int perf_session_deliver_event(struct perf_session *session, static int perf_session_deliver_event(struct perf_session *session,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment