On 3/18/25 12:25, Song Liu wrote: > On Tue, Mar 18, 2025 at 6:45 AM Joe Lawrence <joe.lawrence@xxxxxxxxxx> wrote: >> >> On Tue, Mar 18, 2025 at 11:14:55AM +0100, Miroslav Benes wrote: >>> Hi, >>> >>> On Mon, 17 Mar 2025, Song Liu wrote: >>> >>>> On Mon, Mar 17, 2025 at 11:59 AM Joe Lawrence <joe.lawrence@xxxxxxxxxx> wrote: >>>>> >>>>> On 3/17/25 12:51, Song Liu wrote: >>>>>> CONFIG_KPROBES_ON_FTRACE is required for test-kprobe. Skip test-kprobe >>>>>> when CONFIG_KPROBES_ON_FTRACE is not set. >>>>>> >>>>>> Signed-off-by: Song Liu <song@xxxxxxxxxx> >>>>>> --- >>>>>> tools/testing/selftests/livepatch/test-kprobe.sh | 2 ++ >>>>>> 1 file changed, 2 insertions(+) >>>>>> >>>>>> diff --git a/tools/testing/selftests/livepatch/test-kprobe.sh b/tools/testing/selftests/livepatch/test-kprobe.sh >>>>>> index 115065156016..fd823dd5dd7f 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 >>>>>> >>>>>> +zgrep KPROBES_ON_FTRACE /proc/config.gz || skip "test-kprobe requires CONFIG_KPROBES_ON_FTRACE" >>>>>> + >>>>> >>>>> Hi Song, >>>>> >>>>> This in turn depends on CONFIG_IKCONFIG_PROC for /proc/config.gz (not >>>>> set for RHEL distro kernels). >>>> >>>> I was actually worrying about this when testing it. >>>> >>>>> Is there a dynamic way to figure out CONFIG_KPROBES_ON_FTRACE support? >>>> >>>> How about we grep kprobe_ftrace_ops from /proc/kallsyms? >>> >>> which relies on having KALLSYMS_ALL enabled but since CONFIG_LIVEPATCH >>> depends on it, we are good. So I would say yes, it is a better option. >>> Please, add a comment around. >>> >> >> Kallsyms is a good workaround as kprobe_ftrace_ops should be stable (I >> hope :) >> >> Since Song probably noticed this when upgrading and the new kprobes test >> unexpectedly failed, I'd add a Fixes tag to help out backporters: >> >> Fixes: 62597edf6340 ("selftests: livepatch: test livepatching a kprobed function") >> >> but IMHO not worth rushing as important through the merge window. >> >> >> Also, while poking at this today with virtme-ng, my initial attempt had >> build a fairly minimal kernel without CONFIG_DYNAMIC_DEBUG. We can also >> check for that via the sysfs interface to avoid confusing path-not-found >> msgs, like the following ... > > We already have CONFIG_DYNAMIC_DEBUG=y in > tools/testing/selftests/livepatch, so I think we don't need to check that again. > Ah right. Do you know what script/file reads or sources that file? (It's such a generic term that I get a bazillion grep hits.) When I run `make -C tools/testing/selftests/livepatch run_tests` it just builds and runs the tests regardless of the actual config. -- Joe