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


Groups > linux.kernel > #1594581

[PATCH 09/23] perf ftrace: Add -q/--quiet option

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 09/23] perf ftrace: Add -q/--quiet option
Date 2017-03-07 20:40 +0100
Message-ID <tit7I-3FT-13@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-ftrace.txt | 4 ++++
 tools/perf/builtin-ftrace.c              | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt
index 6e6a8b22c859..361836114268 100644
--- a/tools/perf/Documentation/perf-ftrace.txt
+++ b/tools/perf/Documentation/perf-ftrace.txt
@@ -30,6 +30,10 @@ OPTIONS
 --verbose=::
         Verbosity level.
 
+-q::
+--quiet::
+	Do not show any message.
+
 -p::
 --pid=::
 	Trace on existing process id (comma separated list).
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index 6087295f8827..2d8e8924cfe6 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -321,8 +321,8 @@ int cmd_ftrace(int argc, const char **argv, const char *prefix __maybe_unused)
 		   "tracer to use: function_graph(default) or function"),
 	OPT_STRING('p', "pid", &ftrace.target.pid, "pid",
 		   "trace on existing process id"),
-	OPT_INCR('v', "verbose", &verbose,
-		 "be more verbose"),
+	OPT_INCR('v', "verbose", &verbose, "be more verbose"),
+	OPT_BOOLEAN('q', "quiet", &quiet, "do not show any message"),
 	OPT_BOOLEAN('a', "all-cpus", &ftrace.target.system_wide,
 		    "system-wide collection from all CPUs"),
 	OPT_STRING('C', "cpu", &ftrace.target.cpu_list, "cpu",
@@ -339,6 +339,9 @@ int cmd_ftrace(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (!argc && target__none(&ftrace.target))
 		usage_with_options(ftrace_usage, ftrace_options);
 
+	if (quiet)
+		perf_quiet_option();
+
 	ret = target__validate(&ftrace.target);
 	if (ret) {
 		char errbuf[512];
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCHSET 00/23] perf tools: Add -q/--quiet option Namhyung Kim <namhyung@kernel.org> - 2017-03-07 18:00 +0100
  [PATCH 23/23] perf trace: Add -q/--quiet option Namhyung Kim <namhyung@kernel.org> - 2017-03-07 20:20 +0100
  [PATCH 09/23] perf ftrace: Add -q/--quiet option Namhyung Kim <namhyung@kernel.org> - 2017-03-07 20:40 +0100

csiph-web