> From: [email protected]
> To: "ltp-list" <[email protected]>
> Sent: Monday, November 15, 2010 9:30:40 PM GMT +08:00 Beijing / Chongqing /
> Hong Kong / Urumqi
> Subject: [LTP] maximum seconds of -I
>
> Hi, I am wondering if there is a limitation of seconds you can specify
> in standard command-line options for,
>
> -I x Execute test for x seconds
>
> I noticed that when given a value like 3600, the test returned
> immediately like,
>
> ./hugemmap04 -I 3600 -H /var/hugetlbfs
>
> Is this expected?
>
> CAI Qian
>
Hi,all
I fixed the -I options, and now it support a very large number such as
360000000000 or larger than.
--
Name: Zhouping Liu
>From 73272825b8597e1f1bbba7428d1f3f7ffd2e69b4 Mon Sep 17 00:00:00 2001
From: Zhouping Liu <[email protected]>
Date: Wed, 24 Nov 2010 14:50:01 +0800
Subject: [PATCH] Enable the '-I' options, such as
./testcases/kernel/mem/hugetlb/hugemmap/hugemmap04 -I 360000 -H /var/hugetlbfs/
Add a line in order to avoid the 'SEGBUS' error.
---
lib/parse_opts.c | 6 +++---
testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/parse_opts.c b/lib/parse_opts.c
index e4de709..da75df5 100644
--- a/lib/parse_opts.c
+++ b/lib/parse_opts.c
@@ -699,7 +699,7 @@ usc_test_looping(counter)
int counter;
{
static int first_time = 1;
- static int stop_time = 0; /* stop time in rtc or usecs */
+ static double stop_time = 0; /* stop time in rtc or usecs */
static int delay; /* delay in clocks or usecs */
int hertz=0; /* clocks per second or usecs per second */
int ct, end; /* current time, end delay time */
@@ -724,7 +724,7 @@ int counter;
if ( STD_LOOP_DURATION) {
ct=get_current_time();
- stop_time=(int)((float)hertz * STD_LOOP_DURATION) + ct;
+ stop_time = (double)hertz * (double)STD_LOOP_DURATION + (double)ct;
}
/*
@@ -769,7 +769,7 @@ int counter;
keepgoing++;
}
- if ( STD_LOOP_DURATION != 0.0 && get_current_time() < stop_time ) {
+ if ( STD_LOOP_DURATION != 0.0 && (double)get_current_time() < stop_time ) {
keepgoing++;
}
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c
index 485b465..11d0188 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c
@@ -143,7 +143,8 @@ main(int ac, char **av)
}
/* Reset Tst_count in case we are looping. */
Tst_count=0;
-
+ /* force to allocate page and change HugePages_Free */
+ write(fildes,"Write some words to the TEMPFILE\n",40);
/* Note the number of free huge pages BEFORE testing */
freepages = getfreehugepages();
beforetest = freepages;
--
1.7.2.3
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list