@@ -132,3 +132,13 @@ json2var()
{
sed -e "s/[{}\",]//g; s/\[//g; s/\]//g; s/:/=/g"
}
+
+# check_dmesg
+# $1: line number where this is called
+check_dmesg()
+{
+ # validate no WARN or lockdep report during the run
+ log=$(journalctl -r -k --since "-$((SECONDS+1))s")
+ grep -q "Call Trace" <<< $log && err $1
+ true
+}
@@ -164,8 +164,6 @@ readarray -t endpoint < <($CXL free-dpa -t pmem ${mem[*]} |
jq -r ".[] | .decoder.decoder")
echo "$region released ${#endpoint[@]} targets: ${endpoint[@]}"
-# validate no WARN or lockdep report during the run
-log=$(journalctl -r -k --since "-$((SECONDS+1))s")
-grep -q "Call Trace" <<< $log && err "$LINENO"
+check_dmesg "$LINENO"
modprobe -r cxl_test
@@ -169,9 +169,6 @@ done
# validate that the bus can be disabled without issue
$CXL disable-bus $root -f
-
-# validate no WARN or lockdep report during the run
-log=$(journalctl -r -k --since "-$((SECONDS+1))s")
-grep -q "Call Trace" <<< $log && err "$LINENO"
+check_dmesg "$LINENO"
modprobe -r cxl_test
@@ -118,4 +118,6 @@ else
run_xfs
fi
+check_dmesg "$LINENO"
+
exit 0
@@ -71,6 +71,8 @@ if read sector len < /sys/bus/platform/devices/nfit_test.0/$busdev/$region/badbl
fi
[ -n "$sector" ] && echo "fail: $LINENO" && exit 1
+check_dmesg "$LINENO"
+
_cleanup
exit 0
@@ -28,6 +28,8 @@ chardev1=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices
json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a $ALIGN_SIZE -s 16M)
chardev2=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices[0].chardev")
+check_dmesg "$LINENO"
+
_cleanup
exit 0