<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/selftests/breakpoints, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-11-27T22:24:31+00:00</updated>
<entry>
<title>selftests: complete kselftest include centralization</title>
<updated>2025-11-27T22:24:31+00:00</updated>
<author>
<name>Bala-Vignesh-Reddy</name>
<email>reddybalavignesh9979@gmail.com</email>
</author>
<published>2025-10-16T10:44:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e6fbd1759c9ece5044d3470f30a5e2166dc9de89'/>
<id>urn:sha1:e6fbd1759c9ece5044d3470f30a5e2166dc9de89</id>
<content type='text'>
This follow-up patch completes centralization of kselftest.h and
ksefltest_harness.h includes in remaining seltests files, replacing all
relative paths with a non-relative paths using shared -I include path in
lib.mk

Tested with gcc-13.3 and clang-18.1, and cross-compiled successfully on
riscv, arm64, x86_64 and powerpc arch.

[reddybalavignesh9979@gmail.com: add selftests include path for kselftest.h]
  Link: https://lkml.kernel.org/r/20251017090201.317521-1-reddybalavignesh9979@gmail.com
Link: https://lkml.kernel.org/r/20251016104409.68985-1-reddybalavignesh9979@gmail.com
Signed-off-by: Bala-Vignesh-Reddy &lt;reddybalavignesh9979@gmail.com&gt;
Suggested-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: https://lore.kernel.org/lkml/20250820143954.33d95635e504e94df01930d0@linux-foundation.org/
Reviewed-by: Wei Yang &lt;richard.weiyang@gmail.com&gt;
Cc: David Hildenbrand &lt;david@redhat.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Günther Noack &lt;gnoack@google.com&gt;
Cc: Jakub Kacinski &lt;kuba@kernel.org&gt;
Cc: Liam Howlett &lt;liam.howlett@oracle.com&gt;
Cc: Lorenzo Stoakes &lt;lorenzo.stoakes@oracle.com&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Mickael Salaun &lt;mic@digikod.net&gt;
Cc: Ming Lei &lt;ming.lei@redhat.com&gt;
Cc: Paolo Abeni &lt;pabeni@redhat.com&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Simon Horman &lt;horms@kernel.org&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: breakpoints: use suspend_stats to reliably check suspend success</title>
<updated>2025-07-10T20:21:30+00:00</updated>
<author>
<name>Moon Hee Lee</name>
<email>moonhee.lee.ca@gmail.com</email>
</author>
<published>2025-06-26T19:16:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=07b7c2b4eca3f83ce9cd5ee3fa1c7c001d721c69'/>
<id>urn:sha1:07b7c2b4eca3f83ce9cd5ee3fa1c7c001d721c69</id>
<content type='text'>
The step_after_suspend_test verifies that the system successfully
suspended and resumed by setting a timerfd and checking whether the
timer fully expired. However, this method is unreliable due to timing
races.

In practice, the system may take time to enter suspend, during which the
timer may expire just before or during the transition. As a result,
the remaining time after resume may show non-zero nanoseconds, even if
suspend/resume completed successfully. This leads to false test failures.

Replace the timer-based check with a read from
/sys/power/suspend_stats/success. This counter is incremented only
after a full suspend/resume cycle, providing a reliable and race-free
indicator.

Also remove the unused file descriptor for /sys/power/state, which
remained after switching to a system() call to trigger suspend [1].

[1] https://lore.kernel.org/all/20240930224025.2858767-1-yifei.l.liu@oracle.com/

Link: https://lore.kernel.org/r/20250626191626.36794-1-moonhee.lee.ca@gmail.com
Fixes: c66be905cda2 ("selftests: breakpoints: use remaining time to check if suspend succeed")
Signed-off-by: Moon Hee Lee &lt;moonhee.lee.ca@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: breakpoints: use remaining time to check if suspend succeed</title>
<updated>2024-10-02T20:37:30+00:00</updated>
<author>
<name>Yifei Liu</name>
<email>yifei.l.liu@oracle.com</email>
</author>
<published>2024-09-30T22:40:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c66be905cda24fb782b91053b196bd2e966f95b7'/>
<id>urn:sha1:c66be905cda24fb782b91053b196bd2e966f95b7</id>
<content type='text'>
step_after_suspend_test fails with device busy error while
writing to /sys/power/state to start suspend. The test believes
it failed to enter suspend state with

$ sudo ./step_after_suspend_test
TAP version 13
Bail out! Failed to enter Suspend state

However, in the kernel message, I indeed see the system get
suspended and then wake up later.

[611172.033108] PM: suspend entry (s2idle)
[611172.044940] Filesystems sync: 0.006 seconds
[611172.052254] Freezing user space processes
[611172.059319] Freezing user space processes completed (elapsed 0.001 seconds)
[611172.067920] OOM killer disabled.
[611172.072465] Freezing remaining freezable tasks
[611172.080332] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[611172.089724] printk: Suspending console(s) (use no_console_suspend to debug)
[611172.117126] serial 00:03: disabled
some other hardware get reconnected
[611203.136277] OOM killer enabled.
[611203.140637] Restarting tasks ...
[611203.141135] usb 1-8.1: USB disconnect, device number 7
[611203.141755] done.
[611203.155268] random: crng reseeded on system resumption
[611203.162059] PM: suspend exit

After investigation, I noticed that for the code block
if (write(power_state_fd, "mem", strlen("mem")) != strlen("mem"))
	ksft_exit_fail_msg("Failed to enter Suspend state\n");

The write will return -1 and errno is set to 16 (device busy).
It should be caused by the write function is not successfully returned
before the system suspend and the return value get messed when waking up.
As a result, It may be better to check the time passed of those few
instructions to determine whether the suspend is executed correctly for
it is pretty hard to execute those few lines for 5 seconds.

The timer to wake up the system is set to expire after 5 seconds and
no re-arm. If the timer remaining time is 0 second and 0 nano secomd,
it means the timer expired and wake the system up. Otherwise, the system
could be considered to enter the suspend state failed if there is any
remaining time.

After appling this patch, the test would not fail for it believes the
system does not go to suspend by mistake. It now could continue to the
rest part of the test after suspend.

Fixes: bfd092b8c272 ("selftests: breakpoint: add step_after_suspend_test")
Reported-by: Sinadin Shan &lt;sinadin.shan@oracle.com&gt;
Signed-off-by: Yifei Liu &lt;yifei.l.liu@oracle.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/breakpoints:Remove unused variable</title>
<updated>2024-07-11T17:23:55+00:00</updated>
<author>
<name>Zhu Jun</name>
<email>zhujun2@cmss.chinamobile.com</email>
</author>
<published>2024-07-10T02:11:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e23b1e6a2b9c88c2a69c43f5e525fafec6d6bba0'/>
<id>urn:sha1:e23b1e6a2b9c88c2a69c43f5e525fafec6d6bba0</id>
<content type='text'>
This variable is never referenced in the code, just remove them
that this problem was discovered by reading the code

Signed-off-by: Zhu Jun &lt;zhujun2@cmss.chinamobile.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/breakpoints: Fix format specifier in ksft_print_msg in step_after_suspend_test.c</title>
<updated>2023-11-30T21:32:34+00:00</updated>
<author>
<name>angquan yu</name>
<email>angquan21@gmail.com</email>
</author>
<published>2023-11-28T21:48:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5e551899788b0731761052f21febdfef668e511f'/>
<id>urn:sha1:5e551899788b0731761052f21febdfef668e511f</id>
<content type='text'>
In the function 'tools/testing/selftests/breakpoints/run_test' within
step_after_suspend_test.c, the ksft_print_msg function call incorrectly
used '$s' as a format specifier. This commit corrects this typo to use the
proper '%s' format specifier, ensuring the error message from
waitpid() is correctly displayed.

The issue manifested as a compilation warning (too many arguments
for format [-Wformat-extra-args]), potentially obscuring actual
runtime errors and complicating debugging processes.

This fix enhances the clarity of error messages during test failures
and ensures compliance with standard C format string conventions.

Signed-off-by: angquan yu &lt;angquan21@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests:breakpoints: Fix Format String Warning in breakpoint_test</title>
<updated>2023-11-30T21:32:28+00:00</updated>
<author>
<name>angquan yu</name>
<email>angquan21@gmail.com</email>
</author>
<published>2023-11-29T03:57:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1c0b9ef26e5e46fd5c2df9e7f9686e786723f53'/>
<id>urn:sha1:e1c0b9ef26e5e46fd5c2df9e7f9686e786723f53</id>
<content type='text'>
This commit resolves a compiler warning regardingthe
use of non-literal format strings in breakpoint_test.c.

The functions `ksft_test_result_pass` and `ksft_test_result_fail`
were previously called with a variable `msg` directly, which could
potentially lead to format string vulnerabilities.

Changes made:
- Modified the calls to `ksft_test_result_pass` and `ksft_test_result_fail`
by adding a "%s" format specifier. This explicitly declares `msg` as a
string argument, adhering to safer coding practices and resolving
the compiler warning.

This change does not affect the functional behavior of the code but ensures
better code safety and compliance with recommended C programming standards.

The previous warning is "breakpoint_test.c:287:17:
warning: format not a string literal and no format arguments
[-Wformat-security]
  287 |                 ksft_test_result_pass(msg);
      |                 ^~~~~~~~~~~~~~~~~~~~~
breakpoint_test.c:289:17: warning: format not a string literal
and no format arguments [-Wformat-security]
  289 |                 ksft_test_result_fail(msg);
      |    "

Signed-off-by: angquan yu &lt;angquan21@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: breakpoints: Use correct error messages in breakpoint_test_arm64.c</title>
<updated>2021-02-09T00:04:41+00:00</updated>
<author>
<name>Tiezhu Yang</name>
<email>yangtiezhu@loongson.cn</email>
</author>
<published>2021-02-05T06:33:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b1cd3d82a964921a6828588fb52a3502acc7d0ea'/>
<id>urn:sha1:b1cd3d82a964921a6828588fb52a3502acc7d0ea</id>
<content type='text'>
When call ptrace(PTRACE_CONT, ...) failed, use correct error messages.

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: breakpoints: do not use ksft_exit_skip after ksft_set_plan</title>
<updated>2020-07-06T21:47:48+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2020-06-23T00:15:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f000a39c27cc5792f7ac0e8bf2a6cae40de39807'/>
<id>urn:sha1:f000a39c27cc5792f7ac0e8bf2a6cae40de39807</id>
<content type='text'>
Calling ksft_exit_skip after ksft_set_plan results in executing fewer tests
than planned.  Use ksft_test_result_skip for the individual tests.
The call in suspend() is fine, but ksft_set_plan should be after it.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: breakpoints: fix computation of test plan</title>
<updated>2020-07-06T21:47:24+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2020-06-23T00:15:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ce32659b3673767cd92c4919d4000aa0dc056c1c'/>
<id>urn:sha1:ce32659b3673767cd92c4919d4000aa0dc056c1c</id>
<content type='text'>
The computation of the test plan uses the available_cpus bitset
before calling sched_getaffinity to fill it in.  The resulting
plan is bogus, fix it.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>.gitignore: add SPDX License Identifier</title>
<updated>2020-03-25T10:50:48+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-03-03T13:35:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d198b34f3855eee2571dda03eea75a09c7c31480'/>
<id>urn:sha1:d198b34f3855eee2571dda03eea75a09c7c31480</id>
<content type='text'>
Add SPDX License Identifier to all .gitignore files.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
