* [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure
@ 2026-05-27 9:59 Qiang Ma
2026-05-27 12:09 ` Marcos Paulo de Souza
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Qiang Ma @ 2026-05-27 9:59 UTC (permalink / raw)
To: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah
Cc: live-patching, linux-kselftest, linux-kernel, Qiang Ma
When executing the command
"make -C tools/testing/selftests TARGETS=livepatch run_tests",
the following error message was reported.
TEST: livepatch interaction with ftrace_enabled sysctl ... not ok
...
livepatch: sysctlo
: setting key "kernel.ftrace_enabled": Device or resource busy
livepatch: sysctl: setting key "kernel.ftrace_enabled": 设备或资源忙
...
ERROR: livepatch kselftest(s) failed
not ok 5 selftests: livepatch: test-ftrace.sh # exit=1
To fix it, set LC_ALL=C.
Signed-off-by: Qiang Ma <maqianga@uniontech.com>
---
tools/testing/selftests/livepatch/functions.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
index 8ec0cb64ad94..ecf27c1120f1 100644
--- a/tools/testing/selftests/livepatch/functions.sh
+++ b/tools/testing/selftests/livepatch/functions.sh
@@ -4,6 +4,8 @@
# Shell functions for the rest of the scripts.
+export LC_ALL=C
+
MAX_RETRIES=600
RETRY_INTERVAL=".1" # seconds
SYSFS_KERNEL_DIR="/sys/kernel"
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure
2026-05-27 9:59 [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure Qiang Ma
@ 2026-05-27 12:09 ` Marcos Paulo de Souza
2026-05-27 13:19 ` Qiang Ma
2026-05-28 11:38 ` Petr Mladek
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Marcos Paulo de Souza @ 2026-05-27 12:09 UTC (permalink / raw)
To: Qiang Ma, jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah
Cc: live-patching, linux-kselftest, linux-kernel
On Wed, 2026-05-27 at 17:59 +0800, Qiang Ma wrote:
> When executing the command
> "make -C tools/testing/selftests TARGETS=livepatch run_tests",
> the following error message was reported.
>
> TEST: livepatch interaction with ftrace_enabled sysctl ... not ok
> ...
> livepatch: sysctlo
> : setting key "kernel.ftrace_enabled": Device or resource busy
> livepatch: sysctl: setting key "kernel.ftrace_enabled": 设备或资源忙
> ...
> ERROR: livepatch kselftest(s) failed
> not ok 5 selftests: livepatch: test-ftrace.sh # exit=1
>
> To fix it, set LC_ALL=C.
Would you mind adding more context here? Can you point exactly why is
this failing inside test-ftrace.sh script?
Have you double checked if you had any previous loaded livepatches why
trying to disable/enable livepatching?
I'll test in my environment, but I'm pretty sure that it used to work
not so long ago.
>
> Signed-off-by: Qiang Ma <maqianga@uniontech.com>
> ---
> tools/testing/selftests/livepatch/functions.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/livepatch/functions.sh
> b/tools/testing/selftests/livepatch/functions.sh
> index 8ec0cb64ad94..ecf27c1120f1 100644
> --- a/tools/testing/selftests/livepatch/functions.sh
> +++ b/tools/testing/selftests/livepatch/functions.sh
> @@ -4,6 +4,8 @@
>
> # Shell functions for the rest of the scripts.
>
> +export LC_ALL=C
> +
> MAX_RETRIES=600
> RETRY_INTERVAL=".1" # seconds
> SYSFS_KERNEL_DIR="/sys/kernel"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure
2026-05-27 12:09 ` Marcos Paulo de Souza
@ 2026-05-27 13:19 ` Qiang Ma
0 siblings, 0 replies; 6+ messages in thread
From: Qiang Ma @ 2026-05-27 13:19 UTC (permalink / raw)
To: Marcos Paulo de Souza, jpoimboe, jikos, mbenes, pmladek,
joe.lawrence, shuah
Cc: live-patching, linux-kselftest, linux-kernel
在 2026/5/27 20:09, Marcos Paulo de Souza 写道:
> On Wed, 2026-05-27 at 17:59 +0800, Qiang Ma wrote:
>> When executing the command
>> "make -C tools/testing/selftests TARGETS=livepatch run_tests",
>> the following error message was reported.
>>
>> TEST: livepatch interaction with ftrace_enabled sysctl ... not ok
>> ...
>> livepatch: sysctlo
>> : setting key "kernel.ftrace_enabled": Device or resource busy
>> livepatch: sysctl: setting key "kernel.ftrace_enabled": 设备或资源忙
>> ...
>> ERROR: livepatch kselftest(s) failed
>> not ok 5 selftests: livepatch: test-ftrace.sh # exit=1
>>
>> To fix it, set LC_ALL=C.
> Would you mind adding more context here? Can you point exactly why is
> this failing inside test-ftrace.sh script?
In the check_result(), the values of result and expect are compared.
In the expect value, one part is
"livepatch: sysctl: setting key \"kernel.ftrace_enabled\": Device or
resource busy".
However, the actual value of result obtained from dmesg is
"[ 220.947876] livepatch: sysctl: 设置键 "kernel.ftrace_enabled":
设备或资源忙".
The comparison is different, so it directly enters the final 'else' branch.
Finally, the 'else' branch prints the difference between result and expect:
# --- expected
# +++ result
# @@ -16,7 +16,7 @@ livepatch: 'test_klp_livepatch': initial #
livepatch: 'test_klp_livepatch': starting patching transition
# livepatch: 'test_klp_livepatch': completing patching transition
# livepatch: 'test_klp_livepatch': patching complete
# -livepatch: sysctl: setting key "kernel.ftrace_enabled": Device or
resource busy
# +livepatch: sysctl: Set key "kernel.ftrace_enabled": Device or
resource is busy # % echo 0 >
/sys/kernel/livepatch/test_klp_livepatch/enabled
# livepatch: 'test_klp_livepatch': initializing unpatching transition
# livepatch: 'test_klp_livepatch': starting unpatching transition
>
> Have you double checked if you had any previous loaded livepatches why
> trying to disable/enable livepatching?
>
> I'll test in my environment, but I'm pretty sure that it used to work
> not so long ago.
>
>> Signed-off-by: Qiang Ma <maqianga@uniontech.com>
>> ---
>> tools/testing/selftests/livepatch/functions.sh | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/testing/selftests/livepatch/functions.sh
>> b/tools/testing/selftests/livepatch/functions.sh
>> index 8ec0cb64ad94..ecf27c1120f1 100644
>> --- a/tools/testing/selftests/livepatch/functions.sh
>> +++ b/tools/testing/selftests/livepatch/functions.sh
>> @@ -4,6 +4,8 @@
>>
>> # Shell functions for the rest of the scripts.
>>
>> +export LC_ALL=C
>> +
>> MAX_RETRIES=600
>> RETRY_INTERVAL=".1" # seconds
>> SYSFS_KERNEL_DIR="/sys/kernel"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure
2026-05-27 9:59 [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure Qiang Ma
2026-05-27 12:09 ` Marcos Paulo de Souza
@ 2026-05-28 11:38 ` Petr Mladek
2026-05-28 11:43 ` Miroslav Benes
2026-06-03 13:12 ` Petr Mladek
3 siblings, 0 replies; 6+ messages in thread
From: Petr Mladek @ 2026-05-28 11:38 UTC (permalink / raw)
To: Qiang Ma
Cc: jpoimboe, jikos, mbenes, joe.lawrence, shuah, live-patching,
linux-kselftest, linux-kernel
On Wed 2026-05-27 17:59:29, Qiang Ma wrote:
> When executing the command
> "make -C tools/testing/selftests TARGETS=livepatch run_tests",
> the following error message was reported.
>
> TEST: livepatch interaction with ftrace_enabled sysctl ... not ok
> ...
> livepatch: sysctlo
> : setting key "kernel.ftrace_enabled": Device or resource busy
> livepatch: sysctl: setting key "kernel.ftrace_enabled": 设备或资源忙
> ...
> ERROR: livepatch kselftest(s) failed
> not ok 5 selftests: livepatch: test-ftrace.sh # exit=1
>
> To fix it, set LC_ALL=C.
>
> Signed-off-by: Qiang Ma <maqianga@uniontech.com>
It looks good to me and I think that this is a rather standard thing
to do.
Acked-by: Petr Mladek <pmladek@suse.com>
I am going to give it few more days for a potential feedback.
I'll push it then unless anyone speak against.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure
2026-05-27 9:59 [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure Qiang Ma
2026-05-27 12:09 ` Marcos Paulo de Souza
2026-05-28 11:38 ` Petr Mladek
@ 2026-05-28 11:43 ` Miroslav Benes
2026-06-03 13:12 ` Petr Mladek
3 siblings, 0 replies; 6+ messages in thread
From: Miroslav Benes @ 2026-05-28 11:43 UTC (permalink / raw)
To: Qiang Ma
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
live-patching, linux-kselftest, linux-kernel
On Wed, 27 May 2026 17:59:29 +0800, Qiang Ma <maqianga@uniontech.com> wrote:
> selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure
Acked-by: Miroslav Benes <mbenes@suse.cz>
--
Miroslav
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure
2026-05-27 9:59 [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure Qiang Ma
` (2 preceding siblings ...)
2026-05-28 11:43 ` Miroslav Benes
@ 2026-06-03 13:12 ` Petr Mladek
3 siblings, 0 replies; 6+ messages in thread
From: Petr Mladek @ 2026-06-03 13:12 UTC (permalink / raw)
To: Qiang Ma
Cc: jpoimboe, jikos, mbenes, joe.lawrence, shuah, live-patching,
linux-kselftest, linux-kernel
On Wed 2026-05-27 17:59:29, Qiang Ma wrote:
> When executing the command
> "make -C tools/testing/selftests TARGETS=livepatch run_tests",
> the following error message was reported.
>
> TEST: livepatch interaction with ftrace_enabled sysctl ... not ok
> ...
> livepatch: sysctlo
> : setting key "kernel.ftrace_enabled": Device or resource busy
> livepatch: sysctl: setting key "kernel.ftrace_enabled": 设备或资源忙
> ...
> ERROR: livepatch kselftest(s) failed
> not ok 5 selftests: livepatch: test-ftrace.sh # exit=1
>
> To fix it, set LC_ALL=C.
>
> Signed-off-by: Qiang Ma <maqianga@uniontech.com>
JFYI, the patch has been committed into livepatching.git,
branch for-7.2-selftests.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-03 13:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 9:59 [PATCH] selftests: livepatch: set LC_ALL=C to fix locale-dependent test failure Qiang Ma
2026-05-27 12:09 ` Marcos Paulo de Souza
2026-05-27 13:19 ` Qiang Ma
2026-05-28 11:38 ` Petr Mladek
2026-05-28 11:43 ` Miroslav Benes
2026-06-03 13:12 ` Petr Mladek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox