Skip to contentSkip to conversation

test: Use a more ubiquitous probe for return()-action tests

PATCH In review [email protected] 2 participants 12 messages Oct 1, 2025 – Oct 9, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 test: Use a more ubiquitous probe for return()-action tests

From: Eugene Loh <[email protected]>

In commit ee2bd3465
("test: Use a more ubiquitous probe for return()-action tests"), rawfbt probes are named in some tests, but they do not exist for some kernels. Switch to more ubiquitous probes, since the details of the probe largely do not matter.

---
 test/unittest/actions/return/err.not_allowed-1.d   | 2 +-
 test/unittest/actions/return/err.not_allowed-1.r   | 2 +-
 test/unittest/actions/return/err.not_allowed-1.r.p | 5 +++++
 test/unittest/actions/return/err.not_allowed-2.d   | 2 +-
 test/unittest/actions/return/err.not_allowed-2.r   | 2 +-
 test/unittest/actions/return/err.not_allowed-3.d   | 2 +-
 test/unittest/actions/return/err.not_allowed-3.r   | 2 +-
 7 files changed, 11 insertions(+), 6 deletions(-)
 create mode 100755 test/unittest/actions/return/err.not_allowed-1.r.p
test/unittest/actions/return/err.not_allowed-1.d +1 -1
index 246a68b18..e32751bf2 100644
@@ -20,7 +20,7 @@ BEGIN
 	exit(0);
 }
 
-fbt:btrfs:open_ctree:entry
+fbt:vmlinux:__*_sys_getpid:entry
 /ok/
 {
 	return(0);
test/unittest/actions/return/err.not_allowed-1.r +1 -1
index e3443c301..becd3d4fa 100644
@@ -1,2 +1,2 @@
 -- @@stderr --
-dtrace: could not enable tracing: return() not allowed for fbt:btrfs:open_ctree:entry
+dtrace: could not enable tracing: return() not allowed for fbt:vmlinux:__*_sys_getpid:entry
test/unittest/actions/return/err.not_allowed-1.r.p new file +5 -0
new file mode 100755
index 000000000..d356eb0dd
@@ -0,0 +1,5 @@
+#!/usr/bin/gawk -f
+{
+        sub("__.*_sys_getpid", "__*_sys_getpid");
+        print;
+}
test/unittest/actions/return/err.not_allowed-2.d +1 -1
index e0d303c71..4c613065f 100644
@@ -20,7 +20,7 @@ BEGIN
 	exit(0);
 }
 
-rawfbt:btrfs:close_ctree:entry
+rawfbt:vmlinux:abort:entry
 /ok/
 {
 	return(0);
test/unittest/actions/return/err.not_allowed-2.r +1 -1
index 758d34770..bd47e2bae 100644
@@ -1,2 +1,2 @@
 -- @@stderr --
-dtrace: could not enable tracing: return() not allowed for rawfbt:btrfs:close_ctree:entry
+dtrace: could not enable tracing: return() not allowed for rawfbt:vmlinux:abort:entry
test/unittest/actions/return/err.not_allowed-3.d +1 -1
index 770565c93..87891b7ba 100644
@@ -20,7 +20,7 @@ BEGIN
 	exit(0);
 }
 
-rawfbt:btrfs:*_ctree:entry
+rawfbt:vmlinux:abo*rt:entry
 /ok/
 {
 	return(0);
test/unittest/actions/return/err.not_allowed-3.r +1 -1
index 758d34770..bd47e2bae 100644
@@ -1,2 +1,2 @@
 -- @@stderr --
-dtrace: could not enable tracing: return() not allowed for rawfbt:btrfs:close_ctree:entry
+dtrace: could not enable tracing: return() not allowed for rawfbt:vmlinux:abort:entry
Signature · 1 line
2.47.3
#1 lore raw

PATCH 2/5 test: Adjust skip file for lockmem problem

From: Eugene Loh <[email protected]>

dtrace seems to work for recent kernel versions even when lockmem is set too low. The .x skip files for the lockmem tests say:
- UEKR6 (5.4.17) we should test
- UEKR7 (5.15.0) we should skip
and so it starts skipping with 5.15.

Apparently, however, lockmem does not impede dtrace on RHCK 5.14 either.

So, tweak the skip file to skip on 5.14 as well.

---
 test/unittest/misc/tst.lockmem-envvar.x | 4 ++--
 test/unittest/misc/tst.lockmem-x.x      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
test/unittest/misc/tst.lockmem-envvar.x +2 -2
index a779416b9..494ac67fa 100755
@@ -5,12 +5,12 @@ read MAJOR MINOR <<< `uname -r | grep -Eo '^[0-9]+\.[0-9]+' | tr '.' ' '`
 if [ $MAJOR -lt 5 ]; then
         exit 0
 fi
-if [ $MAJOR -eq 5 -a $MINOR -lt 15 ]; then
+if [ $MAJOR -eq 5 -a $MINOR -lt 14 ]; then
         exit 0
 fi
 
 # Somehow, UEKR6 (5.4.17) has problems with the the locked-memory limit,
-# but UEKR7 (5.15.0) does not
+# but UEKR7 (5.15.0) and RHCK 5.14 do not
 
 echo "no locked-memory limit on newer kernels?"
 exit 1
test/unittest/misc/tst.lockmem-x.x +2 -2
index a779416b9..494ac67fa 100755
@@ -5,12 +5,12 @@ read MAJOR MINOR <<< `uname -r | grep -Eo '^[0-9]+\.[0-9]+' | tr '.' ' '`
 if [ $MAJOR -lt 5 ]; then
         exit 0
 fi
-if [ $MAJOR -eq 5 -a $MINOR -lt 15 ]; then
+if [ $MAJOR -eq 5 -a $MINOR -lt 14 ]; then
         exit 0
 fi
 
 # Somehow, UEKR6 (5.4.17) has problems with the the locked-memory limit,
-# but UEKR7 (5.15.0) does not
+# but UEKR7 (5.15.0) and RHCK 5.14 do not
 
 echo "no locked-memory limit on newer kernels?"
 exit 1
Signature · 1 line
2.47.3
#2 lore raw

Re: [PATCH 2/5] test: Adjust skip file for lockmem problem

Quoted 8 lines · On Wed, Oct 01, 2025 at 02:24:15AM -0400, [email protected] wrote:

From: Eugene Loh <[email protected]>

dtrace seems to work for recent kernel versions even when lockmem is set too low. The .x skip files for the lockmem tests say:
- UEKR6 (5.4.17) we should test
- UEKR7 (5.15.0) we should skip
and so it starts skipping with 5.15.

Quoted 4 lines

Apparently, however, lockmem does not impede dtrace on RHCK 5.14 either.

So, tweak the skip file to skip on 5.14 as well.

But this seems to make the assumption that RHCK 5.14 is the same as upstream 5.14, which I highly doubt to be the case. So, we should not change this unless it has been verified that upstream 5.14 indeed also does not impede dtrace when lockmem is set too low.

Quoted 47 lines
---
 test/unittest/misc/tst.lockmem-envvar.x | 4 ++--
 test/unittest/misc/tst.lockmem-x.x      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
test/unittest/misc/tst.lockmem-envvar.x +2 -2
index a779416b9..494ac67fa 100755
@@ -5,12 +5,12 @@ read MAJOR MINOR <<< `uname -r | grep -Eo '^[0-9]+\.[0-9]+' | tr '.' ' '`
 if [ $MAJOR -lt 5 ]; then
         exit 0
 fi
-if [ $MAJOR -eq 5 -a $MINOR -lt 15 ]; then
+if [ $MAJOR -eq 5 -a $MINOR -lt 14 ]; then
         exit 0
 fi
 
 # Somehow, UEKR6 (5.4.17) has problems with the the locked-memory limit,
-# but UEKR7 (5.15.0) does not
+# but UEKR7 (5.15.0) and RHCK 5.14 do not
 
 echo "no locked-memory limit on newer kernels?"
 exit 1
test/unittest/misc/tst.lockmem-x.x +2 -2
index a779416b9..494ac67fa 100755
@@ -5,12 +5,12 @@ read MAJOR MINOR <<< `uname -r | grep -Eo '^[0-9]+\.[0-9]+' | tr '.' ' '`
 if [ $MAJOR -lt 5 ]; then
         exit 0
 fi
-if [ $MAJOR -eq 5 -a $MINOR -lt 15 ]; then
+if [ $MAJOR -eq 5 -a $MINOR -lt 14 ]; then
         exit 0
 fi
 
 # Somehow, UEKR6 (5.4.17) has problems with the the locked-memory limit,
-# but UEKR7 (5.15.0) does not
+# but UEKR7 (5.15.0) and RHCK 5.14 do not
 
 echo "no locked-memory limit on newer kernels?"
 exit 1
Signature · 1 line
2.47.3
#3 lore raw

PATCH 3/5 test: Fix some ustackdepth tests

In reply to [email protected]

From: Eugene Loh <[email protected]>

Fix these issues.

Issue 1.

In commit e48bf6a23 ("Add support for built-in variable ustackdepth"), tests ustackdepth2 and ustackdepth_big were introduced and their .r and .r.p files were links to those of the stackdepth2 test.

In commit 842eabc0e
("test: caller and stackdepth tests for fbt provider"), the stackdepth2 test was explicitly renamed "fbt" since tests for many providers were being introduced. The links of the earlier patch were not updated.

Issue 2.

The ustackdepth_big test modified perf_event_max_stack. If the test were interrupted, the value was not restored.

Issue 3.

That ustackdepth_big test only checked that the stackdepth was consistent with the reported stack. While this check is good, it missed the point of the test, which is that the system limit could be increased.

---
 .../variables/bvar/tst.ustackdepth2.r         |  2 +-
 .../variables/bvar/tst.ustackdepth2.r.p       |  2 +-
 .../variables/bvar/tst.ustackdepth_big.r      |  1 -
 .../variables/bvar/tst.ustackdepth_big.r.p    |  1 -
 .../variables/bvar/tst.ustackdepth_big.sh     | 34 +++++++++++++++++--
 5 files changed, 34 insertions(+), 6 deletions(-)
 mode change 120000 => 100644 test/unittest/variables/bvar/tst.ustackdepth2.r
 delete mode 120000 test/unittest/variables/bvar/tst.ustackdepth_big.r
 delete mode 120000 test/unittest/variables/bvar/tst.ustackdepth_big.r.p
test/unittest/variables/bvar/tst.ustackdepth2.r deleted +0 -1
deleted file mode 120000
index 5cc8498f8..000000000
@@ -1 +0,0 @@
-tst.stackdepth2.r
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth2.r new file +1 -0
new file mode 100644
index 000000000..3bd29b8ed
@@ -0,0 +1 @@
+Stack depth OK
test/unittest/variables/bvar/tst.ustackdepth2.r.p +1 -1
index 8320b603c..e50f12822 120000
@@ -1 +1 @@
-tst.stackdepth2.r.p
\ No newline at end of file
+check_stackdepth_to_stack.awk
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.r deleted +0 -1
deleted file mode 120000
index b6a2d6bcd..000000000
@@ -1 +0,0 @@
-tst.ustackdepth2.r
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.r.p deleted +0 -1
deleted file mode 120000
index 0e8338907..000000000
@@ -1 +0,0 @@
-tst.ustackdepth2.r.p
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.sh +32 -2
index 777940ec8..e84850c02 100755
@@ -14,11 +14,19 @@
 
 dtrace=$1
 
+POSTPROC=$PWD/test/unittest/variables/bvar/check_stackdepth_to_stack.awk
+TRIGGER=$PWD/test/triggers/ustack-tst-bigstack-spin
+
+DIRNAME=$tmpdir/ustackdepth_big.$$.$RANDOM
+mkdir -p $DIRNAME
+cd $DIRNAME
+
 orig_maxstack=`sysctl -n kernel.perf_event_max_stack`
 echo kernel.perf_event_max_stack was $orig_maxstack
+trap "sysctl kernel.perf_event_max_stack=$orig_maxstack" QUIT EXIT
 sysctl kernel.perf_event_max_stack=200
 
-$dtrace $dt_flags -c test/triggers/ustack-tst-bigstack-spin -qn '
+$dtrace $dt_flags -c $TRIGGER -qn '
 profile-1
 /pid == $target/
 {
@@ -32,7 +40,7 @@ ERROR
 {
     exit(1);
 }
-'
+' > D.out
 if [ $? -ne 0 ]; then
     echo DTrace failure
     exit 1
@@ -41,4 +49,26 @@ fi
 sleep 2
 sysctl kernel.perf_event_max_stack=$orig_maxstack
 
+$POSTPROC D.out > awk.out
+if [ $? -ne 0 ]; then
+    echo post processing failure
+    exit 1
+fi
+
+if echo "Stack depth OK" | diff -q - awk.out; then
+    mydepth=`gawk '/DEPTH/ { print $2 }' D.out`
+    if [ $mydepth -gt $orig_maxstack ]; then
+        echo success depth $mydepth exceeded original limit $orig_maxstack
+        exit 0
+    else
+        echo ERROR: $mydepth does not exceed original limit $orig_maxstack
+        cat D.out
+        exit 1
+    fi
+else
+    echo "ERROR: stack depth does not match stack"
+    cat D.out
+    exit 1
+fi
+
 exit 0
Signature · 1 line
2.47.3
Reviewed-by on v1 3/5
#4 lore raw

Re: [PATCH 3/5] test: Fix some ustackdepth tests

Quoted 20 lines · On Wed, Oct 01, 2025 at 02:24:16AM -0400, [email protected] wrote:

From: Eugene Loh <[email protected]>

Fix these issues.

Issue 1.

In commit e48bf6a23 ("Add support for built-in variable ustackdepth"), tests ustackdepth2 and ustackdepth_big were introduced and their .r and .r.p files were links to those of the stackdepth2 test.

In commit 842eabc0e
("test: caller and stackdepth tests for fbt provider"), the stackdepth2 test was explicitly renamed "fbt" since tests for many providers were being introduced. The links of the earlier patch were not updated.

Issue 2.

The ustackdepth_big test modified perf_event_max_stack. If the test were interrupted, the value was not restored.

Quoted 8 lines

Issue 3.

That ustackdepth_big test only checked that the stackdepth was consistent with the reported stack. While this check is good, it missed the point of the test, which is that the system limit could be increased.

Quoted 115 lines
---
 .../variables/bvar/tst.ustackdepth2.r         |  2 +-
 .../variables/bvar/tst.ustackdepth2.r.p       |  2 +-
 .../variables/bvar/tst.ustackdepth_big.r      |  1 -
 .../variables/bvar/tst.ustackdepth_big.r.p    |  1 -
 .../variables/bvar/tst.ustackdepth_big.sh     | 34 +++++++++++++++++--
 5 files changed, 34 insertions(+), 6 deletions(-)
 mode change 120000 => 100644 test/unittest/variables/bvar/tst.ustackdepth2.r
 delete mode 120000 test/unittest/variables/bvar/tst.ustackdepth_big.r
 delete mode 120000 test/unittest/variables/bvar/tst.ustackdepth_big.r.p
test/unittest/variables/bvar/tst.ustackdepth2.r deleted +0 -1
deleted file mode 120000
index 5cc8498f8..000000000
@@ -1 +0,0 @@
-tst.stackdepth2.r
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth2.r new file +1 -0
new file mode 100644
index 000000000..3bd29b8ed
@@ -0,0 +1 @@
+Stack depth OK
test/unittest/variables/bvar/tst.ustackdepth2.r.p +1 -1
index 8320b603c..e50f12822 120000
@@ -1 +1 @@
-tst.stackdepth2.r.p
\ No newline at end of file
+check_stackdepth_to_stack.awk
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.r deleted +0 -1
deleted file mode 120000
index b6a2d6bcd..000000000
@@ -1 +0,0 @@
-tst.ustackdepth2.r
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.r.p deleted +0 -1
deleted file mode 120000
index 0e8338907..000000000
@@ -1 +0,0 @@
-tst.ustackdepth2.r.p
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.sh +32 -2
index 777940ec8..e84850c02 100755
@@ -14,11 +14,19 @@
 
 dtrace=$1
 
+POSTPROC=$PWD/test/unittest/variables/bvar/check_stackdepth_to_stack.awk
+TRIGGER=$PWD/test/triggers/ustack-tst-bigstack-spin
+
+DIRNAME=$tmpdir/ustackdepth_big.$$.$RANDOM
+mkdir -p $DIRNAME
+cd $DIRNAME
+
 orig_maxstack=`sysctl -n kernel.perf_event_max_stack`
 echo kernel.perf_event_max_stack was $orig_maxstack
+trap "sysctl kernel.perf_event_max_stack=$orig_maxstack" QUIT EXIT
 sysctl kernel.perf_event_max_stack=200
 
-$dtrace $dt_flags -c test/triggers/ustack-tst-bigstack-spin -qn '
+$dtrace $dt_flags -c $TRIGGER -qn '
 profile-1
 /pid == $target/
 {
@@ -32,7 +40,7 @@ ERROR
 {
     exit(1);
 }
-'
+' > D.out
 if [ $? -ne 0 ]; then
     echo DTrace failure
     exit 1
@@ -41,4 +49,26 @@ fi
 sleep 2
 sysctl kernel.perf_event_max_stack=$orig_maxstack
 
+$POSTPROC D.out > awk.out
+if [ $? -ne 0 ]; then
+    echo post processing failure
+    exit 1
+fi
+
+if echo "Stack depth OK" | diff -q - awk.out; then
+    mydepth=`gawk '/DEPTH/ { print $2 }' D.out`
+    if [ $mydepth -gt $orig_maxstack ]; then
+        echo success depth $mydepth exceeded original limit $orig_maxstack
+        exit 0
+    else
+        echo ERROR: $mydepth does not exceed original limit $orig_maxstack
+        cat D.out
+        exit 1
+    fi
+else
+    echo "ERROR: stack depth does not match stack"
+    cat D.out
+    exit 1
+fi
+
 exit 0
Signature · 1 line
2.47.3
#5 lore raw

Re: [PATCH 3/5] test: Fix some ustackdepth tests

Quoted 8 lines · Kris Van Hees
Quoted 7 lines · On Wed, Oct 01, 2025 at 02:24:16AM -0400, [email protected] wrote:

Issue 3.

That ustackdepth_big test only checked that the stackdepth was consistent with the reported stack. While this check is good, it missed the point of the test, which is that the system limit could be increased.

This test seems to not work right if the system limit is already 200, which it can be. Perhaps it should first lower it to e.g. 20, then raise it to 200, and no matter what, restore the original value?

Quoted 119 lines
Quoted 1 line
Quoted 115 lines
---
 .../variables/bvar/tst.ustackdepth2.r         |  2 +-
 .../variables/bvar/tst.ustackdepth2.r.p       |  2 +-
 .../variables/bvar/tst.ustackdepth_big.r      |  1 -
 .../variables/bvar/tst.ustackdepth_big.r.p    |  1 -
 .../variables/bvar/tst.ustackdepth_big.sh     | 34 +++++++++++++++++--
 5 files changed, 34 insertions(+), 6 deletions(-)
 mode change 120000 => 100644 test/unittest/variables/bvar/tst.ustackdepth2.r
 delete mode 120000 test/unittest/variables/bvar/tst.ustackdepth_big.r
 delete mode 120000 test/unittest/variables/bvar/tst.ustackdepth_big.r.p
test/unittest/variables/bvar/tst.ustackdepth2.r deleted +0 -1
deleted file mode 120000
index 5cc8498f8..000000000
@@ -1 +0,0 @@
-tst.stackdepth2.r
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth2.r new file +1 -0
new file mode 100644
index 000000000..3bd29b8ed
@@ -0,0 +1 @@
+Stack depth OK
test/unittest/variables/bvar/tst.ustackdepth2.r.p +1 -1
index 8320b603c..e50f12822 120000
@@ -1 +1 @@
-tst.stackdepth2.r.p
\ No newline at end of file
+check_stackdepth_to_stack.awk
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.r deleted +0 -1
deleted file mode 120000
index b6a2d6bcd..000000000
@@ -1 +0,0 @@
-tst.ustackdepth2.r
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.r.p deleted +0 -1
deleted file mode 120000
index 0e8338907..000000000
@@ -1 +0,0 @@
-tst.ustackdepth2.r.p
\ No newline at end of file
test/unittest/variables/bvar/tst.ustackdepth_big.sh +32 -2
index 777940ec8..e84850c02 100755
@@ -14,11 +14,19 @@
 
 dtrace=$1
 
+POSTPROC=$PWD/test/unittest/variables/bvar/check_stackdepth_to_stack.awk
+TRIGGER=$PWD/test/triggers/ustack-tst-bigstack-spin
+
+DIRNAME=$tmpdir/ustackdepth_big.$$.$RANDOM
+mkdir -p $DIRNAME
+cd $DIRNAME
+
 orig_maxstack=`sysctl -n kernel.perf_event_max_stack`
 echo kernel.perf_event_max_stack was $orig_maxstack
+trap "sysctl kernel.perf_event_max_stack=$orig_maxstack" QUIT EXIT
 sysctl kernel.perf_event_max_stack=200
 
-$dtrace $dt_flags -c test/triggers/ustack-tst-bigstack-spin -qn '
+$dtrace $dt_flags -c $TRIGGER -qn '
 profile-1
 /pid == $target/
 {
@@ -32,7 +40,7 @@ ERROR
 {
     exit(1);
 }
-'
+' > D.out
 if [ $? -ne 0 ]; then
     echo DTrace failure
     exit 1
@@ -41,4 +49,26 @@ fi
 sleep 2
 sysctl kernel.perf_event_max_stack=$orig_maxstack
 
+$POSTPROC D.out > awk.out
+if [ $? -ne 0 ]; then
+    echo post processing failure
+    exit 1
+fi
+
+if echo "Stack depth OK" | diff -q - awk.out; then
+    mydepth=`gawk '/DEPTH/ { print $2 }' D.out`
+    if [ $mydepth -gt $orig_maxstack ]; then
+        echo success depth $mydepth exceeded original limit $orig_maxstack
+        exit 0
+    else
+        echo ERROR: $mydepth does not exceed original limit $orig_maxstack
+        cat D.out
+        exit 1
+    fi
+else
+    echo "ERROR: stack depth does not match stack"
+    cat D.out
+    exit 1
+fi
+
 exit 0
Signature · 1 line
2.47.3
author
#6 lore raw

Re: [PATCH 3/5] test: Fix some ustackdepth tests

Hmm, yeah.  Okay, change posted as a new patch to apply on top of the older one.

Quoted 3 lines · Kris Van Hees

This test seems to not work right if the system limit is already 200, which it can be. Perhaps it should first lower it to e.g. 20, then raise it to 200, and no matter what, restore the original value?

#7 lore raw

PATCH 4/5 test: Fix antiquated reference to dtrace_ustackdepth_max

In reply to [email protected]

From: Eugene Loh <[email protected]>

---
 test/triggers/ustack-tst-bigstack.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
test/triggers/ustack-tst-bigstack.c +4 -8
index e694a518c..267b07e74 100644
@@ -10,6 +10,10 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 
+/*
+ * Create a ridiculously large stack - enough to push us over
+ * the default setting of 'kernel.perf_event_max_stack' (127).
+ */
 int limit = 4096;
 
 int grow1(int);
@@ -23,14 +27,6 @@ shouldGrow(int frame)
 int
 grow(int frame)
 {
-	/*
-	 * Create a ridiculously large stack - enough to push us over
-	 * the default setting of 'dtrace_ustackdepth_max' (2048).
-	 *
-	 * This loop used to repeatedly call getpid(), but on Linux the result
-	 * of that call gets cached, so that repeated calls actually do not
-	 * trigger a system call anymore.  We use ioctl() instead.
-	 */
 	if (shouldGrow(frame))
 		frame = grow1(frame++);
 
Signature · 1 line
2.47.3
Reviewed-by on v1 4/5
#8 lore raw

Re: [PATCH 4/5] test: Fix antiquated reference to dtrace_ustackdepth_max

Quoted 3 lines · On Wed, Oct 01, 2025 at 02:24:17AM -0400, [email protected] wrote:

From: Eugene Loh <[email protected]>

Quoted 37 lines
---
 test/triggers/ustack-tst-bigstack.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
test/triggers/ustack-tst-bigstack.c +4 -8
index e694a518c..267b07e74 100644
@@ -10,6 +10,10 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 
+/*
+ * Create a ridiculously large stack - enough to push us over
+ * the default setting of 'kernel.perf_event_max_stack' (127).
+ */
 int limit = 4096;
 
 int grow1(int);
@@ -23,14 +27,6 @@ shouldGrow(int frame)
 int
 grow(int frame)
 {
-	/*
-	 * Create a ridiculously large stack - enough to push us over
-	 * the default setting of 'dtrace_ustackdepth_max' (2048).
-	 *
-	 * This loop used to repeatedly call getpid(), but on Linux the result
-	 * of that call gets cached, so that repeated calls actually do not
-	 * trigger a system call anymore.  We use ioctl() instead.
-	 */
 	if (shouldGrow(frame))
 		frame = grow1(frame++);
 
Signature · 1 line
2.47.3
#9 lore raw

PATCH 5/5 test: Remove antiquated special case for aarch64

In reply to [email protected]

From: Eugene Loh <[email protected]>

Also, add some compilation flags while we are at it.

---
 test/triggers/Build                         | 1 +
 test/unittest/ustack/tst.bigstack.aarch64.x | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
 delete mode 100644 test/unittest/ustack/tst.bigstack.aarch64.x
test/triggers/Build +1 -0
index d49b996a6..4ff5002a8 100644
@@ -236,6 +236,7 @@ usdt-tst-special_PROV := usdt-tst-special-prov.d
 # ustack wants no optimization
 
 ustack-tst-basic_CFLAGS := -O0 -fno-inline -fno-omit-frame-pointer
+ustack-tst-bigstack_CFLAGS := -O0 -fno-inline -fno-omit-frame-pointer
 ustack-tst-bigstack-spin_CFLAGS := -O0 -fno-inline -fno-omit-frame-pointer
 ustack-tst-spin_CFLAGS := -O0
 ustack-tst-mtspin_CFLAGS := -O0
test/unittest/ustack/tst.bigstack.aarch64.x deleted +0 -2
deleted file mode 100644
index 735f88c35..000000000
@@ -1,2 +0,0 @@
-# On aarch64, we are able to handle ustackdepth beyond 4096 so the expected
-# BAD_STACK failure will not occur with this test.
Signature · 1 line
2.47.3
Reviewed-by on v1 5/5
#10 lore raw

Re: [PATCH 5/5] test: Remove antiquated special case for aarch64

Quoted 5 lines · On Wed, Oct 01, 2025 at 02:24:18AM -0400, [email protected] wrote:

From: Eugene Loh <[email protected]>

Also, add some compilation flags while we are at it.

Quoted 29 lines
---
 test/triggers/Build                         | 1 +
 test/unittest/ustack/tst.bigstack.aarch64.x | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
 delete mode 100644 test/unittest/ustack/tst.bigstack.aarch64.x
test/triggers/Build +1 -0
index d49b996a6..4ff5002a8 100644
@@ -236,6 +236,7 @@ usdt-tst-special_PROV := usdt-tst-special-prov.d
 # ustack wants no optimization
 
 ustack-tst-basic_CFLAGS := -O0 -fno-inline -fno-omit-frame-pointer
+ustack-tst-bigstack_CFLAGS := -O0 -fno-inline -fno-omit-frame-pointer
 ustack-tst-bigstack-spin_CFLAGS := -O0 -fno-inline -fno-omit-frame-pointer
 ustack-tst-spin_CFLAGS := -O0
 ustack-tst-mtspin_CFLAGS := -O0
test/unittest/ustack/tst.bigstack.aarch64.x deleted +0 -2
deleted file mode 100644
index 735f88c35..000000000
@@ -1,2 +0,0 @@
-# On aarch64, we are able to handle ustackdepth beyond 4096 so the expected
-# BAD_STACK failure will not occur with this test.
Signature · 1 line
2.47.3
Reviewed-by on v1 1/5
#11 lore raw
In reply to [email protected]
Quoted 9 lines · On Wed, Oct 01, 2025 at 02:24:14AM -0400, [email protected] wrote:

From: Eugene Loh <[email protected]>

In commit ee2bd3465
("test: Use a more ubiquitous probe for return()-action tests"), rawfbt probes are named in some tests, but they do not exist for some kernels. Switch to more ubiquitous probes, since the details of the probe largely do not matter.

Quoted 88 lines
---
 test/unittest/actions/return/err.not_allowed-1.d   | 2 +-
 test/unittest/actions/return/err.not_allowed-1.r   | 2 +-
 test/unittest/actions/return/err.not_allowed-1.r.p | 5 +++++
 test/unittest/actions/return/err.not_allowed-2.d   | 2 +-
 test/unittest/actions/return/err.not_allowed-2.r   | 2 +-
 test/unittest/actions/return/err.not_allowed-3.d   | 2 +-
 test/unittest/actions/return/err.not_allowed-3.r   | 2 +-
 7 files changed, 11 insertions(+), 6 deletions(-)
 create mode 100755 test/unittest/actions/return/err.not_allowed-1.r.p
test/unittest/actions/return/err.not_allowed-1.d +1 -1
index 246a68b18..e32751bf2 100644
@@ -20,7 +20,7 @@ BEGIN
 	exit(0);
 }
 
-fbt:btrfs:open_ctree:entry
+fbt:vmlinux:__*_sys_getpid:entry
 /ok/
 {
 	return(0);
test/unittest/actions/return/err.not_allowed-1.r +1 -1
index e3443c301..becd3d4fa 100644
@@ -1,2 +1,2 @@
 -- @@stderr --
-dtrace: could not enable tracing: return() not allowed for fbt:btrfs:open_ctree:entry
+dtrace: could not enable tracing: return() not allowed for fbt:vmlinux:__*_sys_getpid:entry
test/unittest/actions/return/err.not_allowed-1.r.p new file +5 -0
new file mode 100755
index 000000000..d356eb0dd
@@ -0,0 +1,5 @@
+#!/usr/bin/gawk -f
+{
+        sub("__.*_sys_getpid", "__*_sys_getpid");
+        print;
+}
test/unittest/actions/return/err.not_allowed-2.d +1 -1
index e0d303c71..4c613065f 100644
@@ -20,7 +20,7 @@ BEGIN
 	exit(0);
 }
 
-rawfbt:btrfs:close_ctree:entry
+rawfbt:vmlinux:abort:entry
 /ok/
 {
 	return(0);
test/unittest/actions/return/err.not_allowed-2.r +1 -1
index 758d34770..bd47e2bae 100644
@@ -1,2 +1,2 @@
 -- @@stderr --
-dtrace: could not enable tracing: return() not allowed for rawfbt:btrfs:close_ctree:entry
+dtrace: could not enable tracing: return() not allowed for rawfbt:vmlinux:abort:entry
test/unittest/actions/return/err.not_allowed-3.d +1 -1
index 770565c93..87891b7ba 100644
@@ -20,7 +20,7 @@ BEGIN
 	exit(0);
 }
 
-rawfbt:btrfs:*_ctree:entry
+rawfbt:vmlinux:abo*rt:entry
 /ok/
 {
 	return(0);
test/unittest/actions/return/err.not_allowed-3.r +1 -1
index 758d34770..bd47e2bae 100644
@@ -1,2 +1,2 @@
 -- @@stderr --
-dtrace: could not enable tracing: return() not allowed for rawfbt:btrfs:close_ctree:entry
+dtrace: could not enable tracing: return() not allowed for rawfbt:vmlinux:abort:entry
Signature · 1 line
2.47.3