aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-04-15 15:41:19 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-15 15:41:19 -0400
commit056149932602ef905f1e26fc4fe242ef0533a597 (patch)
treeb45900458c0721ca21d9e7d09f80b1d32bce07eb /tools/perf
parent0883e820a0ac18e04f036dbebc3580351d7fd6cf (diff)
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')
-rw-r--r--tools/perf/Documentation/perf-trace.txt6
-rw-r--r--tools/perf/builtin-trace.c13
2 files changed, 18 insertions, 1 deletions
diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt
index 4e8baa75a32e..146c6db21cbf 100644
--- a/tools/perf/Documentation/perf-trace.txt
+++ b/tools/perf/Documentation/perf-trace.txt
@@ -136,12 +136,18 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
136 not limiting, the overhead of callchains needs to be set via the 136 not limiting, the overhead of callchains needs to be set via the
137 knobs in --call-graph dwarf. 137 knobs in --call-graph dwarf.
138 138
139 Implies '--call-graph dwarf' when --call-graph not present on the
140 command line, on systems where DWARF unwinding was built in.
141
139 Default: 127 142 Default: 127
140 143
141--min-stack:: 144--min-stack::
142 Set the stack depth limit when parsing the callchain, anything 145 Set the stack depth limit when parsing the callchain, anything
143 below the specified depth will be ignored. Disabled by default. 146 below the specified depth will be ignored. Disabled by default.
144 147
148 Implies '--call-graph dwarf' when --call-graph not present on the
149 command line, on systems where DWARF unwinding was built in.
150
145--proc-map-timeout:: 151--proc-map-timeout::
146 When processing pre-existing threads /proc/XXX/mmap, it may take a long time, 152 When processing pre-existing threads /proc/XXX/mmap, it may take a long time,
147 because the file may be huge. A time out is needed in such cases. 153 because the file may be huge. A time out is needed in such cases.
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)
3047 .show_comm = true, 3047 .show_comm = true,
3048 .trace_syscalls = true, 3048 .trace_syscalls = true,
3049 .kernel_syscallchains = false, 3049 .kernel_syscallchains = false,
3050 .max_stack = PERF_MAX_STACK_DEPTH, 3050 .max_stack = UINT_MAX,
3051 }; 3051 };
3052 const char *output_name = NULL; 3052 const char *output_name = NULL;
3053 const char *ev_qualifier_str = NULL; 3053 const char *ev_qualifier_str = NULL;
@@ -3109,6 +3109,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
3109 "per thread proc mmap processing timeout in ms"), 3109 "per thread proc mmap processing timeout in ms"),
3110 OPT_END() 3110 OPT_END()
3111 }; 3111 };
3112 bool max_stack_user_set = true;
3112 const char * const trace_subcommands[] = { "record", NULL }; 3113 const char * const trace_subcommands[] = { "record", NULL };
3113 int err; 3114 int err;
3114 char bf[BUFSIZ]; 3115 char bf[BUFSIZ];
@@ -3142,6 +3143,16 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
3142 trace.opts.sample_time = true; 3143 trace.opts.sample_time = true;
3143 } 3144 }
3144 3145
3146 if (trace.max_stack == UINT_MAX) {
3147 trace.max_stack = PERF_MAX_STACK_DEPTH;
3148 max_stack_user_set = false;
3149 }
3150
3151#ifdef HAVE_DWARF_UNWIND_SUPPORT
3152 if ((trace.min_stack || max_stack_user_set) && !trace.opts.callgraph_set)
3153 record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false);
3154#endif
3155
3145 if (trace.opts.callgraph_set) 3156 if (trace.opts.callgraph_set)
3146 symbol_conf.use_callchain = true; 3157 symbol_conf.use_callchain = true;
3147 3158