Skip to contentSkip to conversation

extend the '-I' options

PATCH In review Zhouping Liu 1 participant 2 messages Nov 25, 2010 1 message not in the archive Library code

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1236809510.438331290664492921.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com

#1 lore raw

PATCH 1/1 extend the '-I' options

Hi,all
I found it just support a small value for -I option.
when I run '#./hugemmap04 -I 3600 -H /var/hugetlbfs',the test returned immediately.
the -I option details:
-I x Execute test for x seconds
And if you give a much bigger value to -I option such as 3600 or larger, you will find the -I option disabled, so I changed the lib/parse_opts.c file, and just modified the stop_time variable type from 'int' to 'double', after changed, it can support a very bigger value for -I option.
this patch is in the following :

---
lib/parse_opts.c | 6 +++---

1 files changed, 3 insertions(+), 3 deletions(-) 
lib/parse_opts.c +0 -0
index e4de709..da75df5 100644 
@@ -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++;
}

Signature · 5 lines
1.7.2.3 


-- 
Name: Zhouping Liu 

------------------------------------------------------------------------------
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

#2 lore raw
Quoted 17 lines · ----- "Zhouping Liu

From: "Zhouping Liu" <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Sent: Thursday, November 25, 2010 2:01:38 PM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
Subject: [LTP] [PATCH] extend the '-I' options

Hi,all
I found it just support a small value for -I option.
when I run '#./hugemmap04 -I 3600 -H /var/hugetlbfs',the test returned immediately.
the -I option details:
-I x Execute test for x seconds
And if you give a much bigger value to -I option such as 3600 or larger, you will find the -I option disabled, so I changed the lib/parse_opts.c file, and just modified the stop_time variable type from 'int' to 'double', after changed, it can support a very bigger value for -I option.
this patch is in the following :

Quoted 1 line

sorry,I wrote my email error, change it:

Quoted 42 lines

---
lib/parse_opts.c | 6 +++---

1 files changed, 3 insertions(+), 3 deletions(-) 
lib/parse_opts.c +1 -1
index e4de709..da75df5 100644 
@@ -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 */

lib/parse_opts.c +2 -2
@@ -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++; 
 } 
 
Signature · 5 lines
1.7.2.3 


-- 
Name: Zhouping Liu 
Signature · 5 lines
Name: Zhouping Liu 
Team: Kernel-QE 
Timezone: GMT+0800 (Asia/Shanghai) 
IRC: zliu @ #kernel-qe, #eng-china 
Cellphone: +86-187-0166-8285 

------------------------------------------------------------------------------
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