hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/tools/testing/selftests/ftrace/ftracetest
....@@ -30,6 +30,9 @@
3030 # kselftest skip code is 4
3131 err_skip=4
3232
33
+# umount required
34
+UMOUNT_DIR=""
35
+
3336 # cgroup RT scheduling prevents chrt commands from succeeding, which
3437 # induces failures in test wakeup tests. Disable for the duration of
3538 # the tests.
....@@ -44,6 +47,9 @@
4447
4548 cleanup() {
4649 echo $sched_rt_runtime_orig > $sched_rt_runtime
50
+ if [ -n "${UMOUNT_DIR}" ]; then
51
+ umount ${UMOUNT_DIR} ||:
52
+ fi
4753 }
4854
4955 errexit() { # message
....@@ -155,11 +161,13 @@
155161 mount -t tracefs nodev /sys/kernel/tracing ||
156162 errexit "Failed to mount /sys/kernel/tracing"
157163 TRACING_DIR="/sys/kernel/tracing"
164
+ UMOUNT_DIR=${TRACING_DIR}
158165 # If debugfs exists, then so does /sys/kernel/debug
159166 elif [ -d "/sys/kernel/debug" ]; then
160167 mount -t debugfs nodev /sys/kernel/debug ||
161168 errexit "Failed to mount /sys/kernel/debug"
162169 TRACING_DIR="/sys/kernel/debug/tracing"
170
+ UMOUNT_DIR=${TRACING_DIR}
163171 else
164172 err_ret=$err_skip
165173 errexit "debugfs and tracefs are not configured in this kernel"