xref: /openbsd/usr.bin/kdump/kdump.1 (revision 5dea098c)
1.\"	$OpenBSD: kdump.1,v 1.40 2023/12/15 15:12:08 deraadt Exp $
2.\"
3.\" Copyright (c) 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	from: @(#)kdump.1	8.1 (Berkeley) 6/6/93
31.\"
32.Dd $Mdocdate: December 15 2023 $
33.Dt KDUMP 1
34.Os
35.Sh NAME
36.Nm kdump
37.Nd display kernel trace data
38.Sh SYNOPSIS
39.Nm kdump
40.Op Fl dHlnRTXx
41.Op Fl f Ar file
42.Op Fl m Ar maxdata
43.Op Fl P Ar program
44.Op Fl p Ar pid
45.Op Fl t Ar trstr
46.Op Fl u Ar label
47.Sh DESCRIPTION
48.Nm
49displays the kernel trace files produced with
50.Xr ktrace 1
51in human-readable format.
52By default, the file
53.Pa ktrace.out
54in the current directory is displayed, unless overridden by the
55.Fl f
56option.
57.Pp
58The options are as follows:
59.Bl -tag -width Ds
60.It Fl d
61Display all numbers in decimal.
62By default, values are printed out in hexadecimal.
63.It Fl f Ar file
64Display the specified file instead of
65.Pa ktrace.out .
66Specifying
67.Sq -
68will read from standard input.
69.It Fl H
70Display thread identifiers.
71.It Fl l
72Loop reading the trace file, once the end-of-file is reached, waiting for
73more data.
74.It Fl m Ar maxdata
75Display at most
76.Ar maxdata
77bytes when decoding I/O.
78.It Fl n
79Suppress ad hoc translations.
80Normally
81.Nm
82tries to decode many system calls into a more human-readable format.
83For example,
84.Xr ioctl 2
85values are replaced with the macro name and
86.Va errno
87values are replaced with the
88.Xr strerror 3
89string.
90Suppressing this feature yields a more consistent output format and is
91easily amenable to further processing.
92.It Fl P Ar program
93Show output only for processes with
94.Ar program
95as their command name.
96.It Fl p Ar pid
97Show output only for the
98.Ar pid
99specified.
100.It Fl R
101Display relative timestamps (time since previous entry).
102.It Fl T
103Display absolute timestamps for each entry (seconds since the Epoch).
104.It Fl TR
105If both options are specified, display timestamps relative to trace start.
106.It Fl t Ar trstr
107Select which tracepoints to display.
108The argument can contain one or more of the following letters.
109By default all trace points except for
110.Cm X
111are enabled.
112.Pp
113.Bl -tag -width flag -offset indent -compact
114.\" Keep this list in sync with ktrace(1) and ltrace(1).
115.It Cm c
116trace system calls
117.It Cm i
118trace I/O
119.It Cm n
120trace namei translations
121.It Cm p
122trace violation of
123.Xr pledge 2
124restrictions
125.It Cm s
126trace signal processing
127.It Cm S
128trace violation of
129.Xr pinsyscalls 2
130.It Cm t
131trace various structures
132.It Cm u
133trace user data coming from
134.Xr utrace 2
135.It Cm x
136trace argument vector in
137.Xr execve 2
138.It Cm X
139trace environment in
140.Xr execve 2
141.It Cm +
142trace the default points
143.El
144.It Fl u Ar label
145Display
146.Xr utrace 2
147tracepoints having
148.Xr utrace 2
149label
150.Ar label
151as strings with
152.Xr vis 3
153escaping, without
154.Xr ktrace 2
155header information.
156.It Fl X
157Display I/O data with hexadecimal data and printable ASCII characters
158side by side.
159.It Fl x
160Display I/O data in hexadecimal.
161.El
162.Pp
163The
164.Fl t
165and
166.Fl u
167options are mutually exclusive;
168the last one specified overrides any previous ones.
169.Sh FILES
170.Bl -tag -width ktrace.out -compact
171.It Pa ktrace.out
172default ktrace dump file
173.El
174.Sh SEE ALSO
175.Xr ktrace 1
176.Sh HISTORY
177The
178.Nm
179command appeared in
180.Bx 4.3 Reno .
181