From: Fushuai Wang Date: Fri, 10 Oct 2025 12:07:27 +0000 (+0800) Subject: selftests: livepatch: use canonical ftrace path X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5cb5575308bce9d63178fe943bf89c520a348808;p=thirdparty%2Flinux.git selftests: livepatch: use canonical ftrace path Since v4.1 kernel, a new interface for ftrace called "tracefs" was introduced, which is usually mounted in /sys/kernel/tracing. Therefore, tracing files can now be accessed via either the legacy path /sys/kernel/debug/tracing or the newer path /sys/kernel/tracing. Signed-off-by: Fushuai Wang Reviewed-by: Petr Mladek Tested-by: Petr Mladek Signed-off-by: Petr Mladek --- diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh index 46991a029f7c6..8ec0cb64ad94a 100644 --- a/tools/testing/selftests/livepatch/functions.sh +++ b/tools/testing/selftests/livepatch/functions.sh @@ -10,7 +10,11 @@ SYSFS_KERNEL_DIR="/sys/kernel" SYSFS_KLP_DIR="$SYSFS_KERNEL_DIR/livepatch" SYSFS_DEBUG_DIR="$SYSFS_KERNEL_DIR/debug" SYSFS_KPROBES_DIR="$SYSFS_DEBUG_DIR/kprobes" -SYSFS_TRACING_DIR="$SYSFS_DEBUG_DIR/tracing" +if [[ -e /sys/kernel/tracing/trace ]]; then + SYSFS_TRACING_DIR="$SYSFS_KERNEL_DIR/tracing" +else + SYSFS_TRACING_DIR="$SYSFS_DEBUG_DIR/tracing" +fi # Kselftest framework requirement - SKIP code is 4 ksft_skip=4