[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170307150851.22304-13-namhyung@kernel.org>
Date: Wed, 8 Mar 2017 00:08:40 +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 12/23] perf kmem: 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.
Before:
# perf kmem stat
Failed to open /usr/lib/libpthread-2.21.so, continuing without symbols
Failed to open /usr/lib/libc-2.21.so, continuing without symbols
Failed to open /lib/modules/3.18.6-1-ARCH/kernel/fs/ext4/ext4.ko.gz, continuing without symbols
SUMMARY (SLAB allocator)
========================
Total bytes requested: 172,628
Total bytes allocated: 173,088
Total bytes freed: 161,280
Net total bytes allocated: 11,808
Total bytes wasted on internal fragmentation: 460
Internal fragmentation: 0.265761%
Cross CPU allocations: 0/851
After:
# perf kmem stat -q
SUMMARY (SLAB allocator)
========================
Total bytes requested: 172,628
Total bytes allocated: 173,088
Total bytes freed: 161,280
Net total bytes allocated: 11,808
Total bytes wasted on internal fragmentation: 460
Internal fragmentation: 0.265761%
Cross CPU allocations: 0/851
Suggested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/Documentation/perf-kmem.txt | 4 ++++
tools/perf/builtin-kmem.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/tools/perf/Documentation/perf-kmem.txt b/tools/perf/Documentation/perf-kmem.txt
index 479fc3261a50..0731389501d4 100644
--- a/tools/perf/Documentation/perf-kmem.txt
+++ b/tools/perf/Documentation/perf-kmem.txt
@@ -29,6 +29,10 @@ OPTIONS
--verbose::
Be more verbose. (show symbol address, etc)
+-q::
+--quiet::
+ Do not show any message.
+
--caller::
Show per-callsite statistics
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 6da8d083e4e5..7148137c3a3d 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -1895,6 +1895,7 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_STRING('i', "input", &input_name, "file", "input file name"),
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
+ OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"),
OPT_CALLBACK_NOOPT(0, "caller", NULL, NULL,
"show per-callsite statistics", parse_caller_opt),
OPT_CALLBACK_NOOPT(0, "alloc", NULL, NULL,
@@ -1932,6 +1933,9 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
if (!argc)
usage_with_options(kmem_usage, kmem_options);
+ if (quiet)
+ perf_quiet_option();
+
if (kmem_slab == 0 && kmem_page == 0) {
if (kmem_default == KMEM_SLAB)
kmem_slab = 1;
--
2.11.0
Powered by blists - more mailing lists