This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] fix flightrec2.exp/stp (Re: Some test results on i386 and x86_64
Mark Wielaard wrote:
>> Perhaps, timer resolution on xen-kernel may be 10ms or more?
>
> Yes, seems it counts "slower".
>
> On my non-xen i386 machine (2.6.27.21-170.2.56.fc10.i686):
> $ stap -e 'global count=0; probe timer.ms(1) { printf("%d: %d\n",
> gettimeofday_ms(), count++); if (count > 10) exit(); }'
> 1240747341878: 0
> 1240747341879: 1
> 1240747341880: 2
> 1240747341881: 3
> 1240747341882: 4
> 1240747341883: 5
> 1240747341884: 6
> 1240747341885: 7
> 1240747341886: 8
> 1240747341887: 9
> 1240747341888: 10
>
> But on my xen enabled x86_64 machine (2.6.18-128.1.6.el5xen):
> $ stap -e 'global count=0; probe timer.ms(1) { printf("%d: %d\n",
> gettimeofday_ms(), count++); if (count > 10) exit(); }'
> 1240747430504: 0
> 1240747430504: 1
> 1240747430514: 2
> 1240747430514: 3
> 1240747430524: 4
> 1240747430524: 5
> 1240747430524: 6
> 1240747430534: 7
> 1240747430534: 8
> 1240747430544: 9
> 1240747430544: 10
So, on xen, minimum timer period may be about 5ms.
In that case, this patch will help us.
This patch updates flightrec2.exp/stp
- Use stat instead of ls for getting file contents size.
- Increase timer period from 1ms to 10ms.
(the amount of output per probe is also increased)
Thanks,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com
PR 6930: fix flightrec2.exp to handle filesize correctly
---
testsuite/systemtap.base/flightrec2.exp | 17 ++++++++---------
testsuite/systemtap.base/flightrec2.stp | 4 ++--
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/testsuite/systemtap.base/flightrec2.exp b/testsuite/systemtap.base/flightrec2.exp
index a22ef41..d4481db 100644
--- a/testsuite/systemtap.base/flightrec2.exp
+++ b/testsuite/systemtap.base/flightrec2.exp
@@ -26,13 +26,12 @@ exec sleep 4
set scnt 0
set cnt1 0
# wait for log files
-spawn ls -sk1
+eval spawn stat -c %s [glob flightlog.out.*]
expect {
-timeout 100
- -re {([0-9]+) flightlog\.out\.[0-9]+} {
+ -re {[0-9]+} {
incr cnt1;
- if {$expect_out(1,string) <= 1028} {incr scnt}
- # 1024 + 4(for inode blocks?)
+ if {$expect_out(buffer) <= 1048576 } {incr scnt}
exp_continue}
timeout { fail "$test (logfile timeout)"}
}
@@ -40,12 +39,12 @@ wait
exec sleep 3
set cnt2 0
# wait for log files
-spawn ls -sk1
+eval spawn stat -c %s [glob flightlog.out.*]
expect {
-timeout 100
- -re {([0-9]+) flightlog\.out\.[0-9]+} {
+ -re {[0-9]+} {
incr cnt2;
- if {$expect_out(1,string) <= 1028} {incr scnt}
+ if {$expect_out(buffer) <= 1048576 } {incr scnt}
exp_continue}
timeout { fail "$test (logfile timeout)"}
}
@@ -57,10 +56,10 @@ if {$cnt1 == 3 && $cnt2 == 3} {
fail "$test (log file numbers ($cnt1, $cnt2))"
}
# check logfile size
-if {$scnt == 6} {
+if {$scnt == $cnt1 + $cnt2 } {
pass "$test (log file size limitation)"
} else {
- fail "$test (log file size ($scnt))"
+ fail "$test (log file size ($scnt != $cnt1 + $cnt2))"
}
exec kill -TERM $pid
# wait for exiting...
diff --git a/testsuite/systemtap.base/flightrec2.stp b/testsuite/systemtap.base/flightrec2.stp
index 9d745f4..f42c9b8 100644
--- a/testsuite/systemtap.base/flightrec2.stp
+++ b/testsuite/systemtap.base/flightrec2.stp
@@ -1,5 +1,5 @@
-probe timer.ms(1)
+probe timer.ms(10)
{
- for (j = 0; j < 100; j++)
+ for (j = 0; j < 1000; j++)
printf("1234567890\n")
}