From: Miroslav Benes <mbenes@suse.cz>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com>,
bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-doc@vger.kernel.org, corbet@lwn.net, jpoimboe@kernel.org,
shuah@kernel.org, jolsa@kernel.org, mhiramat@kernel.org,
stable@vger.kernel.org, linux-open-source@crowdstrike.com
Subject: Re: [RFC PATCH bpf-next 2/2] selftests/livepatch: update test-ftrace.sh for deprecated ftrace_enabled
Date: Fri, 31 Jul 2026 11:04:56 +0200 (CEST) [thread overview]
Message-ID: <alpine.LSU.2.21.2607311104390.25165@pobox.suse.cz> (raw)
In-Reply-To: <20260730200913.59a541db@gandalf.local.home>
On Thu, 30 Jul 2026, Steven Rostedt wrote:
> On Thu, 30 Jul 2026 12:35:44 -0400
> Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com> wrote:
>
> > kernel.ftrace_enabled=0 is now always refused, so the old scenario
> > (disable, fail to load a livepatch, re-enable, load) no longer applies.
> > Replace it with a single check that the write is refused with the new
> > error, and drop the now-stale disable/reload flow.
> >
> > Assisted-by: Claude:claude-sonnet-5
> > Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com>
> > ---
> > .../selftests/livepatch/test-ftrace.sh | 49 ++-----------------
> > 1 file changed, 3 insertions(+), 46 deletions(-)
> >
> > diff --git a/tools/testing/selftests/livepatch/test-ftrace.sh b/tools/testing/selftests/livepatch/test-ftrace.sh
> > index d2c3dea63104..c88f4d13a134 100755
> > --- a/tools/testing/selftests/livepatch/test-ftrace.sh
> > +++ b/tools/testing/selftests/livepatch/test-ftrace.sh
> > @@ -9,56 +9,13 @@ MOD_LIVEPATCH=test_klp_livepatch
> > setup_config
> >
> >
> > -# - turn ftrace_enabled OFF and verify livepatches can't load
> > -# - turn ftrace_enabled ON and verify livepatch can load
> > -# - verify that ftrace_enabled can't be turned OFF while a livepatch is loaded
> > +# - verify that kernel.ftrace_enabled=0 is refused (deprecated knob)
> >
> > -start_test "livepatch interaction with ftrace_enabled sysctl"
> > +start_test "ftrace_enabled sysctl write is refused (deprecated)"
> >
> > -set_ftrace_enabled 0
> > -load_failing_mod $MOD_LIVEPATCH
> > -
> > -set_ftrace_enabled 1
> > -load_lp $MOD_LIVEPATCH
> > -if [[ "$(cat /proc/cmdline)" != "$MOD_LIVEPATCH: this has been live patched" ]] ; then
> > - echo -e "FAIL\n\n"
> > - die "livepatch kselftest(s) failed"
> > -fi
> > -
>
> This test should work for both old and new kernels. I would have it still
> do everything here but if setting ftrace_enabled returns -EOPNOTSUPP then
> do the simple path.
Yes, please. It would be ideal.
Miroslav
prev parent reply other threads:[~2026-07-31 9:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 16:35 [RFC PATCH bpf-next 0/2] ftrace: deprecate the ftrace_enabled disable switch Andrey Grodzovsky
2026-07-30 16:35 ` [RFC PATCH bpf-next 1/2] ftrace: deprecate disabling via ftrace_enabled sysctl Andrey Grodzovsky
2026-07-30 16:35 ` [RFC PATCH bpf-next 2/2] selftests/livepatch: update test-ftrace.sh for deprecated ftrace_enabled Andrey Grodzovsky
2026-07-31 0:09 ` Steven Rostedt
2026-07-31 9:04 ` Miroslav Benes [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LSU.2.21.2607311104390.25165@pobox.suse.cz \
--to=mbenes@suse.cz \
--cc=andrey.grodzovsky@crowdstrike.com \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=jolsa@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-open-source@crowdstrike.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox