Skip to contentSkip to conversation

perf test: Workload test of metric and metricgroups

RFC PATCH Superseded Ian Rogers 3 participants 4 messages Aug 19, 2021 – Sep 16, 2021 perf events

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

RFC PATCH 1/1 perf test: Workload test of metric and metricgroups

Test every metric and metricgroup with perf bench as a workload.

---
 tools/perf/tests/shell/stat_all_metricgroups.sh | 12 ++++++++++++
 tools/perf/tests/shell/stat_all_metrics.sh      | 16 ++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100755 tools/perf/tests/shell/stat_all_metricgroups.sh
 create mode 100755 tools/perf/tests/shell/stat_all_metrics.sh
tools/perf/tests/shell/stat_all_metricgroups.sh new file +12 -0
new file mode 100755
index 000000000000..f0b7bda17970
@@ -0,0 +1,12 @@
+#!/bin/sh
+# perf all metricgroups test
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+for m in $(perf list --raw-dump metricgroups); do
+  echo "Testing $m"
+  perf stat -M "$m" perf bench internals synthesize
+done
+
+exit 0
tools/perf/tests/shell/stat_all_metrics.sh new file +16 -0
new file mode 100755
index 000000000000..767396e81121
@@ -0,0 +1,16 @@
+#!/bin/sh
+# perf all metrics test
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+for m in `perf list --raw-dump metrics`; do
+  echo "Testing $m"
+  result=$(perf stat -M "$m" perf bench internals synthesize)
+  if [[ "$result" =~ "$m" ]]; then
+    echo "Metric not printed: $m"
+    exit 1
+  fi
+done
+
+exit 0
Signature · 1 line
2.33.0.rc1.237.g0d66db33f3-goog
#1 lore raw
Quoted 34 lines · Ian Rogers

Test every metric and metricgroup with perf bench as a workload.

---
 tools/perf/tests/shell/stat_all_metricgroups.sh | 12 ++++++++++++
 tools/perf/tests/shell/stat_all_metrics.sh      | 16 ++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100755 tools/perf/tests/shell/stat_all_metricgroups.sh
 create mode 100755 tools/perf/tests/shell/stat_all_metrics.sh
tools/perf/tests/shell/stat_all_metricgroups.sh new file +12 -0
new file mode 100755
index 000000000000..f0b7bda17970
@@ -0,0 +1,12 @@
+#!/bin/sh
+# perf all metricgroups test
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+for m in $(perf list --raw-dump metricgroups); do
+  echo "Testing $m"
+  perf stat -M "$m" perf bench internals synthesize
+done
+
+exit 0
tools/perf/tests/shell/stat_all_metrics.sh new file +0 -0
new file mode 100755
index 000000000000..767396e81121

tools/perf/tests/shell/stat_all_metrics.sh line 9

Quoted 9 lines
tools/perf/tests/shell/stat_all_metrics.sh new file +9 -0
@@ -0,0 +1,16 @@
+#!/bin/sh
+# perf all metrics test
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+for m in `perf list --raw-dump metrics`; do
+  echo "Testing $m"
+  result=$(perf stat -M "$m" perf bench internals synthesize)

good test, but takes forever.. running 'true' should be enough for the test?

jirka

Quoted 10 lines
tools/perf/tests/shell/stat_all_metrics.sh new file +7 -0
+  if [[ "$result" =~ "$m" ]]; then
+    echo "Metric not printed: $m"
+    exit 1
+  fi
+done
+
+exit 0
Signature · 1 line
2.33.0.rc1.237.g0d66db33f3-goog
author reviewer
#2 lore raw
Quoted 48 lines · Jiri Olsa
Quoted 34 lines · Ian Rogers

Test every metric and metricgroup with perf bench as a workload.

---
 tools/perf/tests/shell/stat_all_metricgroups.sh | 12 ++++++++++++
 tools/perf/tests/shell/stat_all_metrics.sh      | 16 ++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100755 tools/perf/tests/shell/stat_all_metricgroups.sh
 create mode 100755 tools/perf/tests/shell/stat_all_metrics.sh
tools/perf/tests/shell/stat_all_metricgroups.sh new file +12 -0
new file mode 100755
index 000000000000..f0b7bda17970
@@ -0,0 +1,12 @@
+#!/bin/sh
+# perf all metricgroups test
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+for m in $(perf list --raw-dump metricgroups); do
+  echo "Testing $m"
+  perf stat -M "$m" perf bench internals synthesize
+done
+
+exit 0
tools/perf/tests/shell/stat_all_metrics.sh new file +0 -0
new file mode 100755
index 000000000000..767396e81121

tools/perf/tests/shell/stat_all_metrics.sh line 9

Quoted 9 lines
tools/perf/tests/shell/stat_all_metrics.sh new file +9 -0
@@ -0,0 +1,16 @@
+#!/bin/sh
+# perf all metrics test
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+for m in `perf list --raw-dump metrics`; do
+  echo "Testing $m"
+  result=$(perf stat -M "$m" perf bench internals synthesize)

good test, but takes forever.. running 'true' should be enough for the test?

Quoted 1 line

jirka

Agreed/done:
https://lore.kernel.org/linux-perf-users/[email protected]/T/#u
There is an issue that I see a lot of "<not counted>" for metricgroups like this. Note, the metricgroups test is also failing on my skylake as I hit the bug fixed in:
https://lore.kernel.org/lkml/[email protected]/

Thanks,
Ian

Quoted 11 lines
Quoted 10 lines
tools/perf/tests/shell/stat_all_metrics.sh new file +7 -1
+  if [[ "$result" =~ "$m" ]]; then
+    echo "Metric not printed: $m"
+    exit 1
+  fi
+done
+
+exit 0
--

2.33.0.rc1.237.g0d66db33f3-goog

#3 lore raw
Quoted 14 lines
Quoted 14 lines

tools/perf/tests/shell/stat_all_metrics.sh line 9

Quoted 12 lines
tools/perf/tests/shell/stat_all_metrics.sh new file +9 -0
@@ -0,0 +1,16 @@
+#!/bin/sh
+# perf all metrics test
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+for m in `perf list --raw-dump metrics`; do
+  echo "Testing $m"
+  result=$(perf stat -M "$m" perf bench internals synthesize)

good test, but takes forever.. running 'true' should be enough for the test?

Quoted 5 lines
Quoted 1 line

jirka

Agreed/done:
https://lore.kernel.org/linux-perf-users/[email protected]/T/#u
There is an issue that I see a lot of "<not counted>" for metricgroups like this.

https://lore.kernel.org/linux-perf-users/CAP-5=fVERioMuK=JgKr1QWXKvU0Y31efQjxh7hX32ifL9V+_EA@mail.gmail.com/

Same issue, right?

Thanks,
John

Quoted 3 lines

Note, the metricgroups test is also failing on my skylake as I hit the bug fixed in:
https://lore.kernel.org/lkml/[email protected]/