* [PATCH 2/5] test: Adjust skip file for lockmem problem
2025-10-01 6:24 [PATCH 1/5] test: Use a more ubiquitous probe for return()-action tests eugene.loh
@ 2025-10-01 6:24 ` eugene.loh
2025-10-03 3:52 ` Kris Van Hees
2025-10-01 6:24 ` [PATCH 3/5] test: Fix some ustackdepth tests eugene.loh
` (3 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: eugene.loh @ 2025-10-01 6:24 UTC (permalink / raw)
To: dtrace, dtrace-devel
From: Eugene Loh <eugene.loh@oracle.com>
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.
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
test/unittest/misc/tst.lockmem-envvar.x | 4 ++--
test/unittest/misc/tst.lockmem-x.x | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/unittest/misc/tst.lockmem-envvar.x b/test/unittest/misc/tst.lockmem-envvar.x
index a779416b9..494ac67fa 100755
--- a/test/unittest/misc/tst.lockmem-envvar.x
+++ b/test/unittest/misc/tst.lockmem-envvar.x
@@ -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
diff --git a/test/unittest/misc/tst.lockmem-x.x b/test/unittest/misc/tst.lockmem-x.x
index a779416b9..494ac67fa 100755
--- a/test/unittest/misc/tst.lockmem-x.x
+++ b/test/unittest/misc/tst.lockmem-x.x
@@ -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
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 2/5] test: Adjust skip file for lockmem problem
2025-10-01 6:24 ` [PATCH 2/5] test: Adjust skip file for lockmem problem eugene.loh
@ 2025-10-03 3:52 ` Kris Van Hees
0 siblings, 0 replies; 12+ messages in thread
From: Kris Van Hees @ 2025-10-03 3:52 UTC (permalink / raw)
To: eugene.loh; +Cc: dtrace, dtrace-devel
On Wed, Oct 01, 2025 at 02:24:15AM -0400, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> 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.
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.
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
> ---
> test/unittest/misc/tst.lockmem-envvar.x | 4 ++--
> test/unittest/misc/tst.lockmem-x.x | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/test/unittest/misc/tst.lockmem-envvar.x b/test/unittest/misc/tst.lockmem-envvar.x
> index a779416b9..494ac67fa 100755
> --- a/test/unittest/misc/tst.lockmem-envvar.x
> +++ b/test/unittest/misc/tst.lockmem-envvar.x
> @@ -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
> diff --git a/test/unittest/misc/tst.lockmem-x.x b/test/unittest/misc/tst.lockmem-x.x
> index a779416b9..494ac67fa 100755
> --- a/test/unittest/misc/tst.lockmem-x.x
> +++ b/test/unittest/misc/tst.lockmem-x.x
> @@ -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
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/5] test: Fix some ustackdepth tests
2025-10-01 6:24 [PATCH 1/5] test: Use a more ubiquitous probe for return()-action tests eugene.loh
2025-10-01 6:24 ` [PATCH 2/5] test: Adjust skip file for lockmem problem eugene.loh
@ 2025-10-01 6:24 ` eugene.loh
2025-10-03 4:07 ` Kris Van Hees
2025-10-01 6:24 ` [PATCH 4/5] test: Fix antiquated reference to dtrace_ustackdepth_max eugene.loh
` (2 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: eugene.loh @ 2025-10-01 6:24 UTC (permalink / raw)
To: dtrace, dtrace-devel
From: Eugene Loh <eugene.loh@oracle.com>
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.
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
.../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
diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r b/test/unittest/variables/bvar/tst.ustackdepth2.r
deleted file mode 120000
index 5cc8498f8..000000000
--- a/test/unittest/variables/bvar/tst.ustackdepth2.r
+++ /dev/null
@@ -1 +0,0 @@
-tst.stackdepth2.r
\ No newline at end of file
diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r b/test/unittest/variables/bvar/tst.ustackdepth2.r
new file mode 100644
index 000000000..3bd29b8ed
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.ustackdepth2.r
@@ -0,0 +1 @@
+Stack depth OK
diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r.p b/test/unittest/variables/bvar/tst.ustackdepth2.r.p
index 8320b603c..e50f12822 120000
--- a/test/unittest/variables/bvar/tst.ustackdepth2.r.p
+++ b/test/unittest/variables/bvar/tst.ustackdepth2.r.p
@@ -1 +1 @@
-tst.stackdepth2.r.p
\ No newline at end of file
+check_stackdepth_to_stack.awk
\ No newline at end of file
diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.r b/test/unittest/variables/bvar/tst.ustackdepth_big.r
deleted file mode 120000
index b6a2d6bcd..000000000
--- a/test/unittest/variables/bvar/tst.ustackdepth_big.r
+++ /dev/null
@@ -1 +0,0 @@
-tst.ustackdepth2.r
\ No newline at end of file
diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.r.p b/test/unittest/variables/bvar/tst.ustackdepth_big.r.p
deleted file mode 120000
index 0e8338907..000000000
--- a/test/unittest/variables/bvar/tst.ustackdepth_big.r.p
+++ /dev/null
@@ -1 +0,0 @@
-tst.ustackdepth2.r.p
\ No newline at end of file
diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.sh b/test/unittest/variables/bvar/tst.ustackdepth_big.sh
index 777940ec8..e84850c02 100755
--- a/test/unittest/variables/bvar/tst.ustackdepth_big.sh
+++ b/test/unittest/variables/bvar/tst.ustackdepth_big.sh
@@ -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
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 3/5] test: Fix some ustackdepth tests
2025-10-01 6:24 ` [PATCH 3/5] test: Fix some ustackdepth tests eugene.loh
@ 2025-10-03 4:07 ` Kris Van Hees
2025-10-09 16:29 ` Kris Van Hees
0 siblings, 1 reply; 12+ messages in thread
From: Kris Van Hees @ 2025-10-03 4:07 UTC (permalink / raw)
To: eugene.loh; +Cc: dtrace, dtrace-devel
On Wed, Oct 01, 2025 at 02:24:16AM -0400, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> 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.
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
> .../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
>
> diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r b/test/unittest/variables/bvar/tst.ustackdepth2.r
> deleted file mode 120000
> index 5cc8498f8..000000000
> --- a/test/unittest/variables/bvar/tst.ustackdepth2.r
> +++ /dev/null
> @@ -1 +0,0 @@
> -tst.stackdepth2.r
> \ No newline at end of file
> diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r b/test/unittest/variables/bvar/tst.ustackdepth2.r
> new file mode 100644
> index 000000000..3bd29b8ed
> --- /dev/null
> +++ b/test/unittest/variables/bvar/tst.ustackdepth2.r
> @@ -0,0 +1 @@
> +Stack depth OK
> diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r.p b/test/unittest/variables/bvar/tst.ustackdepth2.r.p
> index 8320b603c..e50f12822 120000
> --- a/test/unittest/variables/bvar/tst.ustackdepth2.r.p
> +++ b/test/unittest/variables/bvar/tst.ustackdepth2.r.p
> @@ -1 +1 @@
> -tst.stackdepth2.r.p
> \ No newline at end of file
> +check_stackdepth_to_stack.awk
> \ No newline at end of file
> diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.r b/test/unittest/variables/bvar/tst.ustackdepth_big.r
> deleted file mode 120000
> index b6a2d6bcd..000000000
> --- a/test/unittest/variables/bvar/tst.ustackdepth_big.r
> +++ /dev/null
> @@ -1 +0,0 @@
> -tst.ustackdepth2.r
> \ No newline at end of file
> diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.r.p b/test/unittest/variables/bvar/tst.ustackdepth_big.r.p
> deleted file mode 120000
> index 0e8338907..000000000
> --- a/test/unittest/variables/bvar/tst.ustackdepth_big.r.p
> +++ /dev/null
> @@ -1 +0,0 @@
> -tst.ustackdepth2.r.p
> \ No newline at end of file
> diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.sh b/test/unittest/variables/bvar/tst.ustackdepth_big.sh
> index 777940ec8..e84850c02 100755
> --- a/test/unittest/variables/bvar/tst.ustackdepth_big.sh
> +++ b/test/unittest/variables/bvar/tst.ustackdepth_big.sh
> @@ -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
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 3/5] test: Fix some ustackdepth tests
2025-10-03 4:07 ` Kris Van Hees
@ 2025-10-09 16:29 ` Kris Van Hees
2025-10-09 21:11 ` Eugene Loh
0 siblings, 1 reply; 12+ messages in thread
From: Kris Van Hees @ 2025-10-09 16:29 UTC (permalink / raw)
To: Kris Van Hees; +Cc: eugene.loh, dtrace, dtrace-devel
On Fri, Oct 03, 2025 at 12:07:00AM -0400, Kris Van Hees wrote:
> On Wed, Oct 01, 2025 at 02:24:16AM -0400, eugene.loh@oracle.com 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?
> > Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
>
> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
>
> > ---
> > .../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
> >
> > diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r b/test/unittest/variables/bvar/tst.ustackdepth2.r
> > deleted file mode 120000
> > index 5cc8498f8..000000000
> > --- a/test/unittest/variables/bvar/tst.ustackdepth2.r
> > +++ /dev/null
> > @@ -1 +0,0 @@
> > -tst.stackdepth2.r
> > \ No newline at end of file
> > diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r b/test/unittest/variables/bvar/tst.ustackdepth2.r
> > new file mode 100644
> > index 000000000..3bd29b8ed
> > --- /dev/null
> > +++ b/test/unittest/variables/bvar/tst.ustackdepth2.r
> > @@ -0,0 +1 @@
> > +Stack depth OK
> > diff --git a/test/unittest/variables/bvar/tst.ustackdepth2.r.p b/test/unittest/variables/bvar/tst.ustackdepth2.r.p
> > index 8320b603c..e50f12822 120000
> > --- a/test/unittest/variables/bvar/tst.ustackdepth2.r.p
> > +++ b/test/unittest/variables/bvar/tst.ustackdepth2.r.p
> > @@ -1 +1 @@
> > -tst.stackdepth2.r.p
> > \ No newline at end of file
> > +check_stackdepth_to_stack.awk
> > \ No newline at end of file
> > diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.r b/test/unittest/variables/bvar/tst.ustackdepth_big.r
> > deleted file mode 120000
> > index b6a2d6bcd..000000000
> > --- a/test/unittest/variables/bvar/tst.ustackdepth_big.r
> > +++ /dev/null
> > @@ -1 +0,0 @@
> > -tst.ustackdepth2.r
> > \ No newline at end of file
> > diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.r.p b/test/unittest/variables/bvar/tst.ustackdepth_big.r.p
> > deleted file mode 120000
> > index 0e8338907..000000000
> > --- a/test/unittest/variables/bvar/tst.ustackdepth_big.r.p
> > +++ /dev/null
> > @@ -1 +0,0 @@
> > -tst.ustackdepth2.r.p
> > \ No newline at end of file
> > diff --git a/test/unittest/variables/bvar/tst.ustackdepth_big.sh b/test/unittest/variables/bvar/tst.ustackdepth_big.sh
> > index 777940ec8..e84850c02 100755
> > --- a/test/unittest/variables/bvar/tst.ustackdepth_big.sh
> > +++ b/test/unittest/variables/bvar/tst.ustackdepth_big.sh
> > @@ -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
> > --
> > 2.47.3
> >
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 3/5] test: Fix some ustackdepth tests
2025-10-09 16:29 ` Kris Van Hees
@ 2025-10-09 21:11 ` Eugene Loh
0 siblings, 0 replies; 12+ messages in thread
From: Eugene Loh @ 2025-10-09 21:11 UTC (permalink / raw)
To: Kris Van Hees; +Cc: dtrace, dtrace-devel
Hmm, yeah. Okay, change posted as a new patch to apply on top of the
older one.
On 10/9/25 12:29, Kris Van Hees wrote:
> 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?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/5] test: Fix antiquated reference to dtrace_ustackdepth_max
2025-10-01 6:24 [PATCH 1/5] test: Use a more ubiquitous probe for return()-action tests eugene.loh
2025-10-01 6:24 ` [PATCH 2/5] test: Adjust skip file for lockmem problem eugene.loh
2025-10-01 6:24 ` [PATCH 3/5] test: Fix some ustackdepth tests eugene.loh
@ 2025-10-01 6:24 ` eugene.loh
2025-10-03 3:56 ` Kris Van Hees
2025-10-01 6:24 ` [PATCH 5/5] test: Remove antiquated special case for aarch64 eugene.loh
2025-10-03 3:50 ` [PATCH 1/5] test: Use a more ubiquitous probe for return()-action tests Kris Van Hees
4 siblings, 1 reply; 12+ messages in thread
From: eugene.loh @ 2025-10-01 6:24 UTC (permalink / raw)
To: dtrace, dtrace-devel
From: Eugene Loh <eugene.loh@oracle.com>
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
test/triggers/ustack-tst-bigstack.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/test/triggers/ustack-tst-bigstack.c b/test/triggers/ustack-tst-bigstack.c
index e694a518c..267b07e74 100644
--- a/test/triggers/ustack-tst-bigstack.c
+++ b/test/triggers/ustack-tst-bigstack.c
@@ -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++);
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 4/5] test: Fix antiquated reference to dtrace_ustackdepth_max
2025-10-01 6:24 ` [PATCH 4/5] test: Fix antiquated reference to dtrace_ustackdepth_max eugene.loh
@ 2025-10-03 3:56 ` Kris Van Hees
0 siblings, 0 replies; 12+ messages in thread
From: Kris Van Hees @ 2025-10-03 3:56 UTC (permalink / raw)
To: eugene.loh; +Cc: dtrace, dtrace-devel
On Wed, Oct 01, 2025 at 02:24:17AM -0400, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
> test/triggers/ustack-tst-bigstack.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/test/triggers/ustack-tst-bigstack.c b/test/triggers/ustack-tst-bigstack.c
> index e694a518c..267b07e74 100644
> --- a/test/triggers/ustack-tst-bigstack.c
> +++ b/test/triggers/ustack-tst-bigstack.c
> @@ -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++);
>
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/5] test: Remove antiquated special case for aarch64
2025-10-01 6:24 [PATCH 1/5] test: Use a more ubiquitous probe for return()-action tests eugene.loh
` (2 preceding siblings ...)
2025-10-01 6:24 ` [PATCH 4/5] test: Fix antiquated reference to dtrace_ustackdepth_max eugene.loh
@ 2025-10-01 6:24 ` eugene.loh
2025-10-03 3:55 ` Kris Van Hees
2025-10-03 3:50 ` [PATCH 1/5] test: Use a more ubiquitous probe for return()-action tests Kris Van Hees
4 siblings, 1 reply; 12+ messages in thread
From: eugene.loh @ 2025-10-01 6:24 UTC (permalink / raw)
To: dtrace, dtrace-devel
From: Eugene Loh <eugene.loh@oracle.com>
Also, add some compilation flags while we are at it.
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
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
diff --git a/test/triggers/Build b/test/triggers/Build
index d49b996a6..4ff5002a8 100644
--- a/test/triggers/Build
+++ b/test/triggers/Build
@@ -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
diff --git a/test/unittest/ustack/tst.bigstack.aarch64.x b/test/unittest/ustack/tst.bigstack.aarch64.x
deleted file mode 100644
index 735f88c35..000000000
--- a/test/unittest/ustack/tst.bigstack.aarch64.x
+++ /dev/null
@@ -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.
--
2.47.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 5/5] test: Remove antiquated special case for aarch64
2025-10-01 6:24 ` [PATCH 5/5] test: Remove antiquated special case for aarch64 eugene.loh
@ 2025-10-03 3:55 ` Kris Van Hees
0 siblings, 0 replies; 12+ messages in thread
From: Kris Van Hees @ 2025-10-03 3:55 UTC (permalink / raw)
To: eugene.loh; +Cc: dtrace, dtrace-devel
On Wed, Oct 01, 2025 at 02:24:18AM -0400, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> Also, add some compilation flags while we are at it.
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
> 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
>
> diff --git a/test/triggers/Build b/test/triggers/Build
> index d49b996a6..4ff5002a8 100644
> --- a/test/triggers/Build
> +++ b/test/triggers/Build
> @@ -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
> diff --git a/test/unittest/ustack/tst.bigstack.aarch64.x b/test/unittest/ustack/tst.bigstack.aarch64.x
> deleted file mode 100644
> index 735f88c35..000000000
> --- a/test/unittest/ustack/tst.bigstack.aarch64.x
> +++ /dev/null
> @@ -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.
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/5] test: Use a more ubiquitous probe for return()-action tests
2025-10-01 6:24 [PATCH 1/5] test: Use a more ubiquitous probe for return()-action tests eugene.loh
` (3 preceding siblings ...)
2025-10-01 6:24 ` [PATCH 5/5] test: Remove antiquated special case for aarch64 eugene.loh
@ 2025-10-03 3:50 ` Kris Van Hees
4 siblings, 0 replies; 12+ messages in thread
From: Kris Van Hees @ 2025-10-03 3:50 UTC (permalink / raw)
To: eugene.loh; +Cc: dtrace, dtrace-devel
On Wed, Oct 01, 2025 at 02:24:14AM -0400, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> 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.
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
> 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
>
> diff --git a/test/unittest/actions/return/err.not_allowed-1.d b/test/unittest/actions/return/err.not_allowed-1.d
> index 246a68b18..e32751bf2 100644
> --- a/test/unittest/actions/return/err.not_allowed-1.d
> +++ b/test/unittest/actions/return/err.not_allowed-1.d
> @@ -20,7 +20,7 @@ BEGIN
> exit(0);
> }
>
> -fbt:btrfs:open_ctree:entry
> +fbt:vmlinux:__*_sys_getpid:entry
> /ok/
> {
> return(0);
> diff --git a/test/unittest/actions/return/err.not_allowed-1.r b/test/unittest/actions/return/err.not_allowed-1.r
> index e3443c301..becd3d4fa 100644
> --- a/test/unittest/actions/return/err.not_allowed-1.r
> +++ b/test/unittest/actions/return/err.not_allowed-1.r
> @@ -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
> diff --git a/test/unittest/actions/return/err.not_allowed-1.r.p b/test/unittest/actions/return/err.not_allowed-1.r.p
> new file mode 100755
> index 000000000..d356eb0dd
> --- /dev/null
> +++ b/test/unittest/actions/return/err.not_allowed-1.r.p
> @@ -0,0 +1,5 @@
> +#!/usr/bin/gawk -f
> +{
> + sub("__.*_sys_getpid", "__*_sys_getpid");
> + print;
> +}
> diff --git a/test/unittest/actions/return/err.not_allowed-2.d b/test/unittest/actions/return/err.not_allowed-2.d
> index e0d303c71..4c613065f 100644
> --- a/test/unittest/actions/return/err.not_allowed-2.d
> +++ b/test/unittest/actions/return/err.not_allowed-2.d
> @@ -20,7 +20,7 @@ BEGIN
> exit(0);
> }
>
> -rawfbt:btrfs:close_ctree:entry
> +rawfbt:vmlinux:abort:entry
> /ok/
> {
> return(0);
> diff --git a/test/unittest/actions/return/err.not_allowed-2.r b/test/unittest/actions/return/err.not_allowed-2.r
> index 758d34770..bd47e2bae 100644
> --- a/test/unittest/actions/return/err.not_allowed-2.r
> +++ b/test/unittest/actions/return/err.not_allowed-2.r
> @@ -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
> diff --git a/test/unittest/actions/return/err.not_allowed-3.d b/test/unittest/actions/return/err.not_allowed-3.d
> index 770565c93..87891b7ba 100644
> --- a/test/unittest/actions/return/err.not_allowed-3.d
> +++ b/test/unittest/actions/return/err.not_allowed-3.d
> @@ -20,7 +20,7 @@ BEGIN
> exit(0);
> }
>
> -rawfbt:btrfs:*_ctree:entry
> +rawfbt:vmlinux:abo*rt:entry
> /ok/
> {
> return(0);
> diff --git a/test/unittest/actions/return/err.not_allowed-3.r b/test/unittest/actions/return/err.not_allowed-3.r
> index 758d34770..bd47e2bae 100644
> --- a/test/unittest/actions/return/err.not_allowed-3.r
> +++ b/test/unittest/actions/return/err.not_allowed-3.r
> @@ -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
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 12+ messages in thread