On slower machines, startup can take some time,
set last values to current [us]time before actual test.

This caused test to fail, because first delta contained
time spent by test starting up:
getrusage04    0  TINFO  :  utime:         999us; stime:        6998us
getrusage04    0  TINFO  :  utime:         999us; stime:        6998us
getrusage04    1  TFAIL  :  stime increased > 1000us: delta = 6998us

Signed-off-by: Jan Stancek <[email protected]>
---
 testcases/kernel/syscalls/getrusage/getrusage04.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/testcases/kernel/syscalls/getrusage/getrusage04.c b/testcases/kernel/syscalls/getrusage/getrusage04.c
index e142d22..9801192 100644
--- a/testcases/kernel/syscalls/getrusage/getrusage04.c
+++ b/testcases/kernel/syscalls/getrusage/getrusage04.c
@@ -100,10 +100,12 @@ int main(int argc, char *argv[])
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 		Tst_count = 0; i = 0;
-		ulast = 0, slast = 0;
 		SAFE_GETRUSAGE(cleanup, RUSAGE_THREAD, &usage);
 		tst_resm(TINFO, "utime:%12luus; stime:%12luus",
 			usage.ru_utime.tv_usec, usage.ru_stime.tv_usec);
+		ulast = usage.ru_utime.tv_usec;
+		slast = usage.ru_stime.tv_usec;
+
 		while (i < RECORD_MAX) {
 			SAFE_GETRUSAGE(cleanup, RUSAGE_THREAD, &usage);
 			udelta = usage.ru_utime.tv_usec - ulast;

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to