summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2010-10-21 17:35:08 +0000
committerrwatson <rwatson@FreeBSD.org>2010-10-21 17:35:08 +0000
commit5fd895cb369cb7497b9c23430db7ad4105c097ca (patch)
tree7917e38d5a57e151807088ac7899a81ceac70680 /tools
parent2d6ab8853a286164be8e70da0268b3599ccaa0d3 (diff)
downloadFreeBSD-src-5fd895cb369cb7497b9c23430db7ad4105c097ca.zip
FreeBSD-src-5fd895cb369cb7497b9c23430db7ad4105c097ca.tar.gz
Fix bug in recent syscall_timing change: measure the number of iterations
each loop, rather than once up front. The distinction is unimportant when doing a fix iteration count, but when using a timer, it should vary. Sponsored by: Google, Inc. MFC after: 2 weeks
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/syscall_timing/syscall_timing.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/tools/syscall_timing/syscall_timing.c b/tools/tools/syscall_timing/syscall_timing.c
index 94975a8..030e7390 100644
--- a/tools/tools/syscall_timing/syscall_timing.c
+++ b/tools/tools/syscall_timing/syscall_timing.c
@@ -671,11 +671,12 @@ main(int argc, char *argv[])
/*
* Run one warmup, then do the real thing (loops) times.
*/
- calls = the_test->t_func(iterations, the_test->t_int,
+ the_test->t_func(iterations, the_test->t_int,
the_test->t_string);
+ calls = 0;
for (k = 0; k < loops; k++) {
- the_test->t_func(iterations, the_test->t_int,
- the_test->t_string);
+ calls = the_test->t_func(iterations,
+ the_test->t_int, the_test->t_string);
timespecsub(&ts_end, &ts_start);
printf("%s\t%d\t", the_test->t_name, k);
printf("%ju.%09ju\t%d\t", (uintmax_t)ts_end.tv_sec,
OpenPOWER on IntegriCloud