From owner-freebsd-x11@FreeBSD.ORG Tue Feb 26 15:45:18 2008 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 579171065677 for ; Tue, 26 Feb 2008 15:45:18 +0000 (UTC) (envelope-from jhein@timing.com) Received: from Daffy.timing.com (mx2.timing.com [206.168.13.218]) by mx1.freebsd.org (Postfix) with ESMTP id 29E8513C4E7 for ; Tue, 26 Feb 2008 15:45:17 +0000 (UTC) (envelope-from jhein@timing.com) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by Daffy.timing.com (8.13.1/8.13.1) with ESMTP id m1QFj74n057514; Tue, 26 Feb 2008 08:45:07 -0700 (MST) (envelope-from jhein@timing.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.14.2/8.14.2) with ESMTP id m1QFj3bh058316; Tue, 26 Feb 2008 08:45:03 -0700 (MST) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.2/8.14.2/Submit) id m1QFixWq058292; Tue, 26 Feb 2008 08:44:59 -0700 (MST) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18372.13307.731931.284086@gromit.timing.com> Date: Tue, 26 Feb 2008 08:44:59 -0700 From: John E Hein To: Peter Jeremy In-Reply-To: <20080226100728.GU83599@server.vk2pj.dyndns.org> References: <47C320DB.70004@delphij.net> <18371.11144.568407.26227@gromit.timing.com> <20080226100728.GU83599@server.vk2pj.dyndns.org> X-Mailer: VM 7.19 under Emacs 22.1.1 X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on Daffy.timing.com X-Virus-Status: Clean Cc: freebsd-x11@freebsd.org, d@delphij.net Subject: Re: Xorg vs gettimeofday() and clock_gettime() X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 15:45:18 -0000 Peter Jeremy wrote at 21:07 +1100 on Feb 26, 2008: > My guess is pointer acceleration and/or 3-button emulation. Out of > interest, I just ktrace'd my X server for 5 seconds (doing nothing in > particular) and got 318 syscalls, including 106 gettimeofday() calls. > By waving the mouse around inside a window, I get 4015 syscalls, > including 844 gettimeofday() and 1136 sigprocmask() calls in 5 > secinds. In some cases, there are consecutive gettimeofday() calls > with no other syscalls intervening. These numbers do seem somewhat > excessive. Interesting. I tried a ktrace session for about 10 seconds _without_ moving the mouse and got 71332 gettimeofday calls out of 142707 total calls and signals (all SIGALRM - 2051). After about 7 minutes with mouse movement (and typing this message), I saw 193356 gettimeofdays vs 502875 total. I (obviously) haven't looked at the code. But perhaps this is an area that could possibly be improved by more judicious use of select or kqueue and more independence of interval timing.