From owner-freebsd-x11@FreeBSD.ORG Tue Feb 26 18:30:39 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 048F81065684 for ; Tue, 26 Feb 2008 18:30:39 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9F09913C447 for ; Tue, 26 Feb 2008 18:30:38 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [202.108.54.204]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTP id 501F228452; Wed, 27 Feb 2008 02:30:37 +0800 (CST) Received: from localhost (tarsier.geekcn.org [202.108.54.204]) by tarsier.geekcn.org (Postfix) with ESMTP id 5C96AEB0F7B; Wed, 27 Feb 2008 02:30:35 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([202.108.54.204]) by localhost (mail.geekcn.org [202.108.54.204]) (amavisd-new, port 10024) with ESMTP id ImJ3dWtdzImt; Wed, 27 Feb 2008 02:30:28 +0800 (CST) Received: from charlie.delphij.net (71.5.7.139.ptr.us.xo.net [71.5.7.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id B5D47EB0F01; Wed, 27 Feb 2008 02:30:26 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=ivQxRoR6HRkBUDlRiq3mt24lHtymFNGJDO5Oom4esBZEsbQe8FRtrMXjPqttktrbs HCF6Xzmh/RiXoLaYQdwWQ== Message-ID: <47C45ABF.7000408@delphij.net> Date: Tue, 26 Feb 2008 10:30:23 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20080122) MIME-Version: 1.0 To: John E Hein References: <47C320DB.70004@delphij.net> <18371.11144.568407.26227@gromit.timing.com> <20080226100728.GU83599@server.vk2pj.dyndns.org> <18372.13307.731931.284086@gromit.timing.com> In-Reply-To: <18372.13307.731931.284086@gromit.timing.com> X-Enigmail-Version: 0.95.5 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 Reply-To: d@delphij.net 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 18:30:39 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John E Hein wrote: > 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. I think it was some delay call, gettimeofday()s is mostly happen when there is some animations, in the single Xorg process. I will try to make a patch this weekend. Last weekend I tried to modify only xproto and rebuild dbus and xorg-server, but it seems that it does not like it - with mixed gettimeofday() and clock_gettime(), the display will blank from time to time. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHxFq/i+vbBBjt66ARAl+3AKCCTYJzeXSjDetaGE+YhMqxw25DOACeKCo4 1zw0JO5vqSm3ILdEvFbKf+o= =CLVy -----END PGP SIGNATURE-----