[Xquartz-changes] xserver: Branch 'master' - 6 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Mon Jul 26 12:01:07 PDT 2010


 configure.ac                      |    8 
 dix/enterleave.c                  |   27 +
 doc/xml/.gitignore                |    1 
 doc/xml/Makefile.am               |    2 
 doc/xml/Xserver-spec.xml          |    8 
 doc/xml/dtrace/Makefile.am        |   36 ++
 doc/xml/dtrace/Xserver-DTrace.xml |  579 ++++++++++++++++++++++++++++++++++++++
 doc/xml/xmlrules.in               |   10 
 hw/xfree86/doc/sgml/.gitignore    |    1 
 xkb/xkb.c                         |   32 +-
 10 files changed, 673 insertions(+), 31 deletions(-)

New commits:
commit 9c171d4aee695ab66e6db1ab92539557bd368cfa
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Fri Jun 25 16:52:42 2010 -0700

    Add documentation of the Xserver DTrace probes
    
    Mostly pulled together from posts to my blog and the docs posted
    at http://people.freedesktop.org/~alanc/dtrace/ and converted to
    DocBook.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Patrick E. Kane <pekane52 at gmail.com>

diff --git a/configure.ac b/configure.ac
index c61c60c..23a0f10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2183,6 +2183,7 @@ dbe/Makefile
 dix/Makefile
 doc/Makefile
 doc/xml/Makefile
+doc/xml/dtrace/Makefile
 doc/xml/xserver.ent
 fb/Makefile
 record/Makefile
diff --git a/doc/xml/Makefile.am b/doc/xml/Makefile.am
index df4833c..e66f192 100644
--- a/doc/xml/Makefile.am
+++ b/doc/xml/Makefile.am
@@ -21,6 +21,8 @@
 # DEALINGS IN THE SOFTWARE.
 #
 
+SUBDIRS = dtrace
+
 XML_FILES = Xserver-spec.xml
 
 include xmlrules.in
diff --git a/doc/xml/dtrace/Makefile.am b/doc/xml/dtrace/Makefile.am
new file mode 100644
index 0000000..0e25e5d
--- /dev/null
+++ b/doc/xml/dtrace/Makefile.am
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+XML_FILES = Xserver-DTrace.xml
+
+include ../xmlrules.in
+
+if XSERVER_DTRACE
+doc_DATA = $(BUILT_DOC_FILES)
+else
+noinst_DATA = $(BUILT_DOC_FILES)
+endif
+
+CLEANFILES = $(CLEAN_DOC_FILES)
+
+EXTRA_DIST = $(XML_FILES)
diff --git a/doc/xml/dtrace/Xserver-DTrace.xml b/doc/xml/dtrace/Xserver-DTrace.xml
new file mode 100644
index 0000000..290f0d3
--- /dev/null
+++ b/doc/xml/dtrace/Xserver-DTrace.xml
@@ -0,0 +1,579 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+ <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
+]>
+
+<article id="Xserver-DTrace">
+  <articleinfo>
+    <title>Xserver provider for DTrace</title>
+    <author>
+      <firstname>Alan</firstname><surname>Coopersmith</surname>
+      <affiliation>
+	<orgname>Oracle Corporation</orgname>
+	<orgdiv>Solaris Engineering</orgdiv>
+      </affiliation>
+    </author>
+    <releaseinfo>X.Org Xserver version &xserver.version;</releaseinfo>
+    <legalnotice>
+      <para>
+Copyright (c) 2005, 2006, 2007, 2010, Oracle and/or its affiliates.
+All rights reserved.
+      </para><para>
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+      </para><para>
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+      </para><para>
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+      </para>
+    </legalnotice>
+  </articleinfo>
+
+  <sect1 id="introduction">
+    <title>Introduction</title>
+    <para>
+      This page provides details on a
+      <ulink url="http://wikis.sun.com/display/DTrace/Statically+Defined+Tracing+for+User+Applications">statically defined user application tracing provider</ulink>
+      for the
+      <ulink url="http://hub.opensolaris.org/bin/view/Community+Group+dtrace/">DTrace</ulink>
+      facility in <productname>Solaris</productname> 10,
+      <productname>MacOS X</productname> 10.5, and later releases.  This
+      provider instruments various points in the X server, to allow
+      tracing what client applications are up to.
+    </para>
+
+    <para>
+      The provider was integrated into the X.Org git master repository
+      with Solaris 10 &amp; OpenSolaris support for the Xserver 1.4 release,
+      released in 2007 with X11R7.3.   Support for DTrace on MacOS X
+      was added in Xserver 1.7.
+    </para>
+
+    <para>
+      These probes expose the request and reply structure of the X protocol
+      between clients and the X server, so an understanding of that basic
+      nature will aid in learning how to use these probes.
+    </para>
+  </sect1>
+
+  <sect1 id="probes">
+    <title>Available probes</title>
+
+    <para>
+      Due to the way User-Defined DTrace probes work, arguments to
+      these probes all bear undistinguished names of
+      <parameter>arg0</parameter>, <parameter>arg1</parameter>,
+      <parameter>arg2</parameter>, etc.  These tables should help you
+      determine what the real data is for each of the probe arguments.
+
+    <table>
+      <title>Probes and their arguments</title>
+      <tgroup cols='7'>
+	<colspec colname="probe" colwidth="2*"/>
+	<colspec colname="desc" colwidth="3*"/>
+	<colspec colname="arg0" colwidth="1*"/>
+	<colspec colname="arg1" colwidth="1*"/>
+	<colspec colname="arg2" colwidth="1*"/>
+	<colspec colname="arg3" colwidth="1*"/>
+	<colspec colname="arg4" colwidth="1*"/>
+	<spanspec spanname="all" namest="probe" nameend="arg4"/>
+	<thead>
+	  <row>
+	    <entry>Probe name</entry>
+	    <entry>Description</entry>
+	    <entry>arg0</entry>
+	    <entry>arg1</entry>
+	    <entry>arg2</entry>
+	    <entry>arg3</entry>
+	    <entry>arg4</entry>
+	  </row>
+	</thead>
+	<tbody>
+	  <row>
+	    <entry spanname="all" class="grouphead">Request Probes</entry>
+	  </row>
+	  <row>
+	    <entry>request-start</entry>
+	    <entry>Called just before processing each client request.</entry>
+	    <entry><parameter>requestName</parameter></entry>
+	    <entry><parameter>requestCode</parameter></entry>
+	    <entry><parameter>requestLength</parameter></entry>
+	    <entry><parameter>clientId</parameter></entry>
+	    <entry><parameter>requestBuffer</parameter></entry>
+	  </row>
+	  <row>
+	    <entry>request-done</entry>
+	    <entry>Called just after processing each client request.</entry>
+	    <entry><parameter>requestName</parameter></entry>
+	    <entry><parameter>requestCode</parameter></entry>
+	    <entry><parameter>sequenceNumber</parameter></entry>
+	    <entry><parameter>clientId</parameter></entry>
+	    <entry><parameter>resultCode</parameter></entry>
+	  </row>
+	  <row>
+	    <entry spanname="all" class="grouphead">Event Probes</entry>
+	  </row>
+	  <row>
+	    <entry>send-event</entry>
+	    <entry>Called just before send each event to a client.</entry>
+	    <entry><parameter>clientId</parameter></entry>
+	    <entry><parameter>eventCode</parameter></entry>
+	    <entry><parameter>eventBuffer</parameter></entry>
+	    <entry nameend="arg4" class="unused"/>
+	  </row>
+	  <row>
+	    <entry spanname="all" class="grouphead">Client Connection Probes</entry>
+	  </row>
+	  <row>
+	    <entry>client-connect</entry>
+	    <entry>Called when a new connection is opened from a client</entry>
+	    <entry><parameter>clientId</parameter></entry>
+	    <entry><parameter>clientFD</parameter></entry>
+	    <entry nameend="arg4" class="unused"/>
+	  </row>
+	  <row>
+	    <entry>client-auth</entry>
+	    <entry>Called when client authenticates (normally just after connection opened)</entry>
+	    <entry><parameter>clientId</parameter></entry>
+	    <entry><parameter>clientAddr</parameter></entry>
+	    <entry><parameter>clientPid</parameter></entry>
+	    <entry><parameter>clientZoneId</parameter></entry>
+	    <entry nameend="arg4" class="unused"/>
+	  </row>
+	  <row>
+	    <entry>client-disconnect</entry>
+	    <entry>Called when a client connection is closed</entry>
+	    <entry><parameter>clientId</parameter></entry>
+	    <entry nameend="arg4" class="unused"/>
+	  </row>
+	  <row>
+	    <entry spanname="all" class="grouphead">Resource Allocation Probes</entry>
+	  </row>
+	  <row>
+	    <entry>resource-alloc</entry>
+	    <entry>Called when a new resource (pixmap, gc, colormap, etc.) is allocated</entry>
+	    <entry><parameter>resourceId</parameter></entry>
+	    <entry><parameter>resourceTypeId</parameter></entry>
+	    <entry><parameter>resourceValue</parameter></entry>
+	    <entry><parameter>resourceTypeName</parameter></entry>
+	    <entry nameend="arg4" class="unused"/>
+	  </row>
+	  <row>
+	    <entry>resource-free</entry>
+	    <entry>Called when a resource is freed</entry>
+	    <entry><parameter>resourceId</parameter></entry>
+	    <entry><parameter>resourceTypeId</parameter></entry>
+	    <entry><parameter>resourceValue</parameter></entry>
+	    <entry><parameter>resourceTypeName</parameter></entry>
+	    <entry nameend="arg4" class="unused"/>
+	  </row>
+	</tbody>
+      </tgroup>
+    </table>
+    </para>
+  </sect1>
+
+  <sect1 id="arguments">
+    <title>Data Available in Probe Arguments</title>
+
+    <para>
+      To access data in arguments of type <type>string</type>, you will need
+      to use <ulink url="http://wikis.sun.com/display/DTrace/Actions+and+Subroutines#ActionsandSubroutines-{{copyinstr}}"><function>copyinstr()</function></ulink>.
+      To access data buffers referenced via <type>uintptr_t</type>'s, you will
+      need to use <ulink url="http://wikis.sun.com/display/DTrace/Actions+and+Subroutines#ActionsandSubroutines-{{copyin}}"><function>copyin()</function></ulink>.
+
+    <table>
+      <title>Probe Arguments</title>
+      <tgroup cols='3'>
+	<colspec colname="arg" colwidth="2*"/>
+	<colspec colname="type" colwidth="1*"/>
+	<colspec colname="desc" colwidth="7*"/>
+	<thead>
+	  <row>
+	    <entry>Argument name</entry>
+	    <entry>Type</entry>
+	    <entry>Description</entry>
+	  </row>
+	</thead>
+	<tbody>
+	  <row>
+	    <entry><parameter>clientAddr</parameter></entry>
+	    <entry><type>string</type></entry>
+	    <entry>String representing address client connected from</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>clientFD</parameter></entry>
+	    <entry><type>int</type></entry>
+	    <entry>X server's file descriptor for server side of each connection</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>clientId</parameter></entry>
+	    <entry><type>int</type></entry>
+	    <entry>Unique integer identifier for each connection to the
+	      X server</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>clientPid</parameter></entry>
+	    <entry><type>pid_t</type></entry>
+	    <entry>Process id of client, if connection is local
+	      (from <function>getpeerucred()</function>)</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>clientZoneId</parameter></entry>
+	    <entry><type>zoneid_t</type></entry>
+	    <entry>Solaris: Zone id of client, if connection is local
+	      (from <function>getpeerucred()</function>)</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>eventBuffer</parameter></entry>
+	    <entry><type>uintptr_t</type></entry>
+	    <entry>Pointer to buffer containing X event - decode using
+	      structures in
+	      &lt;<ulink url="http://cgit.freedesktop.org/xorg/proto/xproto/tree/Xproto.h"><filename class="headerfile">X11/Xproto.h</filename></ulink>&gt;
+	      and similar headers for each extension</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>eventCode</parameter></entry>
+	    <entry><type>uint8_t</type></entry>
+	    <entry>Event number of X event</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>resourceId</parameter></entry>
+	    <entry><type>uint32_t</type></entry>
+	    <entry>X resource id (XID)</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>resourceTypeId</parameter></entry>
+	    <entry><type>uint32_t</type></entry>
+	    <entry>Resource type id</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>resourceTypeName</parameter></entry>
+	    <entry><type>string</type></entry>
+	    <entry>String representing X resource type
+		(<literal>"PIXMAP"</literal>, etc.)</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>resourceValue</parameter></entry>
+	    <entry><type>uintptr_t</type></entry>
+	    <entry>Pointer to data for X resource</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>resultCode</parameter></entry>
+	    <entry><type>int</type></entry>
+	    <entry>Integer code representing result status of request</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>requestBuffer</parameter></entry>
+	    <entry><type>uintptr_t</type></entry>
+	    <entry>Pointer to buffer containing X request - decode using
+	      structures in
+	      &lt;<ulink url="http://cgit.freedesktop.org/xorg/proto/xproto/tree/Xproto.h"><filename class="headerfile">X11/Xproto.h</filename></ulink>&gt;
+	      and similar headers for each extension</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>requestCode</parameter></entry>
+	    <entry><type>uint8_t</type></entry>
+	    <entry>Request number of X request or Extension</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>requestName</parameter></entry>
+	    <entry><type>string</type></entry>
+	    <entry>Name of X request or Extension</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>requestLength</parameter></entry>
+	    <entry><type>uint16_t</type></entry>
+	    <entry>Length of X request</entry>
+	  </row>
+	  <row>
+	    <entry><parameter>sequenceNumber</parameter></entry>
+	    <entry><type>uint32_t</type></entry>
+	    <entry>Number of X request in in this connection</entry>
+	  </row>
+	</tbody>
+      </tgroup>
+    </table>
+    </para>
+  </sect1>
+
+  <sect1 id="examples">
+    <title>Examples</title>
+
+    <example>
+      <title>Counting requests by request name</title>
+
+      <para>
+	This script simply increments a counter for each different request
+	made, and when you exit the script (such as by hitting
+	<keycombo action='simul'><keycap>Control</keycap><keycap>C</keycap>
+	</keycombo>) prints the counts.
+
+	<programlisting>
+#!/usr/sbin/dtrace -s
+
+Xserver*:::request-start
+{
+    @counts[copyinstr(arg0)] = count();
+}
+	</programlisting>
+
+	The output from a short run may appear as:
+	<screen>
+  QueryPointer                                                      1
+  CreatePixmap                                                      2
+  FreePixmap                                                        2
+  PutImage                                                          2
+  ChangeGC                                                         10
+  CopyArea                                                         10
+  CreateGC                                                         14
+  FreeGC                                                           14
+  RENDER                                                           28
+  SetClipRectangles                                                40
+	</screen>
+      </para>
+
+      <para>
+	This can be rewritten slightly to cache the string containing the name
+	of the request since it will be reused many times, instead of copying
+	it over and over from the kernel:
+
+	<programlisting>
+#!/usr/sbin/dtrace -s
+
+string Xrequest[uintptr_t];
+
+Xserver*:::request-start
+/Xrequest[arg0] == ""/
+{
+    Xrequest[arg0] = copyinstr(arg0);
+}
+
+Xserver*:::request-start
+{
+    @counts[Xrequest[arg0]] = count();
+}
+	</programlisting>
+      </para>
+    </example>
+
+    <example>
+      <title>Get average CPU time per request</title>
+
+      <para>This script records the CPU time used between the probes at
+	the start and end of each request and aggregates it per request type.
+
+	<programlisting>
+#!/usr/sbin/dtrace -s
+
+Xserver*:::request-start
+{
+    reqstart = vtimestamp;
+}
+
+Xserver*:::request-done
+{
+    @times[copyinstr(arg0)] = avg(vtimestamp - reqstart);
+}
+	</programlisting>
+
+	The output from a sample run might look like:
+
+	<screen>
+  ChangeGC                                                        889
+  MapWindow                                                       907
+  SetClipRectangles                                              1319
+  PolyPoint                                                      1413
+  PolySegment                                                    1434
+  PolyRectangle                                                  1828
+  FreeCursor                                                     1895
+  FreeGC                                                         1950
+  CreateGC                                                       2244
+  FreePixmap                                                     2246
+  GetInputFocus                                                  2249
+  TranslateCoords                                                8508
+  QueryTree                                                      8846
+  GetGeometry                                                    9948
+  CreatePixmap                                                  12111
+  AllowEvents                                                   14090
+  GrabServer                                                    14791
+  MIT-SCREEN-SAVER                                              16747
+  ConfigureWindow                                               22917
+  SetInputFocus                                                 28521
+  PutImage                                                     240841
+
+	</screen>
+      </para>
+    </example>
+
+    <example>
+      <title>Monitoring clients that connect and disconnect</title>
+
+      <para>
+	This script simply prints information about each client that
+	connects or disconnects from the server while it is running.
+	Since the provider is specified as <code>Xserver$1</code> instead
+	of <code>Xserver*</code> like previous examples, it won't monitor
+	all Xserver processes running on the machine, but instead expects
+	the process id of the X server to monitor to be specified as the
+	argument to the script.
+
+	<programlisting>
+#!/usr/sbin/dtrace -s
+
+Xserver$1:::client-connect
+{
+	printf("** Client Connect: id %d\n", arg0);
+}
+
+Xserver$1:::client-auth
+{
+	printf("** Client auth'ed: id %d =&gt; %s pid %d\n",
+		arg0, copyinstr(arg1), arg2);
+}
+
+Xserver$1:::client-disconnect
+{
+	printf("** Client Disconnect: id %d\n", arg0);
+}
+	</programlisting>
+
+	A sample run:
+
+	<screen>
+<prompt>#</prompt> <userinput>./foo.d 5790</userinput>
+<computeroutput>dtrace: script './foo.d' matched 4 probes
+CPU     ID                    FUNCTION:NAME
+  0  15774 CloseDownClient:client-disconnect ** Client Disconnect: id 65
+
+  2  15774 CloseDownClient:client-disconnect ** Client Disconnect: id 64
+
+  0  15773 EstablishNewConnections:client-connect ** Client Connect: id 64
+
+  0  15772            AuthAudit:client-auth ** Client auth'ed: id 64 =&gt; local host pid 2034
+
+  0  15773 EstablishNewConnections:client-connect ** Client Connect: id 65
+
+  0  15772            AuthAudit:client-auth ** Client auth'ed: id 65 =&gt; local host pid 2034
+
+  0  15774 CloseDownClient:client-disconnect ** Client Disconnect: id 64
+	  </computeroutput>
+	</screen>
+
+      </para>
+    </example>
+
+    <example>
+      <title>Monitoring clients creating Pixmaps</title>
+
+      <para>
+	This script can be used to determine which clients are creating
+	pixmaps in the X server, printing information about each client
+	as it connects to help trace it back to the program on the other
+	end of the X connection.
+
+	<programlisting>
+#!/usr/sbin/dtrace -qs
+
+string Xrequest[uintptr_t];
+string Xrestype[uintptr_t];
+
+Xserver$1:::request-start
+/Xrequest[arg0] == ""/
+{
+	Xrequest[arg0] = copyinstr(arg0);
+}
+
+Xserver$1:::resource-alloc
+/arg3 != 0 &amp;&amp; Xrestype[arg3] == ""/
+{
+	Xrestype[arg3] = copyinstr(arg3);
+}
+
+
+Xserver$1:::request-start
+/Xrequest[arg0] == "X_CreatePixmap"/
+{
+	printf("-&gt; %s: client %d\n", Xrequest[arg0], arg3);
+}
+
+Xserver$1:::request-done
+/Xrequest[arg0] == "X_CreatePixmap"/
+{
+	printf("&lt;- %s: client %d\n", Xrequest[arg0], arg3);
+}
+
+Xserver$1:::resource-alloc
+/Xrestype[arg3] == "PIXMAP"/
+{
+	printf("** Pixmap alloc: %08x\n", arg0);
+}
+
+
+Xserver$1:::resource-free
+/Xrestype[arg3] == "PIXMAP"/
+{
+	printf("** Pixmap free:  %08x\n", arg0);
+}
+
+Xserver$1:::client-connect
+{
+	printf("** Client Connect: id %d\n", arg0);
+}
+
+Xserver$1:::client-auth
+{
+	printf("** Client auth'ed: id %d =&gt; %s pid %d\n",
+		arg0, copyinstr(arg1), arg2);
+}
+
+Xserver$1:::client-disconnect
+{
+	printf("** Client Disconnect: id %d\n", arg0);
+}
+	</programlisting>
+
+	Sample output from a run of this script:
+	<screen><computeroutput>
+** Client Connect: id 17
+** Client auth'ed: id 17 =&gt; local host pid 20273
+-&gt; X_CreatePixmap: client 17
+** Pixmap alloc: 02200009
+&lt;- X_CreatePixmap: client 17
+-&gt; X_CreatePixmap: client 15
+** Pixmap alloc: 01e00180
+&lt;- X_CreatePixmap: client 15
+-&gt; X_CreatePixmap: client 15
+** Pixmap alloc: 01e00181
+&lt;- X_CreatePixmap: client 15
+-&gt; X_CreatePixmap: client 14
+** Pixmap alloc: 01c004c8
+&lt;- X_CreatePixmap: client 14
+** Pixmap free:  02200009
+** Client Disconnect: id 17
+** Pixmap free:  01e00180
+** Pixmap free:  01e00181
+	  </computeroutput></screen>
+
+      </para>
+
+    </example>
+
+
+  </sect1>
+
+</article>
+
commit 6b912b08ce65072b2401167fbf2150b99c0ca6b0
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Jun 19 23:56:20 2010 -0700

    Add name argument to CreateNewResourceType documentation
    
    Reflects API change made in commit 895f40792a during Xorg 1.8 development
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Patrick E. Kane <pekane52 at gmail.com>

diff --git a/doc/xml/Xserver-spec.xml b/doc/xml/Xserver-spec.xml
index 88885ae..466b79d 100644
--- a/doc/xml/Xserver-spec.xml
+++ b/doc/xml/Xserver-spec.xml
@@ -357,11 +357,15 @@ Resource types are integer values starting at 1.  Get
 a resource type by calling
 <blockquote><programlisting>
 
-    RESTYPE CreateNewResourceType(deleteFunc)
+    RESTYPE CreateNewResourceType(deleteFunc, char *name)
 
 </programlisting></blockquote>
 deleteFunc will be called to destroy all resources with this
-type.</para>
+type.   name will be used to identify this type of resource
+to clients using the X-Resource extension, to security
+extensions such as SELinux, and to tracing frameworks such as DTrace.
+[The name argument was added in xorg-server 1.8.]
+</para>
 <para>
 Resource classes are masks starting at 1 &lt;&lt; 31 which can
 be or'ed with any resource type to provide attributes for the
commit 44c9350d72b3eda982c642feb45d6648afc626cf
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Jun 19 23:40:37 2010 -0700

    Use DocBook stylesheets from xorg-sgml-doctools if they're available
    
    Bumps minimum xorg-macros requirement from 1.6 to 1.10
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Patrick E. Kane <pekane52 at gmail.com>

diff --git a/configure.ac b/configure.ac
index baa0b5c..c61c60c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,12 +32,13 @@ AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
-# Require xorg-macros: XORG_DEFAULT_OPTIONS
+# Require xorg-macros minimum of 1.10 for XORG_CHECK_SGML_DOCTOOLS
 m4_ifndef([XORG_MACROS_VERSION],
-          [m4_fatal([must install xorg-macros 1.6 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.6)
+          [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.10)
 XORG_DEFAULT_OPTIONS
 XORG_WITH_DOXYGEN(1.6.1)
+XORG_CHECK_SGML_DOCTOOLS(1.5)
 
 m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])])
 XORG_FONT_MACROS_VERSION(1.1)
diff --git a/doc/xml/.gitignore b/doc/xml/.gitignore
index 4961738..3d050f0 100644
--- a/doc/xml/.gitignore
+++ b/doc/xml/.gitignore
@@ -3,3 +3,4 @@ xserver.ent
 Xserver-spec.html
 Xserver-spec.pdf
 Xserver-spec.txt
+xorg.css
diff --git a/doc/xml/xmlrules.in b/doc/xml/xmlrules.in
index 1be3691..0d094be 100644
--- a/doc/xml/xmlrules.in
+++ b/doc/xml/xmlrules.in
@@ -39,6 +39,14 @@ SUFFIXES = .xml .txt .html .pdf
 XML_ENT_DIR = $(abs_top_builddir)/doc/xml
 XMLTO_FLAGS = --searchpath $(XML_ENT_DIR)
 
+if HAVE_STYLESHEETS
+XMLTO_FLAGS += -m $(XSL_STYLESHEET)
+BUILT_DOC_FILES += xorg.css
+
+xorg.css: $(STYLESHEET_SRCDIR)/xorg.css
+	$(AM_V_GEN)cp -pf $(STYLESHEET_SRCDIR)/xorg.css $@
+endif
+
 if HAVE_XMLTO
 BUILT_DOC_FILES += $(TXT_FILES)
 .xml.txt:
@@ -59,7 +67,7 @@ endif
 
 endif
 
-CLEAN_DOC_FILES = $(TXT_FILES) $(HTML_FILES) $(PDF_FILES)
+CLEAN_DOC_FILES = $(TXT_FILES) $(HTML_FILES) $(PDF_FILES) xorg.css
 
 # All the files we build depend on the entities
 $(BUILT_DOC_FILES): $(XML_ENT_DIR)/xserver.ent
diff --git a/hw/xfree86/doc/sgml/.gitignore b/hw/xfree86/doc/sgml/.gitignore
index a06a215..b0b2d05 100644
--- a/hw/xfree86/doc/sgml/.gitignore
+++ b/hw/xfree86/doc/sgml/.gitignore
@@ -3,3 +3,4 @@ DESIGN.html
 DESIGN.pdf
 DESIGN.ps
 DESIGN.txt
+xorg.css
commit 9fbbff3c0456f1969d45cc957d3260723caf62d7
Merge: 95756f4... 9ac8e20...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Jul 21 11:56:39 2010 -0700

    Merge remote branch 'whot/for-keith'

commit 9ac8e206ffe1016a8bc203261ade6c763a8a4f86
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Jul 15 15:46:15 2010 +1000

    xkb: use GetMaster instead of dev->u.master.
    
    Devices that are both pointers and keyboards are not affected by keyboard
    changes as their master device is a master pointer, not a master keyboard.
    Use GetMaster() instead to ensure devices that are attached to the paired
    master pointer device will still be update.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index bd73e9a..935f5ea 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -523,7 +523,7 @@ ProcXkbBell(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixBellAccess);
                 if (rc == Success)
@@ -606,7 +606,7 @@ ProcXkbLatchLockState(ClientPtr client)
     status = Success;
 
     for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) {
-        if ((tmpd == dev) || (!IsMaster(tmpd) && tmpd->u.master == dev)) {
+        if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
             if (!tmpd->key || !tmpd->key->xkbInfo)
                 continue;
 
@@ -748,7 +748,7 @@ ProcXkbSetControls(ClientPtr client)
     for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) {
         if (!tmpd->key || !tmpd->key->xkbInfo)
             continue;
-        if ((tmpd == dev) || (!IsMaster(tmpd) && tmpd->u.master == dev)) {
+        if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
             xkbi = tmpd->key->xkbInfo;
             ctrl = xkbi->desc->ctrls;
             new = *ctrl;
@@ -2558,7 +2558,7 @@ ProcXkbSetMap(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess);
                 if (rc == Success)
@@ -2581,7 +2581,7 @@ ProcXkbSetMap(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess);
                 if (rc == Success)
@@ -2887,7 +2887,7 @@ ProcXkbSetCompatMap(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess);
                 if (rc == Success)
@@ -2910,7 +2910,7 @@ ProcXkbSetCompatMap(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess);
                 if (rc == Success)
@@ -3165,7 +3165,7 @@ ProcXkbSetIndicatorMap(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess);
                 if (rc == Success)
@@ -3434,7 +3434,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && !IsMaster(other) && (other->u.master == dev) &&
+            if ((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev &&
                 (other->kbdfeed || other->leds) &&
                 (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success))
             {
@@ -3458,7 +3458,7 @@ ProcXkbSetNamedIndicator(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && !IsMaster(other) && (other->u.master == dev) &&
+            if ((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev &&
                 (other->kbdfeed || other->leds) &&
                 (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success))
             {
@@ -4249,7 +4249,7 @@ ProcXkbSetNames(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
 
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess);
@@ -4274,7 +4274,7 @@ ProcXkbSetNames(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
 
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess);
@@ -5328,7 +5328,7 @@ ProcXkbSetGeometry(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if ((other != dev) && other->key && !IsMaster(other) && (other->u.master == dev))
+            if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev)
             {
                 rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess);
                 if (rc == Success)
@@ -5840,7 +5840,7 @@ ProcXkbGetKbdByName(ClientPtr client)
 	xkb->ctrls->num_groups= nTG;
 
         for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) {
-            if ((tmpd == dev) || (!IsMaster(tmpd) && tmpd->u.master == dev)) {
+            if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
                 if (tmpd != dev)
                     XkbCopyDeviceKeymap(tmpd, dev);
 
@@ -6519,7 +6519,7 @@ ProcXkbSetDeviceInfo(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if (((other != dev) && !IsMaster(other) && (other->u.master == dev)) &&
+            if (((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) &&
                 ((stuff->deviceSpec == XkbUseCoreKbd && other->key) ||
                 (stuff->deviceSpec == XkbUseCorePtr && other->button)))
             {
@@ -6544,7 +6544,7 @@ ProcXkbSetDeviceInfo(ClientPtr client)
         DeviceIntPtr other;
         for (other = inputInfo.devices; other; other = other->next)
         {
-            if (((other != dev) && !IsMaster(other) && (other->u.master == dev)) &&
+            if (((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) &&
                 ((stuff->deviceSpec == XkbUseCoreKbd && other->key) ||
                 (stuff->deviceSpec == XkbUseCorePtr && other->button)))
             {
commit c54f81ba7a58faf37a612bd9a45276bb2922b5d8
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Jul 15 13:24:14 2010 +1000

    dix: hack around enter/leave event issues for grabbed devices (#27804)
    
    The current core enter/leave does not cater for device grabs during
    enter/leave events. If a window W contains a pointer P1 and a client grabs a
    pointer P2, this pointer will not generate enter/leave events inside this
    window.
    
    Hack around this by forcing grabbed devices to always send enter/leave
    events.
    
    X.Org Bug 27804 <http://bugs.freedesktop.org/show_bug.cgi?id=27804>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/enterleave.c b/dix/enterleave.c
index eefa7ab..7a3ecf5 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -78,10 +78,19 @@ static WindowPtr FocusWindows[MAXDEVICES];
  * window.
  */
 static BOOL
-HasPointer(WindowPtr win)
+HasPointer(DeviceIntPtr dev, WindowPtr win)
 {
     int i;
 
+    /* FIXME: The enter/leave model does not cater for grabbed devices. For
+     * now, a quickfix: if the device about to send an enter/leave event to
+     * a window is grabbed, assume there is no pointer in that window.
+     * Fixes fdo 27804.
+     * There isn't enough beer in my fridge to fix this properly.
+     */
+    if (dev->deviceGrab.grab)
+        return FALSE;
+
     for (i = 0; i < MAXDEVICES; i++)
         if (PointerWindows[i] == win)
             return TRUE;
@@ -270,7 +279,7 @@ CoreEnterNotifies(DeviceIntPtr dev,
           may need to be changed from Virtual to NonlinearVirtual depending
           on the previous P(W). */
 
-    if (!HasPointer(parent) && !FirstPointerChild(parent))
+    if (!HasPointer(dev, parent) && !FirstPointerChild(parent))
             CoreEnterLeaveEvent(dev, EnterNotify, mode, detail, parent,
                                 child->drawable.id);
 }
@@ -309,7 +318,7 @@ CoreLeaveNotifies(DeviceIntPtr dev,
 
         /* If one window has a pointer or a child with a pointer, skip some
          * work and exit. */
-        if (HasPointer(win) || FirstPointerChild(win))
+        if (HasPointer(dev, win) || FirstPointerChild(win))
             return;
 
         CoreEnterLeaveEvent(dev, LeaveNotify, mode, detail, win, child->drawable.id);
@@ -373,7 +382,7 @@ CoreEnterLeaveNonLinear(DeviceIntPtr dev,
           vice versa depending on the the new P(W)
      */
 
-    if (!HasPointer(A))
+    if (!HasPointer(dev, A))
     {
         WindowPtr child = FirstPointerChild(A);
         if (child)
@@ -417,7 +426,7 @@ CoreEnterLeaveNonLinear(DeviceIntPtr dev,
           The detail may need to be changed from Ancestor to Nonlinear
           or vice-versa depending on the previous P(W). */
 
-     if (!HasPointer(B))
+     if (!HasPointer(dev, B))
      {
          WindowPtr child = FirstPointerChild(B);
          if (child)
@@ -455,7 +464,7 @@ CoreEnterLeaveToAncestor(DeviceIntPtr dev,
           The detail may need to be changed from Ancestor to Nonlinear or
           vice versa depending on the the new P(W)
      */
-    if (!HasPointer(A))
+    if (!HasPointer(dev, A))
     {
         WindowPtr child = FirstPointerChild(A);
         if (child)
@@ -479,7 +488,7 @@ CoreEnterLeaveToAncestor(DeviceIntPtr dev,
           P(W) changes from a descendant to W itself. The subwindow
           field should be set to the child containing the old P(W) <<< WRONG */
 
-    if (!HasPointer(B))
+    if (!HasPointer(dev, B))
         CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None);
 
 }
@@ -507,7 +516,7 @@ CoreEnterLeaveToDescendant(DeviceIntPtr dev,
           P(W) changes from W to a descendant of W. The subwindow field
           is set to the child containing the new P(W) <<< THIS IS WRONG */
 
-    if (!HasPointer(A))
+    if (!HasPointer(dev, A))
         CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None);
 
 
@@ -531,7 +540,7 @@ CoreEnterLeaveToDescendant(DeviceIntPtr dev,
           The detail may need to be changed from Ancestor to Nonlinear
           or vice-versa depending on the previous P(W). */
 
-     if (!HasPointer(B))
+     if (!HasPointer(dev, B))
      {
          WindowPtr child = FirstPointerChild(B);
          if (child)


More information about the Xquartz-changes mailing list