From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 22 18:27:13 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB49416A51C for ; Tue, 22 Jan 2008 18:27:13 +0000 (UTC) (envelope-from stefan.lambrev@moneybookers.com) Received: from blah.sun-fish.com (blah.sun-fish.com [217.18.249.150]) by mx1.freebsd.org (Postfix) with ESMTP id 61D4F13C461 for ; Tue, 22 Jan 2008 18:27:13 +0000 (UTC) (envelope-from stefan.lambrev@moneybookers.com) Received: by blah.sun-fish.com (Postfix, from userid 1002) id BD5AB1B10EFF; Tue, 22 Jan 2008 19:27:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on blah.cmotd.com X-Spam-Level: X-Spam-Status: No, score=-10.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 Received: from hater.haters.org (unknown [192.168.25.10]) by blah.sun-fish.com (Postfix) with ESMTP id 7BD121B10EBB; Tue, 22 Jan 2008 19:27:08 +0100 (CET) Message-ID: <4796357B.9020508@moneybookers.com> Date: Tue, 22 Jan 2008 20:27:07 +0200 From: Stefan Lambrev User-Agent: Thunderbird 2.0.0.9 (X11/20071120) MIME-Version: 1.0 To: Kris Kennaway References: <4795CC13.7080601@moneybookers.com> <868x2i3v8d.fsf@ds4.des.no> <864pd63v2h.fsf@ds4.des.no> <4795FE54.9090606@moneybookers.com> <86lk6i0vzk.fsf@ds4.des.no> <479605E2.6070709@moneybookers.com> <479621BE.2060907@FreeBSD.org> In-Reply-To: <479621BE.2060907@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV 0.91.2/5521/Tue Jan 22 15:55:56 2008 on blah.cmotd.com X-Virus-Status: Clean Cc: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= , freebsd-hackers@FreeBSD.org Subject: Re: gettimeofday() in hping X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2008 18:27:13 -0000 Greetings, Kris Kennaway wrote: > Stefan Lambrev wrote: >> Hi, >> >> Dag-Erling Sm=C3=B8rgrav wrote: >>> Stefan Lambrev writes: >>> =20 >>>> I tested all different combination. The performance change is almost= >>>> invisible (100-200KB/s), and can't be compared with the performance >>>> boost that TSC gain over ACPI-fast timecounter. Unfortunately TSC >>>> doesn't play nice with power saving modes. >>>> =20 >>> >>> This will vary greatly from machine to machine, depending on the exac= t >>> hardware and the ACPI BIOS. >>> >>> More modern machines have an HPET timer which is supposedly faster th= an >>> ACPI yet more reliable than TSC. >>> >>> DES >>> =20 >> I do not have HEPT on the servers that I test, but simple test on my=20 >> laptop shows >> that hping can generate with ACPI-fast ~4MB/s traffic, 5MB/s with HPET= >> and 8MB/s with TSC. I didn't check dummy time counter. >> Also I noticed that there is a kern.timecounter.tc.XXX.quality (read=20 >> only). >> Can this be used to reduce quality and speed up performance? > > No, they are meaningless values only used to rank the time counters=20 > and choose one at boot. > > You should use hwpmc to verify where the application is really=20 > spending time, since gettimeofday doesn't seem to account for it all. pmc: Unknown Intel CPU. module_register_init: MOD_LOAD (hwpmc, 0xffffffff8029906d,=20 0xffffffff8054c500) error 78 What was the other way to do this profiling? Can ktrace help? Here is sample of kdump -R: 7501 hping 0.000013 RET sendto 40/0x28 7501 hping 0.000019 CALL sigaction(SIGALRM,0xbfbfe8a8,0xbfbfe890) 7501 hping 0.000014 RET sigaction 0 7501 hping 0.000013 CALL setitimer(0,0xbfbfe8b4,0xbfbfe8a4) 7501 hping 0.000016 RET setitimer 0 7501 hping 0.000017 CALL gettimeofday(0xbfbfe870,0) 7501 hping 0.000022 RET gettimeofday 0 7501 hping 0.000015 CALL gettimeofday(0xbfbfe868,0) 7501 hping 0.000016 RET gettimeofday 0 7501 hping 0.000015 CALL sendto(0x3,0x28317040,0x28,0,0x8067d80,0x1= 0) 7501 hping 0.000026 GIO fd 3 wrote 40 bytes --=20 Best Wishes, Stefan Lambrev ICQ# 24134177