version 1.13, 2003/06/10 09:12:10 |
version 1.14, 2003/09/03 08:54:33 |
|
|
.Nm ktrace |
.Nm ktrace |
.Op Fl aCcdi |
.Op Fl aCcdi |
.Op Fl f Ar trfile |
.Op Fl f Ar trfile |
.Op Fl g Ar pgrp |
.Op Fl g Ar pgid |
.Op Fl p Ar pid |
.Op Fl p Ar pid |
.Op Fl t Ar trstr |
.Op Fl t Ar trstr |
.Nm ktrace |
.Nm ktrace |
|
|
.Fl f |
.Fl f |
option. |
option. |
The kernel operations that are traced include system calls, namei |
The kernel operations that are traced include system calls, namei |
translations, signal processing, and |
translations, signal processing, and I/O. |
.Tn I/O . |
|
.Pp |
.Pp |
Once tracing is enabled on a process, trace data will be logged until |
Once tracing is enabled on a process, trace data will be logged until |
either the process exits or the trace point is cleared. |
either the process exits or the trace point is cleared. |
|
|
The following command is sufficient to disable tracing on all user owned |
The following command is sufficient to disable tracing on all user owned |
processes, and, if executed by root, all processes: |
processes, and, if executed by root, all processes: |
.Pp |
.Pp |
.Dl \&$ ktrace -C |
.Dl $ ktrace -C |
.Pp |
.Pp |
The trace file is not human-readable; use |
The trace file is not human-readable; use |
.Xr kdump 1 |
.Xr kdump 1 |
to decode it. |
to decode it. |
.Pp |
.Pp |
The options are as follows: |
The options are as follows: |
.Bl -tag -width Ds |
.Bl -tag -width "-t trstr" |
.It Fl a |
.It Fl a |
Append to the trace file instead of recreating it. |
Append to the trace file instead of recreating it. |
.It Fl C |
.It Fl C |
|
|
.Cm s . |
.Cm s . |
The following table equates the letters with the tracepoints: |
The following table equates the letters with the tracepoints: |
.Pp |
.Pp |
.Bl -tag -width flag -compact |
.Bl -tag -width flag -offset indent -compact |
.It Cm c |
.It Cm c |
trace system calls |
trace system calls |
.It Cm e |
.It Cm e |
trace emulation changes |
trace emulation changes |
.It Cm i |
.It Cm i |
trace |
trace I/O |
.Tn I/O |
|
.It Cm n |
.It Cm n |
trace namei translations |
trace namei translations |
.It Cm s |
.It Cm s |
|
|
default ktrace dump file |
default ktrace dump file |
.El |
.El |
.Sh EXAMPLES |
.Sh EXAMPLES |
# trace all kernel operations of process id 34 |
# trace all kernel operations of process ID 34 |
.Dl $ ktrace -p 34 |
.Dl $ ktrace -p 34 |
.Pp |
.Bd -unfilled |
.Bd -literal |
|
# trace all kernel operations of processes in process group 15 and |
# trace all kernel operations of processes in process group 15 and |
# pass the trace flags to all current and future children |
# pass the trace flags to all current and future children |
.Ed |
.Ed |
|
|
# disable tracing signals on process 70 and all current children |
# disable tracing signals on process 70 and all current children |
.Dl $ ktrace -t s -cdp 70 |
.Dl $ ktrace -t s -cdp 70 |
.Pp |
.Pp |
# enable tracing of |
# enable tracing of I/O on process 67 |
.Tn I/O |
|
on process 67 |
|
.Dl $ ktrace -ti -p 67 |
.Dl $ ktrace -ti -p 67 |
.Pp |
.Pp |
# run the command "w", tracing only system calls |
# run the command "w", tracing only system calls |