Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <wangfushuai@baidu.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>

authored by

Fushuai Wang and committed by
Petr Mladek
5cb55753 139560e8

+5 -1
+5 -1
tools/testing/selftests/livepatch/functions.sh
··· 10 10 SYSFS_KLP_DIR="$SYSFS_KERNEL_DIR/livepatch" 11 11 SYSFS_DEBUG_DIR="$SYSFS_KERNEL_DIR/debug" 12 12 SYSFS_KPROBES_DIR="$SYSFS_DEBUG_DIR/kprobes" 13 - SYSFS_TRACING_DIR="$SYSFS_DEBUG_DIR/tracing" 13 + if [[ -e /sys/kernel/tracing/trace ]]; then 14 + SYSFS_TRACING_DIR="$SYSFS_KERNEL_DIR/tracing" 15 + else 16 + SYSFS_TRACING_DIR="$SYSFS_DEBUG_DIR/tracing" 17 + fi 14 18 15 19 # Kselftest framework requirement - SKIP code is 4 16 20 ksft_skip=4