xref: /netbsd-src/sbin/dmesg/dmesg.8 (revision 7008793d771ac77ec53f84d651495e9bccefa559)
1.\"	$NetBSD: dmesg.8,v 1.26 2018/10/30 19:40:36 kre Exp $
2.\"
3.\" Copyright (c) 1980, 1991, 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.\"     @(#)dmesg.8	8.1 (Berkeley) 6/5/93
31.\"
32.Dd October 30, 2018
33.Dt DMESG 8
34.Os
35.Sh NAME
36.Nm dmesg
37.Nd display the system message buffer
38.Sh SYNOPSIS
39.Nm
40.Op Fl dTt
41.Op Fl M Ar core
42.Op Fl N Ar system
43.Sh DESCRIPTION
44.Nm
45displays the contents of the system message buffer.
46.Pp
47The options are as follows:
48.Bl -tag -width Ds
49.It Fl d
50Show the timestamp deltas.
51Used together with
52.Fl t
53only the deltas are shown.
54.It Fl M
55Extract values associated with the name list from the specified core
56instead of the default ``/dev/mem''.
57.It Fl N
58Extract the name list from the specified system instead of the default
59``/netbsd''.
60.It Fl T
61Format uptime timestamps in a human readable form (using
62.Xr ctime 3 )
63using output suitable for the local locale as set in the environment.
64Repeating this option prints the uptime in ISO 8601 duration form,
65giving the duration since boot, in hours, minutes, and seconds (to
66millisecond resolution).
67A third occurrence causes the duration to always be represented
68to millisecond precision, even where that means trailing zeroes
69appear.
70.It Fl t
71Quiet printing, don't print timestamps.
72.El
73.Pp
74The system message buffer is a circular buffer of a fixed size.
75If the buffer has been filled, the first line of the
76.Nm
77output may not be complete.
78The size of the message buffer is configurable at compile-time on
79most systems with the
80.Dv MSGBUFSIZE
81kernel option.
82Look for
83.Dv MSGBUFSIZE
84in
85.Xr options 4
86for details.
87.Sh FILES
88.Bl -tag -width /var/run/dmesg.boot -compact
89.It Pa /var/run/dmesg.boot
90copy of dmesg at the time of last boot.
91.El
92.Sh SEE ALSO
93.Xr options 4 ,
94.Xr syslogd 8
95.Sh HISTORY
96The
97.Nm
98command appeared in
99.Bx 3.0 .
100.Sh BUGS
101The
102.Fl T
103option will report nonsense when displaying lines from
104the message buffer that were not added by the current
105running kernel.
106.Pp
107When
108.Fl TT
109is used, the duration is always given with maximum units of hours,
110even when the number of hours is in the hundreds, thousands, or more.
111This is because converting hours to days, over periods when
112.Dq time skips
113occur, such as summer time beginning or ending, is not trivial.
114A duration of 26 hours might be 1D3H or 1D1H at such events,
115rather than the usual 1D2H,
116and when a time zone alters its offset,
117even more complex calculations are needed.
118None of those calculations are done
119.Pq even to account for sub-hour time zone shifts ,
120the duration indicated is always calculated by simple division of
121seconds by 60 to produce minutes, and again to produce hours.
122Most of the time\ [!] this is correct.
123