Skip to contentSkip to conversation

perf test data_type_profiling.sh: Skip just the Rust tests if code_with_type workload is missing

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

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

PATCH 1/1 perf test data_type_profiling.sh: Skip just the Rust tests if code_with_type workload is missing

Namhyung suggested skipping only the rust tests when the code_with_type 'perf test' workload is not built into perf, do it so that we can continue to test the C based workloads:

With rust:

  root@number:/# perf test -vv "data type"
   83: perf data type profiling tests:
  --- start ---
  test child forked, pid 2645245
  Basic Rust perf annotate test
  Basic annotate test [Success]
  Pipe Rust perf annotate test
  Pipe annotate test [Success]
  Basic C perf annotate test
  Basic annotate test [Success]
  Pipe C perf annotate test
  Pipe annotate test [Success]
  ---- end(0) ----
   83: perf data type profiling tests                                  : Ok
  root@number:/#

Without:

  root@number:/# perf test "data type"
   83: perf data type profiling tests                                  : Ok
  root@number:/# perf test -vv "data type"
   83: perf data type profiling tests:
  --- start ---
  test child forked, pid 2634759
  Basic Rust perf annotate test
  Skip: code_with_type workload not built in 'perf test'
  Pipe Rust perf annotate test
  Skip: code_with_type workload not built in 'perf test'
  Basic C perf annotate test
  Basic annotate test [Success]
  Pipe C perf annotate test
  Pipe annotate test [Success]
  ---- end(0) ----
   83: perf data type profiling tests                                  : Ok
  root@number:/#
---
 tools/perf/tests/shell/data_type_profiling.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tools/perf/tests/shell/data_type_profiling.sh +5 -5
index 3ef72a10850d0734..2a7f8f7c42d094a2 100755
@@ -4,11 +4,6 @@
 
 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
 
@@ -42,6 +37,11 @@ test_basic_annotate() {
 
   case "x${runtime}" in
     "xRust")
+    if ! perf check feature -q rust
+    then
+      echo "Skip: code_with_type workload not built in 'perf test'"
+      return
+    fi
     index=0 ;;
 
     "xC")
Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 43 lines · Arnaldo Carvalho de Melo

Namhyung suggested skipping only the rust tests when the code_with_type 'perf test' workload is not built into perf, do it so that we can continue to test the C based workloads:

With rust:

  root@number:/# perf test -vv "data type"
   83: perf data type profiling tests:
  --- start ---
  test child forked, pid 2645245
  Basic Rust perf annotate test
  Basic annotate test [Success]
  Pipe Rust perf annotate test
  Pipe annotate test [Success]
  Basic C perf annotate test
  Basic annotate test [Success]
  Pipe C perf annotate test
  Pipe annotate test [Success]
  ---- end(0) ----
   83: perf data type profiling tests                                  : Ok
  root@number:/#

Without:

  root@number:/# perf test "data type"
   83: perf data type profiling tests                                  : Ok
  root@number:/# perf test -vv "data type"
   83: perf data type profiling tests:
  --- start ---
  test child forked, pid 2634759
  Basic Rust perf annotate test
  Skip: code_with_type workload not built in 'perf test'
  Pipe Rust perf annotate test
  Skip: code_with_type workload not built in 'perf test'
  Basic C perf annotate test
  Basic annotate test [Success]
  Pipe C perf annotate test
  Pipe annotate test [Success]
  ---- end(0) ----
   83: perf data type profiling tests                                  : Ok
  root@number:/#
Quoted 4 lines

Thanks,
Ian

Quoted 35 lines
---
 tools/perf/tests/shell/data_type_profiling.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tools/perf/tests/shell/data_type_profiling.sh +5 -6
index 3ef72a10850d0734..2a7f8f7c42d094a2 100755
@@ -4,11 +4,6 @@
 
 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
 
@@ -42,6 +37,11 @@ test_basic_annotate() {
 
   case "x${runtime}" in
     "xRust")
+    if ! perf check feature -q rust
+    then
+      echo "Skip: code_with_type workload not built in 'perf test'"
+      return
+    fi
     index=0 ;;
 
     "xC")
--

2.53.0