Skip to content

Commit 5cb5575

Browse files
Fushuai Wangpmladek
authored andcommitted
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 <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Tested-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
1 parent 139560e commit 5cb5575

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/testing/selftests/livepatch/functions.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ SYSFS_KERNEL_DIR="/sys/kernel"
1010
SYSFS_KLP_DIR="$SYSFS_KERNEL_DIR/livepatch"
1111
SYSFS_DEBUG_DIR="$SYSFS_KERNEL_DIR/debug"
1212
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
1418

1519
# Kselftest framework requirement - SKIP code is 4
1620
ksft_skip=4

0 commit comments

Comments
 (0)