public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] fix the -I option and enable a larger numble to I option
       [not found] <1695645262.121371.1295841776437.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
@ 2011-01-24  7:01 ` Zhouping Liu
  2011-01-25  2:22   ` Zhouping Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Zhouping Liu @ 2011-01-24  7:01 UTC (permalink / raw)
  To: ltp-list

Hi Garrett,
Please review.
when running a test case with setting -I options a number, it's 
useless. 
e.g  when I run testcase/kernel/mem/hugetlbfs/hugemmap/hugemmap01,
[root@dell-per805-01 hugemmap]# ./hugemmap01 -I 3600 -H /var/hugetlbfs/
hugemmap01    1  TPASS  :  call succeeded
[root@dell-per805-01 hugemmap]# 
the test returned immediately, but no running for 3600 seconds, and other test cases all 
have this problem. I found it was that the variable stop_time in lib/parse_opts.c was integer that's not 
enough large, I changed it to a larger type(long long type), then it was okay, and support a larger number.

Zhouping Liu

Signed-off-by: Zhouping Liu <zliu@redhat.com>
---
 lib/parse_opts.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/parse_opts.c b/lib/parse_opts.c
index 338cbea..f8b1743 100644
--- a/lib/parse_opts.c
+++ b/lib/parse_opts.c
@@ -706,7 +706,7 @@ usc_test_looping(counter)
 int counter;
 {
     static int first_time = 1;
-    static int stop_time = 0;	/* stop time in rtc or usecs */
+    static long long 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 */
@@ -731,7 +731,7 @@ int counter;
 
 	if (STD_LOOP_DURATION) {
 	    ct=get_current_time();
-	    stop_time=(int)((float)hertz * STD_LOOP_DURATION) + ct;
+	    stop_time = (long long)hertz * (long long)STD_LOOP_DURATION + (long long)ct;
 	}
 
 	/*
@@ -776,7 +776,7 @@ int counter;
 	keepgoing++;
     }
 
-    if (STD_LOOP_DURATION != 0.0 && get_current_time() < stop_time) {
+    if (STD_LOOP_DURATION != 0.0 && (long long)get_current_time() < stop_time) {
 	keepgoing++;
     }
 
@@ -896,4 +896,4 @@ char **argv;
     exit(0);
 }
 
-#endif /* UNIT_TEST */
\ No newline at end of file
+#endif /* UNIT_TEST */
-- 
1.7.1



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fix the -I option and enable a larger numble to I option
  2011-01-24  7:01 ` [LTP] [PATCH] fix the -I option and enable a larger numble to I option Zhouping Liu
@ 2011-01-25  2:22   ` Zhouping Liu
  2011-01-26  7:32     ` Garrett Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Zhouping Liu @ 2011-01-25  2:22 UTC (permalink / raw)
  To: ltp-list

Hi,Garrett,

could you please review the patch, and give me your comments.
any suggestions are welcome.

Thanks a lot!

----- Original Message -----
> From: "Zhouping Liu" <zliu@redhat.com>
> To: ltp-list@lists.sourceforge.net
> Sent: Monday, January 24, 2011 3:01:32 PM
> Subject: [LTP][PATCH] fix the -I option and enable a larger numble to I option
> Hi Garrett,
> Please review.
> when running a test case with setting -I options a number, it's
> useless.
> e.g when I run testcase/kernel/mem/hugetlbfs/hugemmap/hugemmap01,
> [root@dell-per805-01 hugemmap]# ./hugemmap01 -I 3600 -H
> /var/hugetlbfs/
> hugemmap01 1 TPASS : call succeeded
> [root@dell-per805-01 hugemmap]#
> the test returned immediately, but no running for 3600 seconds, and
> other test cases all
> have this problem. I found it was that the variable stop_time in
> lib/parse_opts.c was integer that's not
> enough large, I changed it to a larger type(long long type), then it
> was okay, and support a larger number.
> 
> Zhouping Liu
> 
> Signed-off-by: Zhouping Liu <zliu@redhat.com>
> ---
> lib/parse_opts.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/parse_opts.c b/lib/parse_opts.c
> index 338cbea..f8b1743 100644
> --- a/lib/parse_opts.c
> +++ b/lib/parse_opts.c
> @@ -706,7 +706,7 @@ usc_test_looping(counter)
> int counter;
> {
> static int first_time = 1;
> - static int stop_time = 0; /* stop time in rtc or usecs */
> + static long long 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 */
> @@ -731,7 +731,7 @@ int counter;
> 
> if (STD_LOOP_DURATION) {
> ct=get_current_time();
> - stop_time=(int)((float)hertz * STD_LOOP_DURATION) + ct;
> + stop_time = (long long)hertz * (long long)STD_LOOP_DURATION + (long
> long)ct;
> }
> 
> /*
> @@ -776,7 +776,7 @@ int counter;
> keepgoing++;
> }
> 
> - if (STD_LOOP_DURATION != 0.0 && get_current_time() < stop_time) {
> + if (STD_LOOP_DURATION != 0.0 && (long long)get_current_time() <
> stop_time) {
> keepgoing++;
> }
> 
> @@ -896,4 +896,4 @@ char **argv;
> exit(0);
> }
> 
> -#endif /* UNIT_TEST */
> \ No newline at end of file
> +#endif /* UNIT_TEST */
> --
> 1.7.1

-- 

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fix the -I option and enable a larger numble to I option
  2011-01-25  2:22   ` Zhouping Liu
@ 2011-01-26  7:32     ` Garrett Cooper
  2012-02-29  9:58       ` Caspar Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Garrett Cooper @ 2011-01-26  7:32 UTC (permalink / raw)
  To: Zhouping Liu; +Cc: ltp-list

On Mon, Jan 24, 2011 at 6:22 PM, Zhouping Liu <zliu@redhat.com> wrote:
> Hi,Garrett,
>
> could you please review the patch, and give me your comments.
> any suggestions are welcome.

    Wow, someone really lacked foresight when producing this API.
    Yes, there's a problem, but I disagree with your solution (in
particular because long long isn't necessarily going to remain 64-bit
in the future). I think that a fixed size type applied to all of these
affect areas would be better (uint64_t -- the POSIX defined unsigned
64-bit integer [1]).
Thanks,
-Garrett

1. http://www.opengroup.org/onlinepubs/000095399/basedefs/stdint.h.html

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fix the -I option and enable a larger numble to I option
  2011-01-26  7:32     ` Garrett Cooper
@ 2012-02-29  9:58       ` Caspar Zhang
  2012-02-29 10:15         ` Zhouping Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Caspar Zhang @ 2012-02-29  9:58 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

On 01/26/2011 03:32 PM, Garrett Cooper wrote:
> On Mon, Jan 24, 2011 at 6:22 PM, Zhouping Liu <zliu@redhat.com> wrote:
>> Hi,Garrett,
>>
>> could you please review the patch, and give me your comments.
>> any suggestions are welcome.
> 
>     Wow, someone really lacked foresight when producing this API.
>     Yes, there's a problem, but I disagree with your solution (in
> particular because long long isn't necessarily going to remain 64-bit
> in the future). I think that a fixed size type applied to all of these
> affect areas would be better (uint64_t -- the POSIX defined unsigned
> 64-bit integer [1]).
> Thanks,
> -Garrett

/me bringing up with an old topic here...

This problem comes out again (in cpuset01 test). I think we need someone
to fix it.

> 
> 1. http://www.opengroup.org/onlinepubs/000095399/basedefs/stdint.h.html

------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fix the -I option and enable a larger numble to I option
  2012-02-29  9:58       ` Caspar Zhang
@ 2012-02-29 10:15         ` Zhouping Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Zhouping Liu @ 2012-02-29 10:15 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: ltp-list

> > wrote:
> >> Hi,Garrett,
> >>
> >> could you please review the patch, and give me your comments.
> >> any suggestions are welcome.
> > 
> >     Wow, someone really lacked foresight when producing this API.
> >     Yes, there's a problem, but I disagree with your solution (in
> > particular because long long isn't necessarily going to remain
> > 64-bit
> > in the future). I think that a fixed size type applied to all of
> > these
> > affect areas would be better (uint64_t -- the POSIX defined
> > unsigned
> > 64-bit integer [1]).
> > Thanks,
> > -Garrett
> 
> /me bringing up with an old topic here...
> 
> This problem comes out again (in cpuset01 test). I think we need
> someone
> to fix it.

let me have a try again, I will make a patch later.

Thanks,
Zhouping

------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2012-02-29 10:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1695645262.121371.1295841776437.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2011-01-24  7:01 ` [LTP] [PATCH] fix the -I option and enable a larger numble to I option Zhouping Liu
2011-01-25  2:22   ` Zhouping Liu
2011-01-26  7:32     ` Garrett Cooper
2012-02-29  9:58       ` Caspar Zhang
2012-02-29 10:15         ` Zhouping Liu

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