Xserver provider for DTrace


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.

Available probes

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 nameDescriptionarg0arg1arg2arg3arg4
Request Probes
request-start Called just before processing each client request. requestNamerequestCode requestLengthclientIdrequestBuffer
request-done Called just after processing each client request. requestNamerequestCode sequenceNumberclientIdresultCode
Event Probes
send-event Called just before send each event to a client. clientIdeventCodeeventBuffer  
Client Connection Probes
client-connect Called when a new connection is opened from a client clientIdclientFD 
client-auth Called when client authenticates (normally just after connection opened) clientIdclientAddrclientPid 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 resourceIdresourceTypeIdresourceValueresourceTypeName 
resource-free Called when a resource is freed resourceIdresourceTypeIdresourceValueresourceTypeName 

Data Available in Probe Arguments

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 nametypeDescription
clientAddrstringString representing address client connected from
clientFDintX server's file descriptor for server side of each connection
clientIdintUnique integer identifier for each connection to the X server
clientPidpid_tProcess id of client, if connection is local (from getpeerucred() )
clientZoneIdzoneid_tZone id of client, if connection is local (from getpeerucred() )
eventBufferuintptr_tPointer to buffer containing X event - decode using structures in <X11/Xproto.h> and similar headers for each extension
eventCodeuint8_tEvent number of X event
resourceIduint32_tX resource id (XID)
resourceTypeIduint32_tResource type id
resourceTypeNamestringString representing X resource type ("PIXMAP", etc.)
resourceValueuintptr_tPointer to data for X resource
resultCodeintInteger code representing result status of request
requestBufferuintptr_tPointer to buffer containing X request - decode using structures in <X11/Xproto.h> and similar headers for each extension
requestCodeuint8_tRequest number of X request or Extension
requestNamestringName of X request or Extension
requestLengthuint16_tLength of X request
sequenceNumberuint32_tNumber of X request in in this connection

Examples/samples


alan.coopersmith@sun.com
Last modified: Mon Oct 30 14:04:32 PST 2006