<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/selftests/timers, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-02-08T08:57:22+00:00</updated>
<entry>
<title>selftests: timers: clocksource-switch: Adapt progress to kselftest framework</title>
<updated>2025-02-08T08:57:22+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2024-12-12T09:02:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=09d28675a8345583540908d4f2abdbd462f51a75'/>
<id>urn:sha1:09d28675a8345583540908d4f2abdbd462f51a75</id>
<content type='text'>
[ Upstream commit 8694e6a7f7dba23d3abd9f5a96f64d161704c7b1 ]

When adapting the test to the kselftest framework, a few printf() calls
indicating test progress were not updated.

Fix this by replacing these printf() calls by ksft_print_msg() calls.

Link: https://lore.kernel.org/r/7dd4b9ab6e43268846e250878ebf25ae6d3d01ce.1733994134.git.geert+renesas@glider.be
Fixes: ce7d101750ff ("selftests: timers: clocksource-switch: adapt to kselftest framework")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests:timers: posix_timers: Fix warn_unused_result in __fatal_error()</title>
<updated>2024-09-30T17:37:55+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2024-09-24T15:56:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ba872972002bd1e9ae89c397307a079e04ee289a'/>
<id>urn:sha1:ba872972002bd1e9ae89c397307a079e04ee289a</id>
<content type='text'>
__fatal_error routine doesn't check strerror_r() return value,
which results in the following compile time warning:

posix_timers.c: In function ‘__fatal_error’:
posix_timers.c:31:9: warning: ignoring return value of ‘strerror_r’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   31 |         strerror_r(errno, buf, sizeof(buf));

Fix this by adding a check for return value and error handling appropriate
for the GNU-specific strerror_r() in use in __fatal_error(). Check if
return string is null and handle accordingly.

From Linux strerror_r() manual page:

"The GNU-specific strerror_r() returns a pointer to a string containing
the error message. This may be either a pointer to a string that the
function stores in buf, or a pointer to some (immutable) static string
(in which case buf is unused). If the function stores a string in buf,
then at most buflen bytes are stored (the string may be truncated if
buflen is too small and errnum is unknown). The string always includes
a terminating null byte."

Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Acked-by: John Stultz &lt;jstultz@google.com&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'linux_kselftest-next-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest</title>
<updated>2024-09-17T14:49:56+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-09-17T14:49:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=32b72debef5ab9b8bec32fcf3c5d4a62da8a4db2'/>
<id>urn:sha1:32b72debef5ab9b8bec32fcf3c5d4a62da8a4db2</id>
<content type='text'>
Pull kselftest update from Shuah Khan:

 - test coverage for dup_fd() failure handling in unshare_fd()

 - new selftest for the acct() syscall

 - basic uprobe testcase

 - several small fixes and cleanups to existing tests

 - user and strscpy removal as they became kunit tests

 - fixes to build failures and warnings

* tag 'linux_kselftest-next-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (21 commits)
  selftests: kselftest: Use strerror() on nolibc
  selftests/timers: Remove unused NSEC_PER_SEC macro
  selftests:resctrl: Fix build failure on archs without __cpuid_count()
  selftests/ftrace: Fix eventfs ownership testcase to find mount point
  selftests: filesystems: fix warn_unused_result build warnings
  selftests:core: test coverage for dup_fd() failure handling in unshare_fd()
  selftests/ftrace: Fix test to handle both old and new kernels
  kselftest: timers: Fix const correctness
  selftests/ftrace: Add required dependency for kprobe tests
  selftests: rust: config: disable GCC_PLUGINS
  selftests: rust: config: add trailing newline
  tracing/selftests: Run the ownership test twice
  selftests/uprobes: Add a basic uprobe testcase
  selftests: harness: rename __constructor_order for clarification
  selftests: harness: remove unneeded __constructor_order_last()
  selftest: acct: Add selftest for the acct() syscall
  selftests: lib: remove strscpy test
  selftests: user: remove user suite
  kselftest: cpufreq: Add RTC wakeup alarm
  selftests/exec: Fix grammar in an error message.
  ...
</content>
</entry>
<entry>
<title>selftests/timers: Remove unused NSEC_PER_SEC macro</title>
<updated>2024-09-06T19:37:41+00:00</updated>
<author>
<name>zhang jiao</name>
<email>zhangjiao2@cmss.chinamobile.com</email>
</author>
<published>2024-09-06T02:52:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=af1ec38c6ccc31ec963ac4bcf8f6a7d8f44d210a'/>
<id>urn:sha1:af1ec38c6ccc31ec963ac4bcf8f6a7d8f44d210a</id>
<content type='text'>
By reading the code, I found the macro NSEC_PER_SEC
is never referenced in the code. Just remove it.

Signed-off-by: zhang jiao &lt;zhangjiao2@cmss.chinamobile.com&gt;
Reviewed-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Acked-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kselftest: timers: Fix const correctness</title>
<updated>2024-08-21T06:48:48+00:00</updated>
<author>
<name>Piotr Zalewski</name>
<email>pZ010001011111@proton.me</email>
</author>
<published>2024-08-19T17:58:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=99338cc1e47187c3efdd39cda2a31500d0f2305d'/>
<id>urn:sha1:99338cc1e47187c3efdd39cda2a31500d0f2305d</id>
<content type='text'>
Make timespec pointers, pointers to const in checklist function. As a
consequence, make list parameter in checklist function pointer to const
as well. Const-correctness increases readability.

Improvement was found by running cppcheck tool on the patched file as
follows:
```
cppcheck --enable=all \
	tools/testing/selftests/timers/threadtest.c \
	--suppress=missingIncludeSystem \
	--suppress=unusedFunction
```

Reviewed-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Piotr Zalewski &lt;pZ010001011111@proton.me&gt;
Acked-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/timers/posix-timers: Validate overrun after unblock</title>
<updated>2024-07-29T19:57:34+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-06-10T16:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=73339b82f86521eeadbb781d8d7e04813cbd0998'/>
<id>urn:sha1:73339b82f86521eeadbb781d8d7e04813cbd0998</id>
<content type='text'>
When a timer signal is blocked and later unblocked then one signal should
be delivered with the correct number of overruns since the timer was queued.

Validate that behaviour.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/timers/posix-timers: Validate timer_gettime()</title>
<updated>2024-07-29T19:57:34+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-06-10T16:42:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f924f868ed05d954d79db419e97ba11293110d52'/>
<id>urn:sha1:f924f868ed05d954d79db419e97ba11293110d52</id>
<content type='text'>
timer_gettime() must return the correct expiry time for interval timers
even when the timer is not armed, which is the case when a signal is
pending but blocked.

Works correctly for regular posix timers, but not for posix CPU timers.

Add a selftest to validate the fixes.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/timers/posix-timers: Validate SIGEV_NONE</title>
<updated>2024-07-29T19:57:34+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-06-10T16:42:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c2b56132bb74b6b801dcb82f57489ae1cf81a91'/>
<id>urn:sha1:2c2b56132bb74b6b801dcb82f57489ae1cf81a91</id>
<content type='text'>
Posix timers with a delivery mode of SIGEV_NONE deliver no signals but the
remaining expiry time must be readable via timer_gettime() for both one
shot and interval timers.

That's implemented correctly for regular posix timers but broken for posix
CPU timers.

Add a self test so the fixes can be verified.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/timers/posix_timers: Validate signal rules</title>
<updated>2024-07-29T19:57:34+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-06-10T16:42:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e65bb03e442751ccf1631382516dcca5b3a20122'/>
<id>urn:sha1:e65bb03e442751ccf1631382516dcca5b3a20122</id>
<content type='text'>
Add a test case to validate correct behaviour vs. timer reprogramming and
deletion.

The handling of queued signals in case of timer reprogramming or deletion
is inconsistent at best.

POSIX does not really specify the behaviour for that:

 - "The effect of disarming or resetting a timer with pending expiration
   notifications is unspecified."

 - "The disposition of pending signals for the deleted timer is
    unspecified."

In both cases it is reasonable to expect that pending signals are
discarded. Especially in the reprogramming case it does not make sense to
account for previous overruns or to deliver a signal for a timer which
has been disarmed.

Add tests to validate that no unexpected signals are delivered. They fail
for now until the signal and posix timer code is updated.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/timers/posix_timers: Add SIG_IGN test</title>
<updated>2024-07-29T19:57:34+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-06-10T16:42:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=45c4225c3dcc7db2c0cdbf889cc7a9c72a53f742'/>
<id>urn:sha1:45c4225c3dcc7db2c0cdbf889cc7a9c72a53f742</id>
<content type='text'>
Add a test case to validate correct behaviour vs. SIG_IGN.

The posix specification states:

  "Setting a signal action to SIG_IGN for a signal that is pending shall
   cause the pending signal to be discarded, whether or not it is blocked."

The kernel implements this in the signal handling code, but due to the way
how posix timers are handling SIG_IGN for periodic timers, the behaviour
after installing a real handler again is inconsistent and suprising.

The following sequence is expected to deliver a signal:

  install_handler(SIG);
  block_signal(SIG);
  timer_create(...);	 &lt;- Should send SIG
  timer_settime(value=100ms, interval=100ms);
  sleep(1);		 &lt;- Timer expires and queues signal, timer is not rearmed
  			    as that should happen in the signal delivery path
  ignore_signal(SIG);	 &lt;- Discards queued signal
  install_handler(SIG);  &lt;- Restore handler, should rearm but does not
  sleep(1);
  unblock_signal(SIG);	 &lt;- Should deliver one signal with overrun count
  			    set in siginfo

This fails because nothing rearms the timer when the signal handler is
restored. Add a test for this case which fails until the signal and posix
timer code is fixed.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
</content>
</entry>
</feed>
