[DTrace-devel] [PATCH] tests, io: don't use /proc/kallmodsyms

Nick Alcock nick.alcock at oracle.com
Wed Jan 31 14:13:06 UTC 2024


tst.local2.sh works perfectly well with /proc/kallsyms with only a
tiny change in field numbering, which lets this test pass on
unmodified upstream kernels and kernels with the vmlinux.ranges
patch too.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
 test/unittest/io/check_io_probe_args.sh | 6 +++---
 test/unittest/io/tst.local2.sh          | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/test/unittest/io/check_io_probe_args.sh b/test/unittest/io/check_io_probe_args.sh
index 9a74b712a4c1..00dadb7a0001 100755
--- a/test/unittest/io/check_io_probe_args.sh
+++ b/test/unittest/io/check_io_probe_args.sh
@@ -160,15 +160,15 @@ fi
 #
 
 if [ $UID -ne 0 ]; then
-    echo skipping iodone check since must be root to read PCs in kallmodsyms
+    echo skipping iodone check since must be root to read PCs in kallsyms
     retval=1
 else
     for pc in `gawk 'NF == 23 { print $14 }' $infile | grep -wv 0 | sort | uniq`; do
         gawk '$1 == "'$pc'" && /end.*io/ { found = 1; exit }
-            END { exit(found) }' /proc/kallmodsyms
+            END { exit(found) }' /proc/kallsyms
         if [ $? -eq 0 ]; then
             echo "  ERROR:", $pc, " is not an end-io function"
-            grep $pc /proc/kallmodsyms
+            grep $pc /proc/kallsyms
             retval=1
         fi
     done
diff --git a/test/unittest/io/tst.local2.sh b/test/unittest/io/tst.local2.sh
index df8fdf350358..abf230d017b0 100755
--- a/test/unittest/io/tst.local2.sh
+++ b/test/unittest/io/tst.local2.sh
@@ -90,7 +90,7 @@ END {
 }
 EOF
 
-myaddr=`awk '$4 == "xfs_end_bio"       {print $1}' /proc/kallmodsyms`
+myaddr=`awk '$3 == "xfs_end_bio"       {print $1}' /proc/kallsyms`
 echo check start bytes in log.write with xfs_end_bio address $myaddr
 awk -v myflags=520 -v nrecflag=1 -v myiodone=$myaddr -f awk.txt log.write
 if [ $? -ne 0 ]; then
@@ -99,7 +99,7 @@ if [ $? -ne 0 ]; then
     retval=1
 fi
 
-myaddr=`awk '$4 == "iomap_read_end_io" {print $1}' /proc/kallmodsyms`
+myaddr=`awk '$3 == "iomap_read_end_io" {print $1}' /proc/kallsyms`
 echo check start bytes in log.read with iomap_read_end_io address $myaddr
 awk -v myflags=460 -v nrecflag=2 -v myiodone=$myaddr -f awk.txt log.read
 if [ $? -ne 0 ]; then

base-commit: 049dd8b1b9cf2cd45e57385247befb9e10f5a333
-- 
2.43.0.272.gce700b77fd




More information about the DTrace-devel mailing list