summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-04-15 16:41:19 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-15 16:41:19 -0300
commit056149932602ef905f1e26fc4fe242ef0533a597 (patch)
treeb45900458c0721ca21d9e7d09f80b1d32bce07eb /tools/perf/builtin-trace.c
parent0883e820a0ac18e04f036dbebc3580351d7fd6cf (diff)
downloadlinux-056149932602ef905f1e26fc4fe242ef0533a597.tar.bz2
perf trace: Make --(min,max}-stack imply "--call-graph dwarf"
If one uses: # perf trace --min-stack 16 Then it implicitly means that callgraphs should be enabled, and the best option in terms of widespread availability is "dwarf". Further work needed to choose a better alternative, LBR, in capable systems. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Milian Wolff <milian.wolff@kdab.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-xtjmnpkyk42npekxz3kynzmx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 6a64cb1344c7..19f5100acc1d 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -3047,7 +3047,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
.show_comm = true,
.trace_syscalls = true,
.kernel_syscallchains = false,
- .max_stack = PERF_MAX_STACK_DEPTH,
+ .max_stack = UINT_MAX,
};
const char *output_name = NULL;
const char *ev_qualifier_str = NULL;
@@ -3109,6 +3109,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
"per thread proc mmap processing timeout in ms"),
OPT_END()
};
+ bool max_stack_user_set = true;
const char * const trace_subcommands[] = { "record", NULL };
int err;
char bf[BUFSIZ];
@@ -3142,6 +3143,16 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
trace.opts.sample_time = true;
}
+ if (trace.max_stack == UINT_MAX) {
+ trace.max_stack = PERF_MAX_STACK_DEPTH;
+ max_stack_user_set = false;
+ }
+
+#ifdef HAVE_DWARF_UNWIND_SUPPORT
+ if ((trace.min_stack || max_stack_user_set) && !trace.opts.callgraph_set)
+ record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false);
+#endif
+
if (trace.opts.callgraph_set)
symbol_conf.use_callchain = true;