public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 3/5] perf annotate: Period and samples view can't be used at the same time
@ 2017-08-18  8:46 Taeung Song
  0 siblings, 0 replies; only message in thread
From: Taeung Song @ 2017-08-18  8:46 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, taeung, Namhyung Kim, Jiri Olsa

If users give two options --show-total-period
and --show-nr-samples, show their proper usage because
the two options can not be used at the same time.

Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
---
 tools/perf/builtin-annotate.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index acde4cc..9d25c27 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -403,7 +403,7 @@ int cmd_annotate(int argc, const char **argv)
 	struct perf_data_file file = {
 		.mode  = PERF_DATA_MODE_READ,
 	};
-	const struct option options[] = {
+	struct option options[] = {
 	OPT_STRING('i', "input", &input_name, "file",
 		    "input file name"),
 	OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]",
@@ -452,8 +452,12 @@ int cmd_annotate(int argc, const char **argv)
 			     stdio__config_color, "always"),
 	OPT_END()
 	};
-	int ret = hists__init();
+	int ret;
+
+	set_option_flag(options, 0, "show-total-period", PARSE_OPT_EXCLUSIVE);
+	set_option_flag(options, 0, "show-nr-samples", PARSE_OPT_EXCLUSIVE);
 
+	ret = hists__init();
 	if (ret < 0)
 		return ret;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-18  8:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18  8:46 [PATCH v3 3/5] perf annotate: Period and samples view can't be used at the same time Taeung Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox