From: Song Liu Date: Tue, 18 Mar 2025 18:15:18 +0000 (-0700) Subject: selftest/livepatch: Only run test-kprobe with CONFIG_KPROBES_ON_FTRACE X-Git-Tag: v6.15-rc1~135^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59481b8bd0f038ca99f041566c1c04d069b54dc7;p=thirdparty%2Fkernel%2Flinux.git selftest/livepatch: Only run test-kprobe with CONFIG_KPROBES_ON_FTRACE CONFIG_KPROBES_ON_FTRACE is required for test-kprobe. Skip test-kprobe when CONFIG_KPROBES_ON_FTRACE is not set. Since some kernel may not have /proc/config.gz, grep for kprobe_ftrace_ops from /proc/kallsyms to check whether CONFIG_KPROBES_ON_FTRACE is enabled. Signed-off-by: Song Liu Acked-by: Joe Lawrence Acked-by: Miroslav Benes Link: https://lore.kernel.org/r/20250318181518.1055532-1-song@kernel.org [pmladek@suse.com: Call grep with -q option.] Reviewed-by: Petr Mladek Tested-by: Petr Mladek Signed-off-by: Petr Mladek --- diff --git a/tools/testing/selftests/livepatch/test-kprobe.sh b/tools/testing/selftests/livepatch/test-kprobe.sh index 115065156016a..b67dfad03d97f 100755 --- a/tools/testing/selftests/livepatch/test-kprobe.sh +++ b/tools/testing/selftests/livepatch/test-kprobe.sh @@ -5,6 +5,8 @@ . $(dirname $0)/functions.sh +grep -q kprobe_ftrace_ops /proc/kallsyms || skip "test-kprobe requires CONFIG_KPROBES_ON_FTRACE" + MOD_LIVEPATCH=test_klp_livepatch MOD_KPROBE=test_klp_kprobe