mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@kernel.org, namhyung@kernel.org, tglx@linutronix.de,
	dsahern@gmail.com, andi@firstfloor.org, acme@redhat.com,
	jmario@redhat.com, jolsa@redhat.com,
	linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
	mingo@kernel.org, dzickus@redhat.com, hpa@zytor.com
Subject: [tip:perf/core] perf c2c: Support cascading options
Date: Wed, 23 Nov 2016 20:17:58 -0800	[thread overview]
Message-ID: <tip-3a5bfab60e59d9407b69f447702c4cd14326c825@git.kernel.org> (raw)
In-Reply-To: <1479764011-10732-7-git-send-email-jolsa@kernel.org>

Commit-ID:  3a5bfab60e59d9407b69f447702c4cd14326c825
Gitweb:     http://git.kernel.org/tip/3a5bfab60e59d9407b69f447702c4cd14326c825
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 21 Nov 2016 22:33:31 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 23 Nov 2016 10:44:06 -0300

perf c2c: Support cascading options

Adding support for cascading options added by Namhyung in:

  commit 369a2478973a ("tools lib subcmd: Support cascading options")

This way the report and record command share options with with c2c
command and can save some option duplicates. For now it's the 'v'
option.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1479764011-10732-7-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-c2c.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 5492471..4b41963 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -101,6 +101,11 @@ static const char *display_str[DISPLAY_MAX] = {
 	[DISPLAY_TOT] = "Total",
 };
 
+static const struct option c2c_options[] = {
+	OPT_INCR('v', "verbose", &verbose, "be more verbose (show counter open errors, etc)"),
+	OPT_END()
+};
+
 static struct perf_c2c c2c;
 
 static void *c2c_he_zalloc(size_t size)
@@ -2520,11 +2525,9 @@ static int perf_c2c__report(int argc, const char **argv)
 	const char *display = NULL;
 	const char *coalesce = NULL;
 	bool no_source = false;
-	const struct option c2c_options[] = {
+	const struct option options[] = {
 	OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
 		   "file", "vmlinux pathname"),
-	OPT_INCR('v', "verbose", &verbose,
-		 "be more verbose (show counter open errors, etc)"),
 	OPT_STRING('i', "input", &input_name, "file",
 		   "the input file to process"),
 	OPT_INCR('N', "node-info", &c2c.node_info,
@@ -2548,14 +2551,15 @@ static int perf_c2c__report(int argc, const char **argv)
 	OPT_STRING('c', "coalesce", &coalesce, "coalesce fields",
 		   "coalesce fields: pid,tid,iaddr,dso"),
 	OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
+	OPT_PARENT(c2c_options),
 	OPT_END()
 	};
 	int err = 0;
 
-	argc = parse_options(argc, argv, c2c_options, report_c2c_usage,
+	argc = parse_options(argc, argv, options, report_c2c_usage,
 			     PARSE_OPT_STOP_AT_NON_OPTION);
 	if (argc)
-		usage_with_options(report_c2c_usage, c2c_options);
+		usage_with_options(report_c2c_usage, options);
 
 	if (c2c.stats_only)
 		c2c.use_stdio = true;
@@ -2683,11 +2687,10 @@ static int perf_c2c__record(int argc, const char **argv)
 	OPT_CALLBACK('e', "event", &event_set, "event",
 		     "event selector. Use 'perf mem record -e list' to list available events",
 		     parse_record_events),
-	OPT_INCR('v', "verbose", &verbose,
-		 "be more verbose (show counter open errors, etc)"),
 	OPT_BOOLEAN('u', "all-user", &all_user, "collect only user level data"),
 	OPT_BOOLEAN('k', "all-kernel", &all_kernel, "collect only kernel level data"),
 	OPT_UINTEGER('l', "ldlat", &perf_mem_events__loads_ldlat, "setup mem-loads latency"),
+	OPT_PARENT(c2c_options),
 	OPT_END()
 	};
 
@@ -2759,11 +2762,6 @@ static int perf_c2c__record(int argc, const char **argv)
 
 int cmd_c2c(int argc, const char **argv, const char *prefix __maybe_unused)
 {
-	const struct option c2c_options[] = {
-	OPT_INCR('v', "verbose", &verbose, "be more verbose"),
-	OPT_END()
-	};
-
 	argc = parse_options(argc, argv, c2c_options, c2c_usage,
 			     PARSE_OPT_STOP_AT_NON_OPTION);
 

      reply	other threads:[~2016-11-24  4:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 21:33 [PATCH 0/6] perf c2c report: Change default HITM sort/display Jiri Olsa
2016-11-21 21:33 ` [PATCH 1/6] perf tools: Show event fd in debug output Jiri Olsa
2016-11-24  4:15   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 2/6] perf c2c report: Setup browser after opening perf.data Jiri Olsa
2016-11-24  4:16   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 3/6] perf c2c report: Add -f/--force option Jiri Olsa
2016-11-24  4:16   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 4/6] perf c2c report: Add struct c2c_stats::tot_hitm field Jiri Olsa
2016-11-24  4:16   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 5/6] perf c2c report: Display total HITMs on default Jiri Olsa
2016-11-24  4:17   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 6/6] perf c2c: Support cascading options Jiri Olsa
2016-11-24  4:17   ` tip-bot for Jiri Olsa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-3a5bfab60e59d9407b69f447702c4cd14326c825@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=dzickus@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jmario@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome