[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190919204306.12598-4-kim.phillips@amd.com>
Date: Thu, 19 Sep 2019 15:43:05 -0500
From: Kim Phillips <kim.phillips@....com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
CC: <kim.phillips@....com>,
Janakarajan Natarajan <Janakarajan.Natarajan@....com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>,
"Jiri Olsa" <jolsa@...hat.com>, Namhyung Kim <namhyung@...nel.org>,
Borislav Petkov <bp@...e.de>, Martin Liska <mliska@...e.cz>,
Luke Mujica <lukemujica@...gle.com>,
Jin Yao <yao.jin@...ux.intel.com>,
Kan Liang <kan.liang@...ux.intel.com>,
<linux-kernel@...r.kernel.org>, <linux-perf-users@...r.kernel.org>
Subject: [PATCH 4/5] perf list: allow plurals for metric, metricgroup
Enhance usability by allowing the same plurality used in the output title, for
the command line parameter.
BEFORE, perf deceitfully acts as if there are no metrics to be had:
$ perf list metrics
List of pre-defined events (to be used in -e):
Metric Groups:
$
But singular 'metric' shows a list of metrics:
$ perf list metric
List of pre-defined events (to be used in -e):
Metrics:
IPC
[Instructions Per Cycle (per logical thread)]
UPI
[Uops Per Instruction]
AFTER, when asking for 'metrics', we actually see the metrics get listed:
$ perf list metrics
List of pre-defined events (to be used in -e):
Metrics:
IPC
[Instructions Per Cycle (per logical thread)]
UPI
[Uops Per Instruction]
Signed-off-by: Kim Phillips <kim.phillips@....com>
Cc: Janakarajan Natarajan <Janakarajan.Natarajan@....com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Borislav Petkov <bp@...e.de>
Cc: Martin Liska <mliska@...e.cz>
Cc: Luke Mujica <lukemujica@...gle.com>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Kan Liang <kan.liang@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org
Cc: linux-perf-users@...r.kernel.org
Fixes: 71b0acce78d1 ("perf list: Add metric groups to perf list")
---
tools/perf/builtin-list.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index e290f6b348d8..08e62ae9d37e 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -81,9 +81,9 @@ int cmd_list(int argc, const char **argv)
long_desc_flag, details_flag);
else if (strcmp(argv[i], "sdt") == 0)
print_sdt_events(NULL, NULL, raw_dump);
- else if (strcmp(argv[i], "metric") == 0)
+ else if (strcmp(argv[i], "metric") == 0 || strcmp(argv[i], "metrics") == 0)
metricgroup__print(true, false, NULL, raw_dump, details_flag);
- else if (strcmp(argv[i], "metricgroup") == 0)
+ else if (strcmp(argv[i], "metricgroup") == 0 || strcmp(argv[i], "metricgroups") == 0)
metricgroup__print(false, true, NULL, raw_dump, details_flag);
else if ((sep = strchr(argv[i], ':')) != NULL) {
int sep_idx;
--
2.23.0
Powered by blists - more mailing lists