Commit 80b8b496 authored by David Ahern's avatar David Ahern Committed by Arnaldo Carvalho de Melo

perf script: Print callchains and symbols if they exist

The intent of perf-script is to dump the events and information in the
file. H/W, S/W and raw events all dump callchains if they are present;
might as well make that the default for tracepoints too.

v2: Only add options for sym, dso and ip if callchains are present
Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1384920457-5986-1-git-send-email-dsahern@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3bfe5f81
...@@ -280,6 +280,30 @@ static int perf_session__check_output_opt(struct perf_session *session) ...@@ -280,6 +280,30 @@ static int perf_session__check_output_opt(struct perf_session *session)
set_print_ip_opts(&evsel->attr); set_print_ip_opts(&evsel->attr);
} }
/*
* set default for tracepoints to print symbols only
* if callchains are present
*/
if (symbol_conf.use_callchain &&
!output[PERF_TYPE_TRACEPOINT].user_set) {
struct perf_event_attr *attr;
j = PERF_TYPE_TRACEPOINT;
evsel = perf_session__find_first_evtype(session, j);
if (evsel == NULL)
goto out;
attr = &evsel->attr;
if (attr->sample_type & PERF_SAMPLE_CALLCHAIN) {
output[j].fields |= PERF_OUTPUT_IP;
output[j].fields |= PERF_OUTPUT_SYM;
output[j].fields |= PERF_OUTPUT_DSO;
set_print_ip_opts(attr);
}
}
out:
return 0; return 0;
} }
......
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