[PATCH 02/23] perf buildid-cache: Add -q/--quiet option
From: Namhyung Kim
Date: Tue Mar 07 2017 - 10:39:58 EST
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@xxxxxxxxxx>
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/Documentation/perf-buildid-cache.txt | 4 ++++
tools/perf/builtin-buildid-cache.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/tools/perf/Documentation/perf-buildid-cache.txt b/tools/perf/Documentation/perf-buildid-cache.txt
index 058064db39d2..b9c2f8c9fcef 100644
--- a/tools/perf/Documentation/perf-buildid-cache.txt
+++ b/tools/perf/Documentation/perf-buildid-cache.txt
@@ -61,6 +61,10 @@ OPTIONS
--verbose::
Be more verbose.
+-q::
+--quiet::
+ Do not show any message.
+
SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-buildid-list[1]
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index 30e2b2cb2421..ff437a678976 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -311,6 +311,7 @@ int cmd_buildid_cache(int argc, const char **argv,
OPT_STRING('u', "update", &update_name_list_str, "file list",
"file(s) to update"),
OPT_INCR('v', "verbose", &verbose, "be more verbose"),
+ OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"),
OPT_END()
};
const char * const buildid_cache_usage[] = {
@@ -326,6 +327,9 @@ int cmd_buildid_cache(int argc, const char **argv,
!missing_filename && !update_name_list_str))
usage_with_options(buildid_cache_usage, buildid_cache_options);
+ if (quiet)
+ perf_quiet_option();
+
if (missing_filename) {
file.path = missing_filename;
file.force = force;
--
2.11.0