Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1594345

[PATCH 07/23] perf data: Add -q/--quiet option

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 07/23] perf data: Add -q/--quiet option
Date 2017-03-07 16:30 +0100
Message-ID <tipdL-11m-15@gated-at.bofh.it> (permalink)
References <tip46-X4-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The -q/--quiet option is to suppress any message.  Sometimes users just
want to run the command and it can be used for that case.

Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/Documentation/perf-data.txt | 4 ++++
 tools/perf/builtin-data.c              | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/tools/perf/Documentation/perf-data.txt b/tools/perf/Documentation/perf-data.txt
index f0796a47dfa3..a063c6e83d99 100644
--- a/tools/perf/Documentation/perf-data.txt
+++ b/tools/perf/Documentation/perf-data.txt
@@ -34,6 +34,10 @@ OPTIONS for 'convert'
 --verbose::
         Be more verbose (show counter open errors, etc).
 
+-q::
+--quiet::
+	Do not show any message.
+
 --all::
 	Convert all events, including non-sample events (comm, fork, ...), to output.
 	Default is off, only convert samples.
diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c
index 7ad6e17ac6b3..895cc2fefa7d 100644
--- a/tools/perf/builtin-data.c
+++ b/tools/perf/builtin-data.c
@@ -60,6 +60,7 @@ static int cmd_data_convert(int argc, const char **argv,
 	};
 	const struct option options[] = {
 		OPT_INCR('v', "verbose", &verbose, "be more verbose"),
+		OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"),
 		OPT_STRING('i', "input", &input_name, "file", "input file name"),
 #ifdef HAVE_LIBBABELTRACE_SUPPORT
 		OPT_STRING(0, "to-ctf", &to_ctf, NULL, "Convert to CTF format"),
@@ -81,6 +82,9 @@ static int cmd_data_convert(int argc, const char **argv,
 		return -1;
 	}
 
+	if (quiet)
+		perf_quiet_option();
+
 	if (to_ctf) {
 #ifdef HAVE_LIBBABELTRACE_SUPPORT
 		return bt_convert__perf2ctf(input_name, to_ctf, &opts);
-- 
2.11.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 07/23] perf data: Add -q/--quiet option Namhyung Kim <namhyung@kernel.org> - 2017-03-07 16:30 +0100

csiph-web