diff options
author | David Ahern <dsahern@gmail.com> | 2013-11-19 23:07:37 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-27 12:58:38 -0500 |
commit | 80b8b496ec6edaff01f9ab74dbe8a517cd718de8 (patch) | |
tree | d1717f3ae99f38b525e9d053a57e854c700a040a | |
parent | 3bfe5f81fc8f87bf822f3da36927cfc549f3b3db (diff) |
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: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1384920457-5986-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-script.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index b392770766dd..9f3ba4404a14 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -280,6 +280,30 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
280 | set_print_ip_opts(&evsel->attr); | 280 | set_print_ip_opts(&evsel->attr); |
281 | } | 281 | } |
282 | 282 | ||
283 | /* | ||
284 | * set default for tracepoints to print symbols only | ||
285 | * if callchains are present | ||
286 | */ | ||
287 | if (symbol_conf.use_callchain && | ||
288 | !output[PERF_TYPE_TRACEPOINT].user_set) { | ||
289 | struct perf_event_attr *attr; | ||
290 | |||
291 | j = PERF_TYPE_TRACEPOINT; | ||
292 | evsel = perf_session__find_first_evtype(session, j); | ||
293 | if (evsel == NULL) | ||
294 | goto out; | ||
295 | |||
296 | attr = &evsel->attr; | ||
297 | |||
298 | if (attr->sample_type & PERF_SAMPLE_CALLCHAIN) { | ||
299 | output[j].fields |= PERF_OUTPUT_IP; | ||
300 | output[j].fields |= PERF_OUTPUT_SYM; | ||
301 | output[j].fields |= PERF_OUTPUT_DSO; | ||
302 | set_print_ip_opts(attr); | ||
303 | } | ||
304 | } | ||
305 | |||
306 | out: | ||
283 | return 0; | 307 | return 0; |
284 | } | 308 | } |
285 | 309 | ||