CHARSET="UTF-8"
ASAN_OPTIONS="detect_leaks=0"
UBSAN_OPTIONS="print_stacktrace=1:print_summary=1:halt_on_error=1"
+ KERNEL_VERSION_XYZ=$(uname -r | awk -F- '{print $1}')
+ KERNEL_VERSION_MAJOR=$(echo "$KERNEL_VERSION_XYZ" | awk -F. '{print $1}')
+ KERNEL_VERSION_MINOR=$(echo "$KERNEL_VERSION_XYZ" | awk -F. '{print $2}')
+ KERNEL_RELEASE=$(echo "$KERNEL_VERSION_XYZ" | awk -F. '{print $3}')
- export LANG LANGUAGE LC_ALL CHARSET ASAN_OPTIONS UBSAN_OPTIONS
+ export LANG LANGUAGE LC_ALL CHARSET ASAN_OPTIONS UBSAN_OPTIONS \
+ KERNEL_VERSION_XYZ KERNEL_VERSION_MAJOR KERNEL_VERSION_MINOR KERNEL_RELEASE
mydir=$(ts_canonicalize "$mydir")
}
+# Specify the kernel version X.Y.Z you wish to compare against like:
+#
+# ts_kernel_ver_lt X Y Z
+#
+function ts_kernel_ver_lt {
+ if [ $KERNEL_VERSION_MAJOR -lt $1 ]; then
+ return 0
+ elif [ $KERNEL_VERSION_MAJOR -eq $1 ]; then
+ if [ $KERNEL_VERSION_MINOR -lt $2 ]; then
+ return 0
+ elif [ $KERNEL_VERSION_MINOR -eq $2 ]; then
+ if [ $KERNEL_RELEASE -lt $3 ]; then
+ return 0
+ fi
+ fi
+
+ fi
+
+ return 1
+}
+
function ts_finalize {
ts_cleanup_on_exit
return 0
}
+function skip_kernel_lt {
+ ts_kernel_ver_lt $1 $2 $3
+ if [ $? == 0 ]; then
+ ts_skip_subtest "kernel version must be >= $1.$2.$3"
+ return 1
+ fi
+
+ return 0
+}
+
+function skip_kernel_ge {
+ ts_kernel_ver_lt $1 $2 $3
+ if [ $? == 1 ]; then
+ ts_skip_subtest "kernel version must be < $1.$2.$3"
+ return 1
+ fi
+
+ return 0
+}
+
function cleanup_output {
sed -i -e 's/pid [0-9]*/<removed>/' $TS_OUTPUT
}
ts_init_subtest "batch"
-skip_policy SCHED_BATCH
+skip_policy SCHED_BATCH && skip_kernel_ge 6 12 0
if [ $? == 0 ]; then
do_chrt --batch 0
cleanup_output
fi
+ts_init_subtest "batch-custom-slice"
+skip_policy SCHED_BATCH && skip_kernel_lt 6 12 0
+if [ $? == 0 ]; then
+ do_chrt --batch --sched-runtime 100000 0
+ cleanup_output
+ ts_finalize_subtest
+fi
+
+
ts_init_subtest "other"
-skip_policy SCHED_OTHER
+skip_policy SCHED_OTHER && skip_kernel_ge 6 12 0
if [ $? == 0 ]; then
do_chrt --other 0
cleanup_output
fi
+ts_init_subtest "other-custom-slice"
+skip_policy SCHED_OTHER && skip_kernel_lt 6 12 0
+if [ $? == 0 ]; then
+ do_chrt --other --sched-runtime 100000 0
+ cleanup_output
+ ts_finalize_subtest
+fi
+
+
ts_init_subtest "rr"
skip_policy SCHED_RR
if [ $? == 0 ]; then