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, planned to be released in August 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-1.1.99.901.tar.bz2 and then do:
bzcat xorg-server-1.1.99.901.tar.bz2 | tar -xf -
cd xorg-server-1.1.99.901
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.
| Probe name | Description | arg0 | arg1 | arg2 | arg3 | arg4 |
|---|---|---|---|---|---|---|
| Request Probes | ||||||
| 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().
| Argument name | type | Description |
|---|---|---|
| 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 |
| Release | Date | Description |
|---|---|---|
| 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, 2006, 2007 Sun Microsystems, Inc. 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, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
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 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.