From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932722AbdCGPVE (ORCPT ); Tue, 7 Mar 2017 10:21:04 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36449 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755596AbdCGPS1 (ORCPT ); Tue, 7 Mar 2017 10:18:27 -0500 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , kernel-team@lge.com Subject: [PATCH 21/23] perf stat: Add -q/--quiet option Date: Wed, 8 Mar 2017 00:08:49 +0900 Message-Id: <20170307150851.22304-22-namhyung@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170307150851.22304-1-namhyung@kernel.org> References: <20170307150851.22304-1-namhyung@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Namhyung Kim --- tools/perf/Documentation/perf-stat.txt | 4 ++++ tools/perf/builtin-stat.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt index aecf2a87e7d6..94482b8a597b 100644 --- a/tools/perf/Documentation/perf-stat.txt +++ b/tools/perf/Documentation/perf-stat.txt @@ -105,6 +105,10 @@ This option is only valid in system-wide mode. --verbose:: be more verbose (show counter open errors, etc) +-q:: +--quiet:: + Do not show any message. (Suppress -v) + -x SEP:: --field-separator SEP:: print counts using a CSV-style output to make it easy to import directly into diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index ee7190da9b6e..9dbb08c038e1 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1630,6 +1630,7 @@ static const struct option stat_options[] = { OPT_BOOLEAN('c', "scale", &stat_config.scale, "scale/normalize counters"), OPT_INCR('v', "verbose", &verbose, "be more verbose (show counter open errors, etc)"), + OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"), OPT_INTEGER('r', "repeat", &run_count, "repeat command and print average + stddev (max: 100, forever: 0)"), OPT_BOOLEAN('n', "null", &null_run, @@ -2163,6 +2164,9 @@ static int __cmd_record(int argc, const char **argv) argc = parse_options(argc, argv, stat_options, stat_record_usage, PARSE_OPT_STOP_AT_NON_OPTION); + if (quiet) + perf_quiet_option(); + if (output_name) file->path = output_name; @@ -2410,6 +2414,9 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused) PARSE_OPT_STOP_AT_NON_OPTION); perf_stat__init_shadow_stats(); + if (quiet) + perf_quiet_option(); + if (csv_sep) { csv_output = true; if (!strcmp(csv_sep, "\\t")) -- 2.11.0