* [PATCH 0/2] kselftests: livepatch: One new test and one fix for older bash
@ 2026-02-20 14:12 Marcos Paulo de Souza
2026-02-20 14:12 ` [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function Marcos Paulo de Souza
2026-02-20 14:12 ` [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash Marcos Paulo de Souza
0 siblings, 2 replies; 14+ messages in thread
From: Marcos Paulo de Souza @ 2026-02-20 14:12 UTC (permalink / raw)
To: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Shuah Khan
Cc: live-patching, linux-kselftest, linux-kernel,
Marcos Paulo de Souza
I found the bash issue when running this new test on a SLE12-SP5. There
are still other issues that would need to be addressed, but with this
change, test-ftrace.sh can run on SLE12-SP5 withou issues.
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
Marcos Paulo de Souza (2):
selftests: livepatch: test-ftrace: livepatch a traced function
selftests: livepatch: functions.sh: Workaround heredoc on older bash
tools/testing/selftests/livepatch/functions.sh | 6 ++--
tools/testing/selftests/livepatch/test-ftrace.sh | 36 ++++++++++++++++++++++++
2 files changed, 38 insertions(+), 4 deletions(-)
---
base-commit: 6d6ad32e22f028c525d5df471c5522616e645a6b
change-id: 20260220-lp-test-trace-73b2f607960a
Best regards,
--
Marcos Paulo de Souza <mpdesouza@suse.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function
2026-02-20 14:12 [PATCH 0/2] kselftests: livepatch: One new test and one fix for older bash Marcos Paulo de Souza
@ 2026-02-20 14:12 ` Marcos Paulo de Souza
2026-02-23 15:39 ` Joe Lawrence
` (2 more replies)
2026-02-20 14:12 ` [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash Marcos Paulo de Souza
1 sibling, 3 replies; 14+ messages in thread
From: Marcos Paulo de Souza @ 2026-02-20 14:12 UTC (permalink / raw)
To: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Shuah Khan
Cc: live-patching, linux-kselftest, linux-kernel,
Marcos Paulo de Souza
This is basically the inverse case of commit 474eecc882ae
("selftests: livepatch: test if ftrace can trace a livepatched function")
but ensuring that livepatch would work on a traced function.
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
tools/testing/selftests/livepatch/test-ftrace.sh | 36 ++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/tools/testing/selftests/livepatch/test-ftrace.sh b/tools/testing/selftests/livepatch/test-ftrace.sh
index 094176f1a46a..c6222cc037c5 100755
--- a/tools/testing/selftests/livepatch/test-ftrace.sh
+++ b/tools/testing/selftests/livepatch/test-ftrace.sh
@@ -95,4 +95,40 @@ livepatch: '$MOD_LIVEPATCH': completing unpatching transition
livepatch: '$MOD_LIVEPATCH': unpatching complete
% rmmod $MOD_LIVEPATCH"
+
+# - trace a function
+# - verify livepatch can load targgeting no the same traced function
+# - check if the livepatch is in effect
+# - reset trace and unload livepatch
+
+start_test "livepatch a traced function and check that the live patch remains in effect"
+
+FUNCTION_NAME="cmdline_proc_show"
+
+trace_function "$FUNCTION_NAME"
+load_lp $MOD_LIVEPATCH
+
+if [[ "$(cat /proc/cmdline)" == "$MOD_LIVEPATCH: this has been live patched" ]] ; then
+ log "livepatch: ok"
+fi
+
+check_traced_functions "$FUNCTION_NAME"
+
+disable_lp $MOD_LIVEPATCH
+unload_lp $MOD_LIVEPATCH
+
+check_result "% insmod test_modules/$MOD_LIVEPATCH.ko
+livepatch: enabling patch '$MOD_LIVEPATCH'
+livepatch: '$MOD_LIVEPATCH': initializing patching transition
+livepatch: '$MOD_LIVEPATCH': starting patching transition
+livepatch: '$MOD_LIVEPATCH': completing patching transition
+livepatch: '$MOD_LIVEPATCH': patching complete
+livepatch: ok
+% echo 0 > $SYSFS_KLP_DIR/$MOD_LIVEPATCH/enabled
+livepatch: '$MOD_LIVEPATCH': initializing unpatching transition
+livepatch: '$MOD_LIVEPATCH': starting unpatching transition
+livepatch: '$MOD_LIVEPATCH': completing unpatching transition
+livepatch: '$MOD_LIVEPATCH': unpatching complete
+% rmmod $MOD_LIVEPATCH"
+
exit 0
--
2.52.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-02-20 14:12 [PATCH 0/2] kselftests: livepatch: One new test and one fix for older bash Marcos Paulo de Souza
2026-02-20 14:12 ` [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function Marcos Paulo de Souza
@ 2026-02-20 14:12 ` Marcos Paulo de Souza
2026-02-23 15:42 ` Joe Lawrence
` (2 more replies)
1 sibling, 3 replies; 14+ messages in thread
From: Marcos Paulo de Souza @ 2026-02-20 14:12 UTC (permalink / raw)
To: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Shuah Khan
Cc: live-patching, linux-kselftest, linux-kernel,
Marcos Paulo de Souza
When running current selftests on older distributions like SLE12-SP5 that
contains an older bash trips over heredoc. Convert it to plain echo
calls, which ends up with the same result.
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
tools/testing/selftests/livepatch/functions.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
index 8ec0cb64ad94..45ed04c6296e 100644
--- a/tools/testing/selftests/livepatch/functions.sh
+++ b/tools/testing/selftests/livepatch/functions.sh
@@ -96,10 +96,8 @@ function pop_config() {
}
function set_dynamic_debug() {
- cat <<-EOF > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
- file kernel/livepatch/* +p
- func klp_try_switch_task -p
- EOF
+ echo "file kernel/livepatch/* +p" > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
+ echo "func klp_try_switch_task -p" > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
}
function set_ftrace_enabled() {
--
2.52.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function
2026-02-20 14:12 ` [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function Marcos Paulo de Souza
@ 2026-02-23 15:39 ` Joe Lawrence
2026-02-26 12:14 ` Miroslav Benes
2026-03-06 13:45 ` Petr Mladek
2 siblings, 0 replies; 14+ messages in thread
From: Joe Lawrence @ 2026-02-23 15:39 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
On Fri, Feb 20, 2026 at 11:12:33AM -0300, Marcos Paulo de Souza wrote:
> This is basically the inverse case of commit 474eecc882ae
> ("selftests: livepatch: test if ftrace can trace a livepatched function")
> but ensuring that livepatch would work on a traced function.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
> ---
> tools/testing/selftests/livepatch/test-ftrace.sh | 36 ++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/tools/testing/selftests/livepatch/test-ftrace.sh b/tools/testing/selftests/livepatch/test-ftrace.sh
> index 094176f1a46a..c6222cc037c5 100755
> --- a/tools/testing/selftests/livepatch/test-ftrace.sh
> +++ b/tools/testing/selftests/livepatch/test-ftrace.sh
> @@ -95,4 +95,40 @@ livepatch: '$MOD_LIVEPATCH': completing unpatching transition
> livepatch: '$MOD_LIVEPATCH': unpatching complete
> % rmmod $MOD_LIVEPATCH"
>
> +
> +# - trace a function
> +# - verify livepatch can load targgeting no the same traced function
nitpick: s/targgeting no/targeting on/ ?
Otherwise LGTM,
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
--
Joe
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-02-20 14:12 ` [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash Marcos Paulo de Souza
@ 2026-02-23 15:42 ` Joe Lawrence
2026-02-23 16:21 ` Marcos Paulo de Souza
2026-02-23 16:37 ` David Laight
2026-03-06 14:30 ` Petr Mladek
2 siblings, 1 reply; 14+ messages in thread
From: Joe Lawrence @ 2026-02-23 15:42 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
On Fri, Feb 20, 2026 at 11:12:34AM -0300, Marcos Paulo de Souza wrote:
> When running current selftests on older distributions like SLE12-SP5 that
> contains an older bash trips over heredoc. Convert it to plain echo
> calls, which ends up with the same result.
>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Just curious, what's the bash/heredoc issue? All I could find via
google search was perhaps something to do with the temporary file
implementation under the hood.
--
Joe
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
> ---
> tools/testing/selftests/livepatch/functions.sh | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
> index 8ec0cb64ad94..45ed04c6296e 100644
> --- a/tools/testing/selftests/livepatch/functions.sh
> +++ b/tools/testing/selftests/livepatch/functions.sh
> @@ -96,10 +96,8 @@ function pop_config() {
> }
>
> function set_dynamic_debug() {
> - cat <<-EOF > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> - file kernel/livepatch/* +p
> - func klp_try_switch_task -p
> - EOF
> + echo "file kernel/livepatch/* +p" > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> + echo "func klp_try_switch_task -p" > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> }
>
> function set_ftrace_enabled() {
>
> --
> 2.52.0
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-02-23 15:42 ` Joe Lawrence
@ 2026-02-23 16:21 ` Marcos Paulo de Souza
2026-02-26 12:40 ` Miroslav Benes
0 siblings, 1 reply; 14+ messages in thread
From: Marcos Paulo de Souza @ 2026-02-23 16:21 UTC (permalink / raw)
To: Joe Lawrence
Cc: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
On Mon, 2026-02-23 at 10:42 -0500, Joe Lawrence wrote:
> On Fri, Feb 20, 2026 at 11:12:34AM -0300, Marcos Paulo de Souza
> wrote:
> > When running current selftests on older distributions like SLE12-
> > SP5 that
> > contains an older bash trips over heredoc. Convert it to plain echo
> > calls, which ends up with the same result.
> >
>
> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Thanks for the review Joe!
>
> Just curious, what's the bash/heredoc issue? All I could find via
> google search was perhaps something to do with the temporary file
> implementation under the hood.
# ./test-ftrace.sh
cat: -: No such file or directory
TEST: livepatch interaction with ftrace_enabled sysctl ... ^CQEMU:
Terminated
Somehow it doesn't understand the heredoc, but maybe I'm wrong...
either way, the change has the same outcome, so I believe that it
wasn't bad if we could change the cat for two echoes :)
Either way, if Petr or you think that this should be left as it is,
it's fine by me as well, I was just testing the change with an older
rootfs/kernels.
>
> --
> Joe
>
> > Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
> > ---
> > tools/testing/selftests/livepatch/functions.sh | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/testing/selftests/livepatch/functions.sh
> > b/tools/testing/selftests/livepatch/functions.sh
> > index 8ec0cb64ad94..45ed04c6296e 100644
> > --- a/tools/testing/selftests/livepatch/functions.sh
> > +++ b/tools/testing/selftests/livepatch/functions.sh
> > @@ -96,10 +96,8 @@ function pop_config() {
> > }
> >
> > function set_dynamic_debug() {
> > - cat <<-EOF > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> > - file kernel/livepatch/* +p
> > - func klp_try_switch_task -p
> > - EOF
> > + echo "file kernel/livepatch/* +p" >
> > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> > + echo "func klp_try_switch_task -p" >
> > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> > }
> >
> > function set_ftrace_enabled() {
> >
> > --
> > 2.52.0
> >
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-02-20 14:12 ` [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash Marcos Paulo de Souza
2026-02-23 15:42 ` Joe Lawrence
@ 2026-02-23 16:37 ` David Laight
2026-03-06 14:30 ` Petr Mladek
2 siblings, 0 replies; 14+ messages in thread
From: David Laight @ 2026-02-23 16:37 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Shuah Khan, live-patching, linux-kselftest,
linux-kernel
On Fri, 20 Feb 2026 11:12:34 -0300
Marcos Paulo de Souza <mpdesouza@suse.com> wrote:
> When running current selftests on older distributions like SLE12-SP5 that
> contains an older bash trips over heredoc. Convert it to plain echo
> calls, which ends up with the same result.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
> ---
> tools/testing/selftests/livepatch/functions.sh | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
> index 8ec0cb64ad94..45ed04c6296e 100644
> --- a/tools/testing/selftests/livepatch/functions.sh
> +++ b/tools/testing/selftests/livepatch/functions.sh
> @@ -96,10 +96,8 @@ function pop_config() {
> }
>
> function set_dynamic_debug() {
> - cat <<-EOF > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> - file kernel/livepatch/* +p
> - func klp_try_switch_task -p
> - EOF
> + echo "file kernel/livepatch/* +p" > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
> + echo "func klp_try_switch_task -p" > "$SYSFS_DEBUG_DIR/dynamic_debug/control"
Use printf so you can write both lines in one command.
David
> }
>
> function set_ftrace_enabled() {
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function
2026-02-20 14:12 ` [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function Marcos Paulo de Souza
2026-02-23 15:39 ` Joe Lawrence
@ 2026-02-26 12:14 ` Miroslav Benes
2026-03-06 13:45 ` Petr Mladek
2 siblings, 0 replies; 14+ messages in thread
From: Miroslav Benes @ 2026-02-26 12:14 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: Josh Poimboeuf, Jiri Kosina, Petr Mladek, Joe Lawrence,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
Hi,
On Fri, 20 Feb 2026, Marcos Paulo de Souza wrote:
> This is basically the inverse case of commit 474eecc882ae
> ("selftests: livepatch: test if ftrace can trace a livepatched function")
> but ensuring that livepatch would work on a traced function.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
with the typo fix that Joe mentioned
Acked-by: Miroslav Benes <mbenes@suse.cz>
M
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-02-23 16:21 ` Marcos Paulo de Souza
@ 2026-02-26 12:40 ` Miroslav Benes
2026-02-26 14:34 ` Marcos Paulo de Souza
0 siblings, 1 reply; 14+ messages in thread
From: Miroslav Benes @ 2026-02-26 12:40 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: Joe Lawrence, Josh Poimboeuf, Jiri Kosina, Petr Mladek,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]
Hi,
On Mon, 23 Feb 2026, Marcos Paulo de Souza wrote:
> On Mon, 2026-02-23 at 10:42 -0500, Joe Lawrence wrote:
> > On Fri, Feb 20, 2026 at 11:12:34AM -0300, Marcos Paulo de Souza
> > wrote:
> > > When running current selftests on older distributions like SLE12-
> > > SP5 that
> > > contains an older bash trips over heredoc. Convert it to plain echo
> > > calls, which ends up with the same result.
> > >
> >
> > Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
>
> Thanks for the review Joe!
>
> >
> > Just curious, what's the bash/heredoc issue? All I could find via
> > google search was perhaps something to do with the temporary file
> > implementation under the hood.
>
> # ./test-ftrace.sh
> cat: -: No such file or directory
> TEST: livepatch interaction with ftrace_enabled sysctl ... ^CQEMU:
> Terminated
I cannot reproduce it locally on SLE12-SP5. The patched test-ftrace.sh
runs smoothly without 2/2.
linux:~/linux/tools/testing/selftests/livepatch # ./test-ftrace.sh
TEST: livepatch interaction with ftrace_enabled sysctl ... ok
TEST: trace livepatched function and check that the live patch remains in effect ... ok
TEST: livepatch a traced function and check that the live patch remains in effect ... ok
GNU bash, version 4.3.48(1)-release (x86_64-suse-linux-gnu)
Does "set -x" in the script give you anything interesting?
Miroslav
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-02-26 12:40 ` Miroslav Benes
@ 2026-02-26 14:34 ` Marcos Paulo de Souza
2026-02-27 14:28 ` Marcos Paulo de Souza
0 siblings, 1 reply; 14+ messages in thread
From: Marcos Paulo de Souza @ 2026-02-26 14:34 UTC (permalink / raw)
To: Miroslav Benes
Cc: Joe Lawrence, Josh Poimboeuf, Jiri Kosina, Petr Mladek,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
On Thu, 2026-02-26 at 13:40 +0100, Miroslav Benes wrote:
> Hi,
>
> On Mon, 23 Feb 2026, Marcos Paulo de Souza wrote:
>
> > On Mon, 2026-02-23 at 10:42 -0500, Joe Lawrence wrote:
> > > On Fri, Feb 20, 2026 at 11:12:34AM -0300, Marcos Paulo de Souza
> > > wrote:
> > > > When running current selftests on older distributions like
> > > > SLE12-
> > > > SP5 that
> > > > contains an older bash trips over heredoc. Convert it to plain
> > > > echo
> > > > calls, which ends up with the same result.
> > > >
> > >
> > > Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
> >
> > Thanks for the review Joe!
> >
> > >
> > > Just curious, what's the bash/heredoc issue? All I could find
> > > via
> > > google search was perhaps something to do with the temporary file
> > > implementation under the hood.
> >
> > # ./test-ftrace.sh
> > cat: -: No such file or directory
> > TEST: livepatch interaction with ftrace_enabled sysctl ... ^CQEMU:
> > Terminated
>
> I cannot reproduce it locally on SLE12-SP5. The patched test-
> ftrace.sh
> runs smoothly without 2/2.
>
> linux:~/linux/tools/testing/selftests/livepatch # ./test-ftrace.sh
> TEST: livepatch interaction with ftrace_enabled sysctl ... ok
> TEST: trace livepatched function and check that the live patch
> remains in effect ... ok
> TEST: livepatch a traced function and check that the live patch
> remains in effect ... ok
>
> GNU bash, version 4.3.48(1)-release (x86_64-suse-linux-gnu)
>
> Does "set -x" in the script give you anything interesting?
Nope:
boot_livepatch:/mnt/tools/testing/selftests/livepatch # ./test-trace.sh
+ cat
cat: -: No such file or directory
+ set_ftrace_enabled 1
+ local can_fail=0
Same version here:
GNU bash, version 4.3.48(1)-release (x86_64-suse-linux-gnu)
I'm using virtme-ng, so I'm not sure if this is related. At the same
time it works on SLE15-SP4, using the same virtme-ng, but with a
different bash:
GNU bash, version 4.4.23(1)-release (x86_64-suse-linux-gnu)
So I was blaming bash for this issue...
>
> Miroslav
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-02-26 14:34 ` Marcos Paulo de Souza
@ 2026-02-27 14:28 ` Marcos Paulo de Souza
0 siblings, 0 replies; 14+ messages in thread
From: Marcos Paulo de Souza @ 2026-02-27 14:28 UTC (permalink / raw)
To: Miroslav Benes
Cc: Joe Lawrence, Josh Poimboeuf, Jiri Kosina, Petr Mladek,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
On Thu, 2026-02-26 at 11:34 -0300, Marcos Paulo de Souza wrote:
> On Thu, 2026-02-26 at 13:40 +0100, Miroslav Benes wrote:
> > Hi,
> >
> > On Mon, 23 Feb 2026, Marcos Paulo de Souza wrote:
> >
> > > On Mon, 2026-02-23 at 10:42 -0500, Joe Lawrence wrote:
> > > > On Fri, Feb 20, 2026 at 11:12:34AM -0300, Marcos Paulo de Souza
> > > > wrote:
> > > > > When running current selftests on older distributions like
> > > > > SLE12-
> > > > > SP5 that
> > > > > contains an older bash trips over heredoc. Convert it to
> > > > > plain
> > > > > echo
> > > > > calls, which ends up with the same result.
> > > > >
> > > >
> > > > Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
> > >
> > > Thanks for the review Joe!
> > >
> > > >
> > > > Just curious, what's the bash/heredoc issue? All I could find
> > > > via
> > > > google search was perhaps something to do with the temporary
> > > > file
> > > > implementation under the hood.
> > >
> > > # ./test-ftrace.sh
> > > cat: -: No such file or directory
> > > TEST: livepatch interaction with ftrace_enabled sysctl ...
> > > ^CQEMU:
> > > Terminated
> >
> > I cannot reproduce it locally on SLE12-SP5. The patched test-
> > ftrace.sh
> > runs smoothly without 2/2.
> >
> > linux:~/linux/tools/testing/selftests/livepatch # ./test-ftrace.sh
> > TEST: livepatch interaction with ftrace_enabled sysctl ... ok
> > TEST: trace livepatched function and check that the live patch
> > remains in effect ... ok
> > TEST: livepatch a traced function and check that the live patch
> > remains in effect ... ok
> >
> > GNU bash, version 4.3.48(1)-release (x86_64-suse-linux-gnu)
> >
> > Does "set -x" in the script give you anything interesting?
>
> Nope:
>
> boot_livepatch:/mnt/tools/testing/selftests/livepatch # ./test-
> trace.sh
> + cat
> cat: -: No such file or directory
> + set_ftrace_enabled 1
> + local can_fail=0
>
>
> Same version here:
> GNU bash, version 4.3.48(1)-release (x86_64-suse-linux-gnu)
>
> I'm using virtme-ng, so I'm not sure if this is related. At the same
> time it works on SLE15-SP4, using the same virtme-ng, but with a
> different bash:
> GNU bash, version 4.4.23(1)-release (x86_64-suse-linux-gnu)
>
> So I was blaming bash for this issue...
This patch can be skipped. For the record, I discovered that it only
happens when vng is called using --rw, making it to fail on older bash
since it doesn't create overlays for /tmp. If the overlay is added the
issue is gone.
So, this patch can be skipped. Thanks Miroslav for testing!
>
> >
> > Miroslav
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function
2026-02-20 14:12 ` [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function Marcos Paulo de Souza
2026-02-23 15:39 ` Joe Lawrence
2026-02-26 12:14 ` Miroslav Benes
@ 2026-03-06 13:45 ` Petr Mladek
2 siblings, 0 replies; 14+ messages in thread
From: Petr Mladek @ 2026-03-06 13:45 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Joe Lawrence,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
On Fri 2026-02-20 11:12:33, Marcos Paulo de Souza wrote:
> This is basically the inverse case of commit 474eecc882ae
> ("selftests: livepatch: test if ftrace can trace a livepatched function")
> but ensuring that livepatch would work on a traced function.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Looks and works fine to me:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
PS: I am going to fix the typo mentioned by Joe and push this patch.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-02-20 14:12 ` [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash Marcos Paulo de Souza
2026-02-23 15:42 ` Joe Lawrence
2026-02-23 16:37 ` David Laight
@ 2026-03-06 14:30 ` Petr Mladek
2026-03-06 14:38 ` Petr Mladek
2 siblings, 1 reply; 14+ messages in thread
From: Petr Mladek @ 2026-03-06 14:30 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Joe Lawrence,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
On Fri 2026-02-20 11:12:34, Marcos Paulo de Souza wrote:
> When running current selftests on older distributions like SLE12-SP5 that
> contains an older bash trips over heredoc. Convert it to plain echo
> calls, which ends up with the same result.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
JFYI, the patch has been committed into livepatch.git,
branch for-7.1/ftrace-test.
I have fixed the typo reported by Joe, see
https://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git/commit/?h=for-7.1/ftrace-test&id=920e5001f4beb38685d5b8cac061cb1d2760eeab
Best Regards,
Petr
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash
2026-03-06 14:30 ` Petr Mladek
@ 2026-03-06 14:38 ` Petr Mladek
0 siblings, 0 replies; 14+ messages in thread
From: Petr Mladek @ 2026-03-06 14:38 UTC (permalink / raw)
To: Marcos Paulo de Souza
Cc: Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Joe Lawrence,
Shuah Khan, live-patching, linux-kselftest, linux-kernel
On Fri 2026-03-06 15:30:20, Petr Mladek wrote:
> On Fri 2026-02-20 11:12:34, Marcos Paulo de Souza wrote:
> > When running current selftests on older distributions like SLE12-SP5 that
> > contains an older bash trips over heredoc. Convert it to plain echo
> > calls, which ends up with the same result.
> >
> > Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
>
> JFYI, the patch has been committed into livepatch.git,
> branch for-7.1/ftrace-test.
>
> I have fixed the typo reported by Joe, see
> https://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git/commit/?h=for-7.1/ftrace-test&id=920e5001f4beb38685d5b8cac061cb1d2760eeab
Grr, the above was meant for the 1st patch.
This 2nd patch was _not_ committed.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-03-06 14:38 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-20 14:12 [PATCH 0/2] kselftests: livepatch: One new test and one fix for older bash Marcos Paulo de Souza
2026-02-20 14:12 ` [PATCH 1/2] selftests: livepatch: test-ftrace: livepatch a traced function Marcos Paulo de Souza
2026-02-23 15:39 ` Joe Lawrence
2026-02-26 12:14 ` Miroslav Benes
2026-03-06 13:45 ` Petr Mladek
2026-02-20 14:12 ` [PATCH 2/2] selftests: livepatch: functions.sh: Workaround heredoc on older bash Marcos Paulo de Souza
2026-02-23 15:42 ` Joe Lawrence
2026-02-23 16:21 ` Marcos Paulo de Souza
2026-02-26 12:40 ` Miroslav Benes
2026-02-26 14:34 ` Marcos Paulo de Souza
2026-02-27 14:28 ` Marcos Paulo de Souza
2026-02-23 16:37 ` David Laight
2026-03-06 14:30 ` Petr Mladek
2026-03-06 14:38 ` Petr Mladek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox