Linux DTrace development list
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: [PATCH 19/20] test: fix modpath test
Date: Fri, 30 Oct 2026 19:37:04 +0000	[thread overview]
Message-ID: <48eb9d0eb1ac2856fe443912ec9a335a@oracle.com> (raw)

The empty CTF case was failing because BTF was still providing the types
needed through the BTF-to-CTF conversion fallback.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 test/unittest/options/tst.modpath.sh | 35 +++++++++++++---------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/test/unittest/options/tst.modpath.sh b/test/unittest/options/tst.modpath.sh
index 7060a716..b9d92e8a 100755
--- a/test/unittest/options/tst.modpath.sh
+++ b/test/unittest/options/tst.modpath.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved.
 # Licensed under the Universal Permissive License v 1.0 as shown at
 # http://oss.oracle.com/licenses/upl.
 #
@@ -11,6 +11,8 @@ dtrace=$1
 DIRNAME="$tmpdir/modpath.$$.$RANDOM"
 mkdir -p $DIRNAME
 cd $DIRNAME
+# Exercise CTF archive lookup without falling back to BTF.
+dt_flags="$dt_flags -xbtfpath=none"
 
 # Create the directory where the CTF archive will end up.
 mkdir -p mydirectory/kernel
@@ -25,11 +27,14 @@ else
 	echo basic check on DTrace passed
 fi
 
-# Verify that modpath directs us to the (empty) directory, with no CTF info.
-$dtrace $dt_flags -xmodpath=mydirectory -lvP rawtp > empty.out
-if [ $? -ne 0 ]; then
-	echo ERROR: empty check on DTrace failed
-	cat empty.out
+# Without CTF or BTF, listing rawtp probes must fail with missing type data.
+if $dtrace $dt_flags -xmodpath=mydirectory -lvP rawtp > empty.out 2> empty.err; then
+	echo ERROR: empty check on DTrace unexpectedly succeeded
+	cat empty.out empty.err
+	exit 1
+elif ! grep -Fq 'No type data (CTF or BTF) found for vmlinux' empty.err; then
+	echo ERROR: empty check on DTrace failed for an unexpected reason
+	cat empty.out empty.err
 	exit 1
 else
 	echo empty check on DTrace passed
@@ -49,30 +54,22 @@ else
 fi
 
 # Check the amount of CTF info we got from each run by seeing how many
-# rawtp args have non-trivial type info.  While nempty should be 0,
-# nbasic and nfinal should be substantial and likely identical (but
-# we allow a generous tolerance).
+# rawtp args have non-trivial type info.  Both nbasic and nfinal should be
+# substantial and likely identical (but we allow a generous tolerance).
 
 nbasic=`gawk '/^[	 ]*args\[/ && !/uint64_t/ && !/void \*/' basic.out | wc -l`
-nempty=`gawk '/^[	 ]*args\[/ && !/uint64_t/ && !/void \*/' empty.out | wc -l`
 nfinal=`gawk '/^[	 ]*args\[/ && !/uint64_t/ && !/void \*/' final.out | wc -l`
 
-if [ $nempty -ne 0 ]; then
-	echo ERROR: empty check turned up some CTF info
-	cat empty.out
-	echo got nbasic $nbasic nempty $nempty nfinal $nfinal
-	exit 1
-fi
 if [ $nbasic -lt 1000 ]; then
 	echo ERROR: basic check turned up little CTF info
 	cat basic.out
-	echo got nbasic $nbasic nempty $nempty nfinal $nfinal
+	echo got nbasic $nbasic nfinal $nfinal
 	exit 1
 fi
 if [ $nfinal -lt 1000 ]; then
 	echo ERROR: final check turned up little CTF info
 	cat final.out
-	echo got nbasic $nbasic nempty $nempty nfinal $nfinal
+	echo got nbasic $nbasic nfinal $nfinal
 	exit 1
 fi
 if [ $nbasic -gt $(($nfinal + 200)) -o $nfinal -gt $((nbasic + 200)) ]; then
@@ -81,7 +78,7 @@ if [ $nbasic -gt $(($nfinal + 200)) -o $nfinal -gt $((nbasic + 200)) ]; then
 	cat basic.out
 	echo ==== final.out:
 	cat final.out
-	echo got nbasic $nbasic nempty $nempty nfinal $nfinal
+	echo got nbasic $nbasic nfinal $nfinal
 	exit 1
 fi
 
-- 
2.52.0


             reply	other threads:[~2026-10-30 19:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 19:37 Kris Van Hees [this message]
2026-11-06 13:40 ` [PATCH 19/20] test: fix modpath test Nick Alcock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48eb9d0eb1ac2856fe443912ec9a335a@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox