Skip to contentSkip to conversation

perf test code_with_type.sh: Skip test if rust wasn't available at build time

PATCH In review Arnaldo Carvalho de Melo 2 participants 3 messages Feb 9 – Feb 11 perf events

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

PATCH 1/1 perf test code_with_type.sh: Skip test if rust wasn't available at build time

  $ perf test 'perf data type profiling tests'
   83: perf data type profiling tests                         : Skip
  $ perf test -vv 'perf data type profiling tests'
   83: perf data type profiling tests:
  --- start ---
  test child forked, pid 977213
  Skip: code_with_type workload not built in 'perf test'
  ---- end(-2) ----
   83: perf data type profiling tests                         : Skip
  $
---
 tools/perf/tests/shell/data_type_profiling.sh | 5 +++++
 1 file changed, 5 insertions(+)
tools/perf/tests/shell/data_type_profiling.sh +5 -0
index a230f5d4c42c3e6a..3ef72a10850d0734 100755
@@ -4,6 +4,11 @@
 
 set -e
 
+if ! perf test --list-workloads | grep -qw code_with_type ; then
+	echo "Skip: code_with_type workload not built in 'perf test'"
+	exit 2
+fi
+
 # The logic below follows the same line as the annotate test, but looks for a
 # data type profiling manifestation
 
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 22 lines · Arnaldo Carvalho de Melo
  $ perf test 'perf data type profiling tests'
   83: perf data type profiling tests                         : Skip
  $ perf test -vv 'perf data type profiling tests'
   83: perf data type profiling tests:
  --- start ---
  test child forked, pid 977213
  Skip: code_with_type workload not built in 'perf test'
  ---- end(-2) ----
   83: perf data type profiling tests                         : Skip
  $
---
 tools/perf/tests/shell/data_type_profiling.sh | 5 +++++
 1 file changed, 5 insertions(+)
tools/perf/tests/shell/data_type_profiling.sh +0 -0
index a230f5d4c42c3e6a..3ef72a10850d0734 100755

tools/perf/tests/shell/data_type_profiling.sh line 7

Quoted 4 lines
tools/perf/tests/shell/data_type_profiling.sh +1 -0
@@ -4,6 +4,11 @@
 
 set -e
 
+if ! perf test --list-workloads | grep -qw code_with_type ; then

It could be 'perf check feature -q rust'.

But IIUC this test also covers C code. We may want to skip Rust parts only.

Thanks,
Namhyung

Quoted 10 lines
tools/perf/tests/shell/data_type_profiling.sh +4 -0
+	echo "Skip: code_with_type workload not built in 'perf test'"
+	exit 2
+fi
+
 # The logic below follows the same line as the annotate test, but looks for a
 # data type profiling manifestation
 
Signature · 1 line
2.53.0
author maintainer
#2 lore raw
Quoted 24 lines · Namhyung Kim
Quoted 23 lines · Arnaldo Carvalho de Melo
  $ perf test 'perf data type profiling tests'
   83: perf data type profiling tests                         : Skip
  $ perf test -vv 'perf data type profiling tests'
   83: perf data type profiling tests:
  --- start ---
  test child forked, pid 977213
  Skip: code_with_type workload not built in 'perf test'
  ---- end(-2) ----
   83: perf data type profiling tests                         : Skip
  $
---
 tools/perf/tests/shell/data_type_profiling.sh | 5 +++++
 1 file changed, 5 insertions(+)
tools/perf/tests/shell/data_type_profiling.sh +0 -0
index a230f5d4c42c3e6a..3ef72a10850d0734 100755
@@ -4,6 +4,11 @@
 
Quoted 5 lines

tools/perf/tests/shell/data_type_profiling.sh line 7

Quoted 3 lines
tools/perf/tests/shell/data_type_profiling.sh +1 -0
 set -e
 
+if ! perf test --list-workloads | grep -qw code_with_type ; then

It could be 'perf check feature -q rust'.

Right, better, more compact and using something that was designed for that...

Quoted 2 lines

But IIUC this test also covers C code. We may want to skip Rust parts only.

I'll cook up a patch implementing your suggestions.

- Arnaldo

Quoted 14 lines

Thanks,
Namhyung

Quoted 10 lines
tools/perf/tests/shell/data_type_profiling.sh +4 -0
+	echo "Skip: code_with_type workload not built in 'perf test'"
+	exit 2
+fi
+
 # The logic below follows the same line as the annotate test, but looks for a
 # data type profiling manifestation
 
Signature · 1 line
2.53.0