NAME
|
trace – kernel tracing device. |
SYNOPSIS
|
bind #T /dev /dev/trace /dev/tracectl |
DESCRIPTION
|
The trace device provides a method for kernel tracing. Sections
of memory (“traces”) are selected; trace events will be recorded
whenever the program counter enters or leaves a function within
those sections of memory. This is useful in examining how many
times a function is called, with what arguments, and
how much time is spent in that function.
size size
stop turns off tracing. trace startaddr endaddr new name
trace name offdisables the specified trace. No "hits" will ever occur. watch pid
eventtype PC timestamp caller–PID arg1 arg2 arg3 arg4
|
EXAMPLE
To record all calls to a function residing in memory between 0xffffffff8016c2c6
and 0xffffffff8016c306 over the course of one second:
|
ERRORS
| When creating a new trace with the 'new' command, the specified trace name cannot exist, the start address must be less than the end address, and both addresses must be greater than KTZERO and less than etext. For the 'on', 'off', and 'remove' commands, the specified trace must exist or an error will occur. |
SOURCE
|
/sys/src/9/port/devtrace.c /sys/src/9/*/archtrace.c |
SEE ALSO
|
8l(1), kprof(3), prof(1) |