19b50d902SRodney W. Grimes.\" Copyright (c) 1990, 1993 29b50d902SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 39b50d902SRodney W. Grimes.\" 49b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 59b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions 69b50d902SRodney W. Grimes.\" are met: 79b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 89b50d902SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 99b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 109b50d902SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 119b50d902SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors 139b50d902SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 149b50d902SRodney W. Grimes.\" without specific prior written permission. 159b50d902SRodney W. Grimes.\" 169b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 179b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 189b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 199b50d902SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 209b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 219b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 229b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 239b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 249b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 259b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 269b50d902SRodney W. Grimes.\" SUCH DAMAGE. 279b50d902SRodney W. Grimes.\" 28fc90f3a2SDmitry Chagin.Dd July 16, 2022 299b50d902SRodney W. Grimes.Dt KDUMP 1 3062500372SRuslan Ermilov.Os 319b50d902SRodney W. Grimes.Sh NAME 329b50d902SRodney W. Grimes.Nm kdump 339b50d902SRodney W. Grimes.Nd display kernel trace data 349b50d902SRodney W. Grimes.Sh SYNOPSIS 3593e0d62dSJohn-Mark Gurney.Nm 36b9034ce2SBryan Drewery.Op Fl dEnlHRSsTA 3724b64809SPeter Wemm.Op Fl f Ar trfile 389b50d902SRodney W. Grimes.Op Fl m Ar maxdata 39ec4beb5dSPeter Wemm.Op Fl p Ar pid 40da647ae9SRuslan Ermilov.Op Fl t Ar trstr 419b50d902SRodney W. Grimes.Sh DESCRIPTION 4293e0d62dSJohn-Mark GurneyThe 4393e0d62dSJohn-Mark Gurney.Nm 4493e0d62dSJohn-Mark Gurneycommand displays the kernel trace files produced with 459b50d902SRodney W. Grimes.Xr ktrace 1 469b50d902SRodney W. Grimesin human readable format. 479b50d902SRodney W. GrimesBy default, the file 489b50d902SRodney W. Grimes.Pa ktrace.out 499b50d902SRodney W. Grimesin the current directory is displayed. 509b50d902SRodney W. Grimes.Pp 519b50d902SRodney W. GrimesThe options are as follows: 529b50d902SRodney W. Grimes.Bl -tag -width Fl 53*ae37e4a0SDmitry Chagin.It Fl A 54*ae37e4a0SDmitry ChaginDisplay the ABI of the traced process. 55fc90f3a2SDmitry Chagin.It Fl c 56fc90f3a2SDmitry ChaginDisplay the CPU number with each trace entry. 579b50d902SRodney W. Grimes.It Fl d 589b50d902SRodney W. GrimesDisplay all numbers in decimal. 5924b64809SPeter Wemm.It Fl E 6024b64809SPeter WemmDisplay elapsed timestamps (time since beginning of trace). 6124b64809SPeter Wemm.It Fl f Ar trfile 629b50d902SRodney W. GrimesDisplay the specified file instead of 639b50d902SRodney W. Grimes.Pa ktrace.out . 64a9ac598bSRobert Watson.It Fl H 654e9e907dSRuslan ErmilovList the thread ID (tid) of the thread with each trace record, if available. 664e9e907dSRuslan ErmilovIf no thread ID is available, 0 will be printed. 679b50d902SRodney W. Grimes.It Fl l 689b50d902SRodney W. GrimesLoop reading the trace file, once the end-of-file is reached, waiting for 699b50d902SRodney W. Grimesmore data. 709b50d902SRodney W. Grimes.It Fl m Ar maxdata 719b50d902SRodney W. GrimesDisplay at most 729b50d902SRodney W. Grimes.Ar maxdata 739b50d902SRodney W. Grimesbytes when decoding 749b50d902SRodney W. Grimes.Tn I/O . 759b50d902SRodney W. Grimes.It Fl n 769b50d902SRodney W. GrimesSuppress ad hoc translations. 779b50d902SRodney W. GrimesNormally 7893e0d62dSJohn-Mark Gurney.Nm 799b50d902SRodney W. Grimestries to decode many system calls into a more human readable format. 809b50d902SRodney W. GrimesFor example, 819b50d902SRodney W. Grimes.Xr ioctl 2 829b50d902SRodney W. Grimesvalues are replaced with the macro name and 839b50d902SRodney W. Grimes.Va errno 849b50d902SRodney W. Grimesvalues are replaced with the 859b50d902SRodney W. Grimes.Xr strerror 3 869b50d902SRodney W. Grimesstring. 879b50d902SRodney W. GrimesSuppressing this feature yields a more consistent output format and is 889b50d902SRodney W. Grimeseasily amenable to further processing. 89ec4beb5dSPeter Wemm.It Fl p Ar pid 9001a36e29SJohn BaldwinDisplay only trace events that correspond to the process or thread 91ec4beb5dSPeter Wemm.Ar pid . 9201a36e29SJohn BaldwinThis may be useful when there are multiple processes or threads recorded in the 93ec4beb5dSPeter Wemmsame trace file. 949b50d902SRodney W. Grimes.It Fl R 959b50d902SRodney W. GrimesDisplay relative timestamps (time since previous entry). 9660e15db9SDag-Erling Smørgrav.It Fl r 9760e15db9SDag-Erling SmørgravWhen decoding STRU records, display structure members such as UIDs, 9860e15db9SDag-Erling SmørgravGIDs, dates etc. symbolically instead of numerically. 99b9034ce2SBryan Drewery.It Fl S 100b9034ce2SBryan DreweryDisplay system call numbers. 101df0c8868SRobert Watson.It Fl s 102df0c8868SRobert WatsonSuppress display of I/O data. 1039b50d902SRodney W. Grimes.It Fl T 1049b50d902SRodney W. GrimesDisplay absolute timestamps for each entry (seconds since epoch). 105da647ae9SRuslan Ermilov.It Fl t Ar trstr 1069b50d902SRodney W. GrimesSee the 1079b50d902SRodney W. Grimes.Fl t 1089b50d902SRodney W. Grimesoption of 1099b50d902SRodney W. Grimes.Xr ktrace 1 . 1109b50d902SRodney W. Grimes.El 111a9a2bf99SGeorge V. Neville-Neil.Pp 112a9a2bf99SGeorge V. Neville-NeilThe output format of 113a9a2bf99SGeorge V. Neville-Neil.Nm 114a9a2bf99SGeorge V. Neville-Neilis line oriented with several fields. 115a9a2bf99SGeorge V. Neville-NeilThe example below shows a section of a kdump generated by the following 116a9a2bf99SGeorge V. Neville-Neilcommands: 117a9a2bf99SGeorge V. Neville-Neil.Bd -literal -offset indent 118a9a2bf99SGeorge V. Neville-Neil?> ktrace echo "ktrace" 119a9a2bf99SGeorge V. Neville-Neil 120a9a2bf99SGeorge V. Neville-Neil?> kdump 121a9a2bf99SGeorge V. Neville-Neil 122a9a2bf99SGeorge V. Neville-Neil 85045 echo CALL writev(0x1,0x804b030,0x2) 123a9a2bf99SGeorge V. Neville-Neil 85045 echo GIO fd 1 wrote 7 bytes 124a9a2bf99SGeorge V. Neville-Neil "ktrace 125a9a2bf99SGeorge V. Neville-Neil " 126a9a2bf99SGeorge V. Neville-Neil 85045 echo RET writev 7 127a9a2bf99SGeorge V. Neville-Neil.Ed 128a9a2bf99SGeorge V. Neville-Neil.Pp 129a9a2bf99SGeorge V. Neville-NeilThe first field is the PID of the process being traced. 130a9a2bf99SGeorge V. Neville-NeilThe second field is the name of the program being traced. 131a9a2bf99SGeorge V. Neville-NeilThe third field is the operation that the kernel performed 132a9a2bf99SGeorge V. Neville-Neilon behalf of the process. 133a9ac598bSRobert WatsonIf thread IDs are being printed, then an additional thread ID column will be 1344e9e907dSRuslan Ermilovadded to the output between the PID field and program name field. 135a9a2bf99SGeorge V. Neville-Neil.Pp 136a9a2bf99SGeorge V. Neville-NeilIn the first line above, the kernel executes the 137a9a2bf99SGeorge V. Neville-Neil.Xr writev 2 138a9a2bf99SGeorge V. Neville-Neilsystem call on behalf of the process so this is a 139a9a2bf99SGeorge V. Neville-Neil.Li CALL 140a9a2bf99SGeorge V. Neville-Neiloperation. 141a9a2bf99SGeorge V. Neville-NeilThe fourth field shows the system call that was executed, 142a9a2bf99SGeorge V. Neville-Neilincluding its arguments. 143a9a2bf99SGeorge V. Neville-NeilThe 144a9a2bf99SGeorge V. Neville-Neil.Xr writev 2 145a9a2bf99SGeorge V. Neville-Neilsystem call takes a file descriptor, in this case 1, or standard 146a9a2bf99SGeorge V. Neville-Neiloutput, then a pointer to the iovector to write, and the number of 147a9a2bf99SGeorge V. Neville-Neiliovectors that are to be written. 148a9a2bf99SGeorge V. Neville-NeilIn the second line we see the operation was 149a9a2bf99SGeorge V. Neville-Neil.Li GIO , 150a9a2bf99SGeorge V. Neville-Neilfor general I/O, and that file descriptor 1 had 151a9a2bf99SGeorge V. Neville-Neilseven bytes written to it. 152a9a2bf99SGeorge V. Neville-NeilThis is followed by the seven bytes that were written, the string 153a9a2bf99SGeorge V. Neville-Neil.Qq Li ktrace 154a9a2bf99SGeorge V. Neville-Neilwith a carriage return and line feed. 155a9a2bf99SGeorge V. Neville-NeilThe last line is the 156a9a2bf99SGeorge V. Neville-Neil.Li RET 157a9a2bf99SGeorge V. Neville-Neiloperation, showing a return from the kernel, what system call we are 158a9a2bf99SGeorge V. Neville-Neilreturning from, and the return value that the process received. 159a9a2bf99SGeorge V. Neville-NeilSeven bytes were written by the 160a9a2bf99SGeorge V. Neville-Neil.Xr writev 2 161a9a2bf99SGeorge V. Neville-Neilsystem call, so 7 is the return value. 162a9a2bf99SGeorge V. Neville-Neil.Pp 163a9a2bf99SGeorge V. Neville-NeilThe possible operations are: 164c23d84a8SJohn Baldwin.Bl -column -offset indent ".Li CALL" ".No data from user process" 165a9a2bf99SGeorge V. Neville-Neil.It Sy Name Ta Sy Operation Ta Sy Fourth field 166a9a2bf99SGeorge V. Neville-Neil.It Li CALL Ta enter syscall Ta syscall name and arguments 167a9a2bf99SGeorge V. Neville-Neil.It Li RET Ta return from syscall Ta syscall name and return value 168a9a2bf99SGeorge V. Neville-Neil.It Li NAMI Ta file name lookup Ta path to file 169c23d84a8SJohn Baldwin.It Li GIO Ta general I/O Ta fd, read/write, number of bytes 170c23d84a8SJohn Baldwin.It Li PSIG Ta signal Ta signal name, handler, mask, code 17188bf5036SJohn Baldwin.It Li CSW Ta context switch Ta stop/resume user/kernel wmesg 172a9a2bf99SGeorge V. Neville-Neil.It Li USER Ta data from user process Ta the data 17360e15db9SDag-Erling Smørgrav.It Li STRU Ta various syscalls Ta structure 174a56be37eSJohn Baldwin.It Li SCTL Ta Xr sysctl 3 requests Ta MIB name 17535818d2eSJohn Baldwin.It Li PFLT Ta enter page fault Ta fault address and type 17635818d2eSJohn Baldwin.It Li PRET Ta return from page fault Ta fault result 177a9a2bf99SGeorge V. Neville-Neil.El 1789b50d902SRodney W. Grimes.Sh SEE ALSO 1799b50d902SRodney W. Grimes.Xr ktrace 1 1809b50d902SRodney W. Grimes.Sh HISTORY 1819b50d902SRodney W. GrimesThe 18293e0d62dSJohn-Mark Gurney.Nm 18393e0d62dSJohn-Mark Gurneycommand appeared in 1849b50d902SRodney W. Grimes.Bx 4.4 . 185