From owner-svn-soc-all@FreeBSD.ORG Thu Sep 18 13:27:31 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F45A536 for ; Thu, 18 Sep 2014 13:27:31 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ADB55EB for ; Thu, 18 Sep 2014 13:27:31 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IDRVRh083083 for ; Thu, 18 Sep 2014 13:27:31 GMT (envelope-from dpl@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s8IDRUo9083080 for svn-soc-all@FreeBSD.org; Thu, 18 Sep 2014 13:27:30 GMT (envelope-from dpl@FreeBSD.org) Date: Thu, 18 Sep 2014 13:27:30 GMT Message-Id: <201409181327.s8IDRUo9083080@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to dpl@FreeBSD.org using -f From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r274301 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 13:27:31 -0000 Author: dpl Date: Thu Sep 18 13:27:30 2014 New Revision: 274301 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=274301 Log: Improved benchmarking code Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw_pfil.c Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw_pfil.c Thu Sep 18 12:20:19 2014 (r274300) +++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw_pfil.c Thu Sep 18 13:27:30 2014 (r274301) @@ -138,6 +138,12 @@ diff->tv_sec = (totaltwo.tv_sec - totalone.tv_sec); diff->tv_usec = (totaltwo.tv_usec - totalone.tv_usec); + + if (diff->tv_usec < 0) + { + diff->tv_sec--; + diff->tv_usec += 1000000; + } } /* @@ -175,7 +181,7 @@ IPFW_PF_RUNLOCK(chain); #include - if (counter == 1000){ + if (counter >= 500){ gettimeofday(&third, NULL); timediff(&first, &second, &dif1); timediff(&second, &third, &dif2);