The set of probes (trace instrumentation points) available in the standard
kernel. The probes log trace data to a kernel trace buffer in Trace Normal Form (TNF). Kernel probes are controlled by prex(1). A snapshot of the kernel trace buffer
can be made using tnfxtract(1) and examined using tnfdump(1).
Each probe has a name and is associated with a set of symbolic keys, or categories. These are used to select and control probes from prex(1). A probe that is enabled for tracing generates a TNF record, called an event record. An event record contains two common members and may contain other probe-specific data members.
Common Members
tnf_probe_eventtagtnf_time_deltatime_delta
tag
Encodes TNF references to two other records:
tag
Describes the layout of the event record.
schedule
Identifies the writing thread and also contains a 64-bit base time in nanoseconds.
time_delta
A 32-bit time offset from the base time; the sum of the two times is the actual time of the event.
Threads
thread_create
tnf_kthread_idtidtnf_pidpidtnf_symbolstart_pc
Thread creation event.
tid
The thread identifier for the new thread.
pid
The process identifier for the new thread.
start_pc
The kernel address of its start routine.
thread_state
tnf_kthread_idtidtnf_microstatestate
Thread microstate transition events.
tid
Optional; if it is absent, the event is for the writing thread, otherwise the event is for the specified thread.
state
Indicates the thread state:
o
Running in user mode.
o
Running in system mode.
o
Asleep waiting for a user-mode lock.
o
Asleep on a kernel object.
o
Runnable (waiting for a cpu).
o
Stopped.
The values of this member are defined in <sys/msacct.h>. Note that to reduce trace output, transitions between the system and user microstates that are induced by system calls are not traced. This information
is implicit in the system call entry and exit events.
thread_exit
Thread termination event for writing thread. This probe has no data members other than the common members.
Gives the fault type: invalid page, protection fault, software requested locking or unlocking.
access
Gives the desired access protection: read, write, execute or create. The values for these two members are defined in <vm/seg_enum.h>.
major_fault
tnf_opaquevnodetnf_offsetoffset
Major page fault event. The faulting page is mapped to the file given by the vnode member, at the given offset into the file. (The faulting virtual address is in the most recent address_fault event for the writing thread.)
anon_private
tnf_opaqueaddress
Copy-on-write page fault event.
address
The virtual address at which the new page is mapped.
anon_zero
tnf_opaqueaddress
Zero-fill page fault event.
address
The virtual address at which the new page is mapped.
page_unmap
tnf_opaquevnodetnf_offsetoffset
Page unmapping event. This probe marks the unmapping of a file system page from the system.
vnode and offset
Identifies the file and offset of the page being unmapped.
Pageins and Pageouts
pagein
tnf_opaquevnodetnf_offsetoffsettnf_sizesize
Pagein start event. This event signals the initiation of pagein I/O.
Raw I/O start event. This event marks entry into the physio(9F) fufnction which performs unbuffered I/O.
device
Contains the major and minor numbers of the device of the transfer.
offset
The logical offset on the device for the transfer.
size
The number of bytes to be transferred.
rw
The direction of the transfer: read or write (see buf(9S)).
physio_end
tnf_devicedevice
Raw I/O end event. This event marks exit from the physio(9F) fufnction.
device
The major and minor numbers of the device of the transfer.
USAGE
Use the prex utility to control kernel probes. The standard prex commands to list and manipulate probes are available to you, along with commands to set up and manage kernel tracing.
Kernel probes write trace records into a kernel trace buffer. You must copy the buffer into a TNF file for post-processing; use the tnfxtract utility for this.
You use the tnfdump utility to examine a kernel trace file. This is exactly the same as examining a user-level trace file.
The steps you typically follow to take a kernel trace are:
1.
Become superuser (su).
2.
Allocate a kernel trace buffer of the desired size (prex).
3.
Select the probes you want to trace and enable (prex).
4.
Turn kernel tracing on (prex).
5.
Run your application.
6.
Turn kernel tracing off (prex).
7.
Extract the kernel trace buffer (tnfxtract).
8.
Disable all probes (prex).
9.
Deallocate the kernel trace buffer (prex).
10.
Examine the trace file (tnfdump).
A convenient way to follow these steps is to use two shell windows; run an interactive prex session in one, and run your application and tnfxtract in the other.