[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170307150851.22304-23-namhyung@kernel.org>
Date: Wed, 8 Mar 2017 00:08:50 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, kernel-team@....com
Subject: [PATCH 22/23] perf top: Add -q/--quiet option
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@...hat.com>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/Documentation/perf-top.txt | 4 ++++
tools/perf/builtin-top.c | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
index e71d63843f45..eda5b58b1cd4 100644
--- a/tools/perf/Documentation/perf-top.txt
+++ b/tools/perf/Documentation/perf-top.txt
@@ -109,6 +109,10 @@ Default is to monitor all CPUS.
--verbose::
Be more verbose (show counter open errors, etc).
+-q::
+--quiet::
+ Do not show any message. (Suppress -v)
+
-z::
--zero::
Zero history across display updates.
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index ab9077915763..18b68c8495d6 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -372,7 +372,7 @@ static void perf_top__prompt_symbol(struct perf_top *top, const char *msg)
}
if (!found) {
- fprintf(stderr, "Sorry, %s is not active.\n", buf);
+ pr_err("Sorry, %s is not active.\n", buf);
sleep(1);
} else
perf_top__parse_source(top, found);
@@ -1142,6 +1142,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_BOOLEAN(0, "stdio", &top.use_stdio, "Use the stdio interface"),
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show counter open errors, etc)"),
+ OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"),
OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
"sort by key(s): pid, comm, dso, symbol, parent, cpu, srcline, ..."
" Please refer the man page for the complete list."),
@@ -1224,6 +1225,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
if (argc)
usage_with_options(top_usage, options);
+ if (quiet)
+ perf_quiet_option();
+
if (!top.evlist->nr_entries &&
perf_evlist__add_default(top.evlist) < 0) {
pr_err("Not enough memory for event selector list\n");
--
2.11.0
Powered by blists - more mailing lists