From: Zhouping Liu <zliu@redhat.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] fix the -I option and enable a larger numble to I option
Date: Mon, 24 Jan 2011 02:01:32 -0500 (EST) [thread overview]
Message-ID: <1524114322.122004.1295852492822.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <1695645262.121371.1295841776437.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
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
next parent reply other threads:[~2011-01-24 7:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1695645262.121371.1295841776437.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2011-01-24 7:01 ` Zhouping Liu [this message]
2011-01-25 2:22 ` [LTP] [PATCH] fix the -I option and enable a larger numble to I option Zhouping Liu
2011-01-26 7:32 ` Garrett Cooper
2012-02-29 9:58 ` Caspar Zhang
2012-02-29 10:15 ` Zhouping Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1524114322.122004.1295852492822.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com \
--to=zliu@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox