Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] syscalls/timerfd04: incorrect CLOCK_BOOTIME end
@ 2022-08-04  0:06 Edward Liaw via ltp
  2022-08-09  5:49 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Edward Liaw via ltp @ 2022-08-04  0:06 UTC (permalink / raw)
  To: ltp; +Cc: kernel-team

The end time was hardcoded to CLOCK_MONOTONIC and needs to be changed to
the clk_id of the test case.

Signed-off-by: Edward Liaw <edliaw@google.com>
Change-Id: I28c5b7d0132bf32cae6c50faa7d300ded42cc9f7
---
 testcases/kernel/syscalls/timerfd/timerfd04.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/timerfd/timerfd04.c b/testcases/kernel/syscalls/timerfd/timerfd04.c
index 4af91d6f8..eb7f98d5b 100644
--- a/testcases/kernel/syscalls/timerfd/timerfd04.c
+++ b/testcases/kernel/syscalls/timerfd/timerfd04.c
@@ -94,9 +94,9 @@ static void verify_timerfd(unsigned int n)
 
 	SAFE_WAIT(NULL);
 
-	if (tv->clock_gettime(CLOCK_MONOTONIC, tst_ts_get(&end))) {
+	if (tv->clock_gettime(tc->clk_id, tst_ts_get(&end))) {
 		tst_res(TFAIL | TERRNO, "clock_gettime(2) failed for clock %s",
-			tst_clock_name(CLOCK_MONOTONIC));
+			tst_clock_name(tc->clk_id));
 		return;
 	}
 
-- 
2.37.1.455.g008518b4e5-goog


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH v1] syscalls/timerfd04: incorrect CLOCK_BOOTIME end
  2022-08-04  0:06 [LTP] [PATCH v1] syscalls/timerfd04: incorrect CLOCK_BOOTIME end Edward Liaw via ltp
@ 2022-08-09  5:49 ` Petr Vorel
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2022-08-09  5:49 UTC (permalink / raw)
  To: Edward Liaw; +Cc: kernel-team, ltp

Hi Edward,

> The end time was hardcoded to CLOCK_MONOTONIC and needs to be changed to
> the clk_id of the test case.

Good catch! This bug has been since ever, probably because reproducible
only on bare metal SUT (wrong clock works on VM).

Thanks, merged!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-09  5:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-04  0:06 [LTP] [PATCH v1] syscalls/timerfd04: incorrect CLOCK_BOOTIME end Edward Liaw via ltp
2022-08-09  5:49 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox