Skip to contentSkip to conversation

perf list: Unify metric group description format with PMU event description

tip:perf/core tip-bot for Michael Petlan 1 participant 1 message Aug 2, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  95f04328e42dc7d1eb08f3cb38150c1f2ec09f57
Gitweb:     https://git.kernel.org/tip/95f04328e42dc7d1eb08f3cb38150c1f2ec09f57
Author:     Michael Petlan <[email protected]>
AuthorDate: Mon, 30 Jul 2018 17:35:04 -0400
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 31 Jul 2018 11:35:44 -0300

perf list: Unify metric group description format with PMU event description

PMU event descriptions use 7 spaces + '[' or 8 spaces as indentation. Metric groups used a tab + '['. This patch unifies it to the way PMU event descriptions are indented.

BEFORE:

  $ perf list
  [...]
  Metric Groups:

DSB:
DSB_Coverage
[Fraction of Uops delivered by the DSB (aka Decoded Icache; or Uop Cache)]
[...]

AFTER:

  $ perf list
  [...]
  Metric Groups:

DSB:
DSB_Coverage
[Fraction of Uops delivered by the DSB (aka Decoded Icache; or Uop Cache)]
[...]

LPU-Reference: [email protected]

---
 tools/perf/util/metricgroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/metricgroup.c +2 -2
index 96eab4ec34ff..a28f9b5cc4ff 100644
@@ -326,8 +326,8 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter,
 				if (raw)
 					s = (char *)pe->metric_name;
 				else {
-					if (asprintf(&s, "%s\n\t[%s]",
-						     pe->metric_name, pe->desc) < 0)
+					if (asprintf(&s, "%s\n%*s%s]",
+						     pe->metric_name, 8, "[", pe->desc) < 0)
 						return;
 				}