Skip to contentSkip to conversation

clock_getres/clock_getres01.c: Add CLOCK_MONOTONIC_RAW test

PATCH In review Zeng Linggang 2 participants 2 messages Oct 31, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clock_getres/clock_getres01.c: Add CLOCK_MONOTONIC_RAW test

Add CLOCK_MONOTONIC_RAW test in clock_getres01.c for clock_getres(2)

---
 testcases/kernel/syscalls/clock_getres/clock_getres01.c | 6 ++++++
 1 file changed, 6 insertions(+)
testcases/kernel/syscalls/clock_getres/clock_getres01.c +6 -0
index 0fb5df4..c73b0ce 100644
@@ -188,6 +188,12 @@ static struct test_case tcase[] = {
 	 .ret = 0,
 	 .err = 0,
 	 },
+	{
+	 .clk_id = CLOCK_MONOTONIC_RAW,
+	 .ttype = NORMAL,
+	 .ret = 0,
+	 .err = 0,
+	 },
 };
 
 #define MEM_LENGTH	      (4 * 1024 * 1024)

-- 1.8.2.1

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that developers love is also attractive to malware creators. Download this white paper to learn more about secure code signing practices that can help keep Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

Hi!

Quoted 12 lines

Add CLOCK_MONOTONIC_RAW test in clock_getres01.c for clock_getres(2)

---
 testcases/kernel/syscalls/clock_getres/clock_getres01.c | 6 ++++++
 1 file changed, 6 insertions(+)
testcases/kernel/syscalls/clock_getres/clock_getres01.c +0 -0
index 0fb5df4..c73b0ce 100644

testcases/kernel/syscalls/clock_getres/clock_getres01.c static struct test_case tcase[] = { · line 197

Quoted 10 lines
testcases/kernel/syscalls/clock_getres/clock_getres01.c +6 -0
@@ -188,6 +188,12 @@ static struct test_case tcase[] = {
 	 .ret = 0,
 	 .err = 0,
 	 },
+	{
+	 .clk_id = CLOCK_MONOTONIC_RAW,
+	 .ttype = NORMAL,
+	 .ret = 0,
+	 .err = 0,
+	 },
 };

This will fail the testcase on systems where CLOCK_MONOTONIC_RAW is not implemented (older than 2.6.28). The kernel will return EINVAL in this case because the clock id is not known.

Also the testcase is messy and not ported to the LTP API. Can you please fix that? (in separate patch)

And when you are at it there more timers to add (CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME) see latest man page for clock_getres.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list