xref: /plan9-contrib/sys/man/3/ptrace (revision af198995f3f1f1d87a386835b2bcd15ca90a6fed)
UART 3
NAME
ptrace - process scheduling traces
SYNOPSIS
 bind -a #σ /dev 
 /dev/ptrace  /dev/ptracectl 
DESCRIPTION

The process trace device is a replacement for the trace facility in proc (3) to report more information about process events.

The ptracectl admits the following requests:

size " n Set the size of the buffer to n entries. Before issuing this request tracing is not enabled.

trace " pid value" Set the trace on or off for the process with the given pid.

The ptrace file reports an integral number of events when read. To avoid too much interference with scheduling, it does not block readers. When no more events are available the read returns an EOF indication, but the program is expected to poll the device for further events. This behavior mimics what proc (3) does with the trace interface.

SOURCE
/sys/src/9/port/devptrace.c

/sys/src/9k/port/devptrace.c

"SEE ALSO
ptrace (1), ptrace (2).
BUGS
If the buffer size is too small, events will be discarded.

The reader must poll the trace device.