From owner-svn-src-head@FreeBSD.ORG Thu Oct 21 17:35:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 476FB106564A; Thu, 21 Oct 2010 17:35:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36F3A8FC12; Thu, 21 Oct 2010 17:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9LHZ9r7098218; Thu, 21 Oct 2010 17:35:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9LHZ9au098216; Thu, 21 Oct 2010 17:35:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201010211735.o9LHZ9au098216@svn.freebsd.org> From: Robert Watson Date: Thu, 21 Oct 2010 17:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214145 - head/tools/tools/syscall_timing X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2010 17:35:09 -0000 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,