Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Oct 2010 17:35:09 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r214145 - head/tools/tools/syscall_timing
Message-ID:  <201010211735.o9LHZ9au098216@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rwatson
Date: Thu Oct 21 17:35:08 2010
New Revision: 214145
URL: http://svn.freebsd.org/changeset/base/214145

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

Modified:
  head/tools/tools/syscall_timing/syscall_timing.c

Modified: head/tools/tools/syscall_timing/syscall_timing.c
==============================================================================
--- head/tools/tools/syscall_timing/syscall_timing.c	Thu Oct 21 17:29:32 2010	(r214144)
+++ head/tools/tools/syscall_timing/syscall_timing.c	Thu Oct 21 17:35:08 2010	(r214145)
@@ -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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010211735.o9LHZ9au098216>