From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752556AbbJWIbb (ORCPT ); Fri, 23 Oct 2015 04:31:31 -0400 Received: from terminus.zytor.com ([198.137.202.10]:55613 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbbJWIb0 (ORCPT ); Fri, 23 Oct 2015 04:31:26 -0400 Date: Fri, 23 Oct 2015 01:30:54 -0700 From: tip-bot for Namhyung Kim Message-ID: Cc: jolsa@redhat.com, tglx@linutronix.de, a.p.zijlstra@chello.nl, brendan.d.gregg@gmail.com, hpa@zytor.com, wangnan0@huawei.com, mingo@kernel.org, fweisbec@gmail.com, linux-kernel@vger.kernel.org, bp@suse.de, namhyung@kernel.org, acme@redhat.com, eranian@google.com, adrian.hunter@intel.com, chandlerc@gmail.com, dsahern@gmail.com Reply-To: bp@suse.de, linux-kernel@vger.kernel.org, fweisbec@gmail.com, mingo@kernel.org, wangnan0@huawei.com, hpa@zytor.com, brendan.d.gregg@gmail.com, a.p.zijlstra@chello.nl, tglx@linutronix.de, jolsa@redhat.com, dsahern@gmail.com, adrian.hunter@intel.com, chandlerc@gmail.com, eranian@google.com, acme@redhat.com, namhyung@kernel.org In-Reply-To: <1445495330-25416-1-git-send-email-namhyung@kernel.org> References: <1445495330-25416-1-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Move callchain help messages to callchain.h Git-Commit-ID: 21cf62847d29392e51c37460856d3c3c57769c5e 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: 21cf62847d29392e51c37460856d3c3c57769c5e Gitweb: http://git.kernel.org/tip/21cf62847d29392e51c37460856d3c3c57769c5e Author: Namhyung Kim AuthorDate: Thu, 22 Oct 2015 15:28:48 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 22 Oct 2015 15:39:51 -0300 perf tools: Move callchain help messages to callchain.h These messages will be used by 'perf top' in the next patch. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Borislav Petkov Cc: Brendan Gregg Cc: Chandler Carruth Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Wang Nan Link: http://lkml.kernel.org/r/1445495330-25416-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 8 +------- tools/perf/builtin-report.c | 10 +++++++--- tools/perf/util/callchain.h | 12 ++++++++++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 24ace2f..1a11762 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1010,13 +1010,7 @@ static struct record record = { }, }; -#define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: " - -#ifdef HAVE_DWARF_UNWIND_SUPPORT -const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf lbr"; -#else -const char record_callchain_help[] = CALLCHAIN_HELP "fp lbr"; -#endif +const char record_callchain_help[] = CALLCHAIN_RECORD_HELP; /* * XXX Will stay a global variable till we fix builtin-script.c to stop messing diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3b23b25..18a8c52 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -625,6 +625,9 @@ parse_percent_limit(const struct option *opt, const char *str, return 0; } +const char report_callchain_help[] = "Display callchains using " CALLCHAIN_REPORT_HELP ". " + "Default: graph,0.5,caller"; + int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) { struct perf_session *session; @@ -699,9 +702,10 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) "regex filter to identify parent, see: '--sort parent'"), OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other, "Only display entries with parent-match"), - OPT_CALLBACK_DEFAULT('g', "call-graph", &report, "output_type,min_percent[,print_limit],call_order[,branch]", - "Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold, optional print limit, callchain order, key (function or address), add branches. " - "Default: graph,0.5,caller", &report_parse_callchain_opt, callchain_default_opt), + OPT_CALLBACK_DEFAULT('g', "call-graph", &report, + "output_type,min_percent[,print_limit],call_order[,branch]", + report_callchain_help, &report_parse_callchain_opt, + callchain_default_opt), OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain, "Accumulate callchains of children and show total overhead as well"), OPT_INTEGER(0, "max-stack", &report.max_stack, diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h index acee2b3..c9e3a2e 100644 --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h @@ -7,6 +7,18 @@ #include "event.h" #include "symbol.h" +#define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: " + +#ifdef HAVE_DWARF_UNWIND_SUPPORT +#define CALLCHAIN_RECORD_HELP CALLCHAIN_HELP "fp dwarf lbr" +#else +#define CALLCHAIN_RECORD_HELP CALLCHAIN_HELP "fp lbr" +#endif + +#define CALLCHAIN_REPORT_HELP "output_type (graph, flat, fractal, or none), " \ + "min percent threshold, optional print limit, callchain order, " \ + "key (function or address), add branches" + enum perf_call_graph_mode { CALLCHAIN_NONE, CALLCHAIN_FP,