Commit 0cdccac6 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf report: Set callchain_param.record_mode for future use

Normally the callchain_param.record_mode is used only for record path.
But as it might need to prepare something for dwarf unwinding, setup
this info for perf report too.
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1412556363-26229-2-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent b2e19a93
...@@ -257,6 +257,13 @@ static int report__setup_sample_type(struct report *rep) ...@@ -257,6 +257,13 @@ static int report__setup_sample_type(struct report *rep)
} }
} }
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
callchain_param.record_mode = CALLCHAIN_FP;
}
return 0; return 0;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "perf_regs.h" #include "perf_regs.h"
#include "map.h" #include "map.h"
#include "thread.h" #include "thread.h"
#include "callchain.h"
static int mmap_handler(struct perf_tool *tool __maybe_unused, static int mmap_handler(struct perf_tool *tool __maybe_unused,
union perf_event *event, union perf_event *event,
...@@ -120,6 +121,8 @@ int test__dwarf_unwind(void) ...@@ -120,6 +121,8 @@ int test__dwarf_unwind(void)
return -1; return -1;
} }
callchain_param.record_mode = CALLCHAIN_DWARF;
if (init_live_machine(machine)) { if (init_live_machine(machine)) {
pr_err("Could not init machine\n"); pr_err("Could not init machine\n");
goto out; goto out;
......
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