ktr.4 (104968) | ktr.4 (107383) |
---|---|
1.\" Copyright (c) 2001 John H. Baldwin <jhb@FreeBSD.org> 2.\" 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. --- 8 unchanged lines hidden (view full) --- 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" | 1.\" Copyright (c) 2001 John H. Baldwin <jhb@FreeBSD.org> 2.\" 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. --- 8 unchanged lines hidden (view full) --- 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" |
25.\" $FreeBSD: head/share/man/man4/ktr.4 104968 2002-10-12 05:50:47Z jeff $ | 25.\" $FreeBSD: head/share/man/man4/ktr.4 107383 2002-11-29 11:39:20Z ru $ |
26.\" 27.Dd February 16, 2001 28.Dt KTR 4 29.Os 30.Sh NAME 31.Nm ktr 32.Nd kernel tracing facility 33.Sh SYNOPSIS --- 59 unchanged lines hidden (view full) --- 93.Xr loader 8 94via the 95.Va debug.ktr.cpumask 96environment variable. 97It can also be examined and set after booting via the 98.Va debug.ktr.cpumask 99sysctl. 100By default events on all CPUs are enabled. | 26.\" 27.Dd February 16, 2001 28.Dt KTR 4 29.Os 30.Sh NAME 31.Nm ktr 32.Nd kernel tracing facility 33.Sh SYNOPSIS --- 59 unchanged lines hidden (view full) --- 93.Xr loader 8 94via the 95.Va debug.ktr.cpumask 96environment variable. 97It can also be examined and set after booting via the 98.Va debug.ktr.cpumask 99sysctl. 100By default events on all CPUs are enabled. |
101.Ss Verbose mode | 101.Ss Verbose Mode |
102By default, events are only logged to the internal buffer for examination 103later, but if the verbose flag is set then they are dumped to the kernel 104console as well. 105This flag can also be set from the loader via the 106.Va debug.ktr.verbose 107environment variable, or it can be examined and set after booting via the 108.Va debug.ktr.verbose 109sysctl. --- 22 unchanged lines hidden (view full) --- 132By default the timestamp, filename, and line number are not displayed with 133each log entry. 134If the 135.Cm /v 136modifier is specified, then they are displayed in addition to the normal 137output. 138Note that the events are displayed in reverse chronological order. 139That is, the most recent events are displayed first. | 102By default, events are only logged to the internal buffer for examination 103later, but if the verbose flag is set then they are dumped to the kernel 104console as well. 105This flag can also be set from the loader via the 106.Va debug.ktr.verbose 107environment variable, or it can be examined and set after booting via the 108.Va debug.ktr.verbose 109sysctl. --- 22 unchanged lines hidden (view full) --- 132By default the timestamp, filename, and line number are not displayed with 133each log entry. 134If the 135.Cm /v 136modifier is specified, then they are displayed in addition to the normal 137output. 138Note that the events are displayed in reverse chronological order. 139That is, the most recent events are displayed first. |
140.Ss Logging ktr to disk | 140.Ss Logging ktr to Disk |
141The 142.Dv KTR_ALQ | 141The 142.Dv KTR_ALQ |
143option can be used to log ktr entries to disk for post analysis using the | 143option can be used to log 144.Nm 145entries to disk for post analysis using the |
144.Xr ktrdump 8 145utility. 146Due to the potentially high volume of trace messages the trace mask should be 147selected carefully. 148This feature is configured through a group of sysctls. | 146.Xr ktrdump 8 147utility. 148Due to the potentially high volume of trace messages the trace mask should be 149selected carefully. 150This feature is configured through a group of sysctls. |
149.Pp 150.Va debug.ktr.alq_file 151displays or sets the file that ktr will log to. By default its value is 152"/tmp/ktr.out". 153If the file name is changed while ktr is enabled it will not take effect until | 151.Bl -tag -width ".Va debug.ktr.alq_enable" 152.It Va debug.ktr.alq_file 153displays or sets the file that 154.Nm 155will log to. 156By default its value is 157.Pa /tmp/ktr.out . 158If the file name is changed while 159.Nm 160is enabled it will not take effect until |
154the next invocation. | 161the next invocation. |
155.Pp 156.Va debug.ktr.alq_enable 157enables logging of ktr entries to disk if it is set to one. | 162.It Va debug.ktr.alq_enable 163enables logging of 164.Nm 165entries to disk if it is set to one. |
158Setting this to 0 will terminate logging. | 166Setting this to 0 will terminate logging. |
159.Pp 160.Va debug.ktr.alq_max | 167.It Va debug.ktr.alq_max |
161is the maximum number of entries that will be recorded to disk, or 0 for 162infinite. 163This is helpful for limiting the number of particularly high frequency entries 164that are recorded. | 168is the maximum number of entries that will be recorded to disk, or 0 for 169infinite. 170This is helpful for limiting the number of particularly high frequency entries 171that are recorded. |
165.Pp 166.Va debug.ktr.alq_depth | 172.It Va debug.ktr.alq_depth |
167determines the number of entries in the write buffer. 168This is the buffer that holds entries before they are written to disk and 169defaults to the value of the 170.Dv KTR_ENTRIES 171option. | 173determines the number of entries in the write buffer. 174This is the buffer that holds entries before they are written to disk and 175defaults to the value of the 176.Dv KTR_ENTRIES 177option. |
172.Pp 173.Va debug.ktr.alq_failed | 178.It Va debug.ktr.alq_failed |
174records the number of times we failed to write an entry due to overflowing the 175write buffer. | 179records the number of times we failed to write an entry due to overflowing the 180write buffer. |
176This may happen if the frequency of the logged ktr messages outpaces the depth | 181This may happen if the frequency of the logged 182.Nm 183messages outpaces the depth |
177of the queue. | 184of the queue. |
178.Pp 179.Va debug.ktr.alq_cnt | 185.It Va debug.ktr.alq_cnt |
180records the number of entries that have currently been written to disk. | 186records the number of entries that have currently been written to disk. |
187.El |
|
181.Sh SEE ALSO | 188.Sh SEE ALSO |
182.Xr ktr 9 , 183.Xr ktrdump 8 | 189.Xr ktrdump 8 , 190.Xr ktr 9 |
184.Sh HISTORY 185The KTR kernel tracing facility first appeared in 186.Bsx 3.0 187and was imported into 188.Fx 5.0 . | 191.Sh HISTORY 192The KTR kernel tracing facility first appeared in 193.Bsx 3.0 194and was imported into 195.Fx 5.0 . |