1 .\" Copyright (c) 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93
36 .Nd enable kernel process tracing
41 .Op Fl g Ar pgrp | Fl p Ar pid
51 utility enables kernel trace logging for the specified processes.
52 Kernel trace data is logged to the file
54 The kernel operations that are traced include system calls, namei
55 translations, signal processing, and
58 Once tracing is enabled on a process, trace data will be logged until
59 either the process exits or the trace point is cleared.
60 A traced process can generate enormous amounts of log data quickly;
61 It is strongly suggested that users memorize how to disable tracing before
62 attempting to trace a process.
63 The following command is sufficient to disable tracing on all user-owned
64 processes, and, if executed by root, all processes:
68 The trace file is not human readable; use
72 The utility may be used only with a kernel that has been built with the
74 option in the kernel configuration file.
77 .Bl -tag -width indent
79 Append to the trace file instead of recreating it.
81 Disable tracing on all user-owned processes, and, if executed by root, all
82 processes in the system.
84 Clear the specified trace points associated with the given file or processes.
86 Descendants; perform the operation for all current children of the
97 Enable (disable) tracing on all processes in the process group (only one
101 Inherit; pass the trace flags to all future children of the designated
107 Enable (disable) tracing on the indicated process id (only one
111 Specify the list of trace points to enable or disable, one per letter.
112 If an explicit list is not specified, the default set of trace points is used.
114 The following trace points are supported:
116 .Bl -tag -width flag -compact
125 trace namei translations
127 trace capability check failures
129 trace signal processing
131 trace various structures
133 userland traces generated by
142 trace the default set of trace points -
143 .Cm c , i , n , p , s , t , u , y
148 with the specified trace flags.
156 options are mutually exclusive.
158 Run "make", then trace it and any child processes:
161 Trace all kernel operations of process id 34:
164 Trace all kernel operations of processes in process group 15 and
165 pass the trace flags to all current and future children:
168 Disable all tracing of process 65:
171 Disable tracing signals on process 70 and all current children:
172 .Dl $ ktrace -t s -cdp 70
177 .Dl $ ktrace -ti -p 67
179 Disable all tracing to the file "tracedata":
180 .Dl $ ktrace -c -f tracedata
182 Disable tracing of all user-owned processes: