ktrace.1 (6c7216df785592bb069469113f556dfd1946ed5d) ktrace.1 (df449c3551512682b027c014bbe4316575fff513)
1.\" Copyright (c) 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 18 unchanged lines hidden (view full) ---

27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93
33.\" $FreeBSD$
34.\"
1.\" Copyright (c) 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 18 unchanged lines hidden (view full) ---

27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93
33.\" $FreeBSD$
34.\"
35.Dd June 6, 1993
35.Dd November 6, 2006
36.Dt KTRACE 1
37.Os
38.Sh NAME
39.Nm ktrace
40.Nd enable kernel process tracing
41.Sh SYNOPSIS
42.Nm
43.Op Fl aCcdi

--- 15 unchanged lines hidden (view full) ---

59translations, signal processing, and
60.Tn I/O .
61.Pp
62Once tracing is enabled on a process, trace data will be logged until
63either the process exits or the trace point is cleared.
64A traced process can generate enormous amounts of log data quickly;
65It is strongly suggested that users memorize how to disable tracing before
66attempting to trace a process.
36.Dt KTRACE 1
37.Os
38.Sh NAME
39.Nm ktrace
40.Nd enable kernel process tracing
41.Sh SYNOPSIS
42.Nm
43.Op Fl aCcdi

--- 15 unchanged lines hidden (view full) ---

59translations, signal processing, and
60.Tn I/O .
61.Pp
62Once tracing is enabled on a process, trace data will be logged until
63either the process exits or the trace point is cleared.
64A traced process can generate enormous amounts of log data quickly;
65It is strongly suggested that users memorize how to disable tracing before
66attempting to trace a process.
67The following command is sufficient to disable tracing on all user owned
67The following command is sufficient to disable tracing on all user-owned
68processes, and, if executed by root, all processes:
69.Pp
70.Dl \&$ ktrace -C
71.Pp
72The trace file is not human readable; use
73.Xr kdump 1
74to decode it.
75.Pp
68processes, and, if executed by root, all processes:
69.Pp
70.Dl \&$ ktrace -C
71.Pp
72The trace file is not human readable; use
73.Xr kdump 1
74to decode it.
75.Pp
76The options are as follows:
76The utility may be used only with a kernel that has been built with the
77.Dq KTRACE
78option in the kernel configuration file.
79.Pp
80The options are:
77.Bl -tag -width indent
78.It Fl a
79Append to the trace file instead of recreating it.
80.It Fl C
81.Bl -tag -width indent
82.It Fl a
83Append to the trace file instead of recreating it.
84.It Fl C
81Disable tracing on all user owned processes, and, if executed by root, all
85Disable tracing on all user-owned processes, and, if executed by root, all
82processes in the system.
83.It Fl c
84Clear the trace points associated with the specified file or processes.
85.It Fl d
86Descendants; perform the operation for all current children of the
87designated processes.
88.It Fl f Ar trfile
89Log trace records to

--- 65 unchanged lines hidden (view full) ---

155.Dl $ ktrace -ti -p 67
156.Pp
157# run the command "w", tracing only system calls
158.Dl $ ktrace -tc w
159.Pp
160# disable all tracing to the file "tracedata"
161.Dl $ ktrace -c -f tracedata
162.Pp
86processes in the system.
87.It Fl c
88Clear the trace points associated with the specified file or processes.
89.It Fl d
90Descendants; perform the operation for all current children of the
91designated processes.
92.It Fl f Ar trfile
93Log trace records to

--- 65 unchanged lines hidden (view full) ---

159.Dl $ ktrace -ti -p 67
160.Pp
161# run the command "w", tracing only system calls
162.Dl $ ktrace -tc w
163.Pp
164# disable all tracing to the file "tracedata"
165.Dl $ ktrace -c -f tracedata
166.Pp
163# disable tracing of all processes owned by the user
167# disable tracing of all user-owned processes
164.Dl $ ktrace -C
165.Sh SEE ALSO
166.Xr kdump 1
167.Sh HISTORY
168The
169.Nm
170command appeared in
171.Bx 4.4 .
172.Sh BUGS
173Only works if
174.Ar trfile
175is a regular file.
168.Dl $ ktrace -C
169.Sh SEE ALSO
170.Xr kdump 1
171.Sh HISTORY
172The
173.Nm
174command appeared in
175.Bx 4.4 .
176.Sh BUGS
177Only works if
178.Ar trfile
179is a regular file.