Skip to content

Commit 59481b8

Browse files
liu-song-6pmladek
authored andcommitted
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 <[email protected]> Acked-by: Joe Lawrence <[email protected]> Acked-by: Miroslav Benes <[email protected]> Link: https://lore.kernel.org/r/[email protected] [[email protected]: Call grep with -q option.] Reviewed-by: Petr Mladek <[email protected]> Tested-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
1 parent 4deb3b2 commit 59481b8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/testing/selftests/livepatch/test-kprobe.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
. $(dirname $0)/functions.sh
77

8+
grep -q kprobe_ftrace_ops /proc/kallsyms || skip "test-kprobe requires CONFIG_KPROBES_ON_FTRACE"
9+
810
MOD_LIVEPATCH=test_klp_livepatch
911
MOD_KPROBE=test_klp_kprobe
1012

0 commit comments

Comments
 (0)