From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751940AbcDPJVE (ORCPT ); Sat, 16 Apr 2016 05:21:04 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41454 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751911AbcDPJVA (ORCPT ); Sat, 16 Apr 2016 05:21:00 -0400 Date: Sat, 16 Apr 2016 02:20:34 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: namhyung@kernel.org, milian.wolff@kdab.com, mingo@kernel.org, hpa@zytor.com, acme@redhat.com, dsahern@gmail.com, adrian.hunter@intel.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, wangnan0@huawei.com, tglx@linutronix.de Reply-To: dsahern@gmail.com, acme@redhat.com, hpa@zytor.com, milian.wolff@kdab.com, mingo@kernel.org, namhyung@kernel.org, tglx@linutronix.de, wangnan0@huawei.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, adrian.hunter@intel.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf trace: Make --(min,max}-stack imply "--call-graph dwarf" Git-Commit-ID: 056149932602ef905f1e26fc4fe242ef0533a597 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 056149932602ef905f1e26fc4fe242ef0533a597 Gitweb: http://git.kernel.org/tip/056149932602ef905f1e26fc4fe242ef0533a597 Author: Arnaldo Carvalho de Melo AuthorDate: Fri, 15 Apr 2016 16:41:19 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 15 Apr 2016 16:41:19 -0300 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 Cc: David Ahern Cc: Jiri Olsa Cc: Milian Wolff Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-xtjmnpkyk42npekxz3kynzmx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/perf-trace.txt | 6 ++++++ tools/perf/builtin-trace.c | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt index 4e8baa7..146c6db 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. not limiting, the overhead of callchains needs to be set via the knobs in --call-graph dwarf. + Implies '--call-graph dwarf' when --call-graph not present on the + command line, on systems where DWARF unwinding was built in. + Default: 127 --min-stack:: Set the stack depth limit when parsing the callchain, anything below the specified depth will be ignored. Disabled by default. + Implies '--call-graph dwarf' when --call-graph not present on the + command line, on systems where DWARF unwinding was built in. + --proc-map-timeout:: When processing pre-existing threads /proc/XXX/mmap, it may take a long time, 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 6a64cb1..19f5100 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;