This page provides details on a statically defined user application tracing provider for the DTrace facility in Solaris 10 and later releases. This provider instruments various points in the X server, to allow tracing what client applications are up to.
These providers are included in the X server binaries (including Xorg, Xsun, Xvfb, & Xephyr) in recent Solaris releases, including:
The provider is integrated into the X.Org git master repository for the Xserver 1.4 release, released in 2007 with X11R7.3, and into the OpenSolaris X code base for Nevada builds 53 and later.
The 0.1 source patch is built against the Xorg 6.8.2 release (aka X11R6.8.2).
To build, download the base source from http://www.x.org/download.cgi?rel=6.8.2 and then do:
bzcat X11R6.8.2-src.tar.bz2 | tar -xf - gpatch -p1 < 6.8.2-dtrace.patch cd xc make World
The 0.2 source patch is built against Xorg xserver 1.2 RC1 (aka X11R7.2 RC1).
To build, download the base source from http://xorg.freedesktop.org/releases/individual/xserver/xorg-server-188.8.131.521.tar.bz2 and then do:
bzcat xorg-server-184.108.40.2061.tar.bz2 | tar -xf - cd xorg-server-220.127.116.111 gpatch -p0 < 7.2-dtrace.patch ./configure ; make
Once you're done, you should be able to drop in xc/programs/Xserver/Xorg (6.8.2) or hw/xfree86/Xorg (7.2) as a replacement for /usr/X11/bin/Xorg on a Solaris 10 or Solaris Nevada/Express system.
Due to the way User-Defined DTrace probes work, arguments to these probes all bear undistinguished names of arg0, arg1, arg2, etc. These tables should help you determine what the real data is for each of the probe arguments.
|request-start||Called just before processing each client request.||requestName||requestCode||requestLength||clientId||requestBuffer|
|request-done (0.1)||Called just after processing each client request.||requestName||requestCode||requestLength||clientId||resultCode|
|request-done (0.2)||Called just after processing each client request.||requestName||requestCode||sequenceNumber||clientId||resultCode|
|Event Probes (added in 0.2)|
|send-event||Called just before send each event to a client.||clientId||eventCode||eventBuffer|
|Client Connection Probes|
|client-connect||Called when a new connection is opened from a client||clientId||clientFD|
|client-auth||Called when client authenticates (normally just after connection opened)||clientId||clientAddr||clientPid||clientZoneId|
|client-disconnect||Called when a client connection is closed||clientId|
|Resource Allocation Probes|
|resource-alloc||Called when a new resource (pixmap, gc, colormap, etc.) is allocated||resourceId||resourceTypeId||resourceValue||resourceTypeName|
|resource-free||Called when a resource is freed||resourceId||resourceTypeId||resourceValue||resourceTypeName|
To access data in arguments of type string, you will need to use copyinstr(). To access data buffers referenced via uintptr_t's, you will need to use copyin().
|clientAddr||string||String representing address client connected from|
|clientFD||int||X server's file descriptor for server side of each connection|
|clientId||int||Unique integer identifier for each connection to the X server|
|clientPid||pid_t||Process id of client, if connection is local (from getpeerucred() )|
|clientZoneId||zoneid_t||Zone id of client, if connection is local (from getpeerucred() )|
|eventBuffer||uintptr_t||Pointer to buffer containing X event - decode using structures in <X11/Xproto.h> and similar headers for each extension|
|eventCode||uint8_t||Event number of X event|
|resourceId||uint32_t||X resource id (XID)|
|resourceTypeId||uint32_t||Resource type id|
|resourceTypeName||string||String representing X resource type ("PIXMAP", etc.)|
|resourceValue||uintptr_t||Pointer to data for X resource|
|resultCode||int||Integer code representing result status of request|
|requestBuffer||uintptr_t||Pointer to buffer containing X request - decode using structures in <X11/Xproto.h> and similar headers for each extension|
|requestCode||uint8_t||Request number of X request or Extension|
|requestName||string||Name of X request or Extension|
|requestLength||uint16_t||Length of X request|
|sequenceNumber||uint32_t||Number of X request in in this connection|
|0.2||30-Oct-2006||Update for X11R7.2 RC1, add event probe, update request-done probe|
|0.1||04-July-2005||Initial public release|
Copyright © 2005, 2012, 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.