diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-10-05 20:45:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-10-15 15:20:03 -0400 |
commit | 0cdccac6fe4b1316f04f0dbfcc4efab51932014a (patch) | |
tree | abface2cdf20e4a608d0c1ac0bbdb0f0282db296 /tools | |
parent | b2e19a934a36b2b4affcde9c170c0f01afabe50a (diff) |
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: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-report.c | 7 | ||||
-rw-r--r-- | tools/perf/tests/dwarf-unwind.c | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 2cfc4b93991f..140a6cd88351 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -257,6 +257,13 @@ static int report__setup_sample_type(struct report *rep) | |||
257 | } | 257 | } |
258 | } | 258 | } |
259 | 259 | ||
260 | if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) { | ||
261 | if ((sample_type & PERF_SAMPLE_REGS_USER) && | ||
262 | (sample_type & PERF_SAMPLE_STACK_USER)) | ||
263 | callchain_param.record_mode = CALLCHAIN_DWARF; | ||
264 | else | ||
265 | callchain_param.record_mode = CALLCHAIN_FP; | ||
266 | } | ||
260 | return 0; | 267 | return 0; |
261 | } | 268 | } |
262 | 269 | ||
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c index 96adb730b744..fc25e57f4a5d 100644 --- a/tools/perf/tests/dwarf-unwind.c +++ b/tools/perf/tests/dwarf-unwind.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include "perf_regs.h" | 9 | #include "perf_regs.h" |
10 | #include "map.h" | 10 | #include "map.h" |
11 | #include "thread.h" | 11 | #include "thread.h" |
12 | #include "callchain.h" | ||
12 | 13 | ||
13 | static int mmap_handler(struct perf_tool *tool __maybe_unused, | 14 | static int mmap_handler(struct perf_tool *tool __maybe_unused, |
14 | union perf_event *event, | 15 | union perf_event *event, |
@@ -120,6 +121,8 @@ int test__dwarf_unwind(void) | |||
120 | return -1; | 121 | return -1; |
121 | } | 122 | } |
122 | 123 | ||
124 | callchain_param.record_mode = CALLCHAIN_DWARF; | ||
125 | |||
123 | if (init_live_machine(machine)) { | 126 | if (init_live_machine(machine)) { |
124 | pr_err("Could not init machine\n"); | 127 | pr_err("Could not init machine\n"); |
125 | goto out; | 128 | goto out; |