diff options
| author | Jiri Olsa <[email protected]> | 2015-08-13 07:17:24 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2015-08-17 13:48:39 +0000 |
| commit | 7322d6c98dd214252bd697f8dde64a3576977fab (patch) | |
| tree | f8cb389b576858fccf86877aa56abc9fa4ddfed8 /tools/perf/builtin-script.c | |
| parent | perf trace: Move vfs_getname storage to per thread area (diff) | |
| download | kernel-7322d6c98dd214252bd697f8dde64a3576977fab.tar.gz kernel-7322d6c98dd214252bd697f8dde64a3576977fab.zip | |
perf script: Initialize callchain_param.record_mode
Milian Wolff reported non functional DWARF unwind under perf script. The
reason is that perf script does not properly configure
callchain_param.record_mode, which is needed by unwind code.
Stealing the code from report and leaving the place for more
initialization code in a hope we could merge it with
report__setup_sample_type one day.
Reported-by: Milian Wolff <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
Tested-by: Milian Wolff <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/builtin-script.c')
| -rw-r--r-- | tools/perf/builtin-script.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 7b376d215e94..105332e950a9 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1561,6 +1561,22 @@ static int have_cmd(int argc, const char **argv) return 0; } +static void script__setup_sample_type(struct perf_script *script) +{ + struct perf_session *session = script->session; + u64 sample_type = perf_evlist__combined_sample_type(session->evlist); + + if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) { + if ((sample_type & PERF_SAMPLE_REGS_USER) && + (sample_type & PERF_SAMPLE_STACK_USER)) + callchain_param.record_mode = CALLCHAIN_DWARF; + else if (sample_type & PERF_SAMPLE_BRANCH_STACK) + callchain_param.record_mode = CALLCHAIN_LBR; + else + callchain_param.record_mode = CALLCHAIN_FP; + } +} + int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) { bool show_full_info = false; @@ -1849,6 +1865,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) goto out_delete; script.session = session; + script__setup_sample_type(&script); session->itrace_synth_opts = &itrace_synth_opts; |
