New sentence, new line.
[netbsd-mini2440.git] / usr.sbin / kgmon / kgmon.8
blob327dc70f88d35e92eb7b280009e30c6b0a061502
1 .\"     $NetBSD: kgmon.8,v 1.17 2005/01/27 18:43:51 wiz Exp $
2 .\"
3 .\" Copyright (c) 1983, 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 .\"     from: @(#)kgmon.8       8.1 (Berkeley) 6/6/93
31 .\"
32 .Dd June 6, 1993
33 .Dt KGMON 8
34 .Os
35 .Sh NAME
36 .Nm kgmon
37 .Nd generate a dump of the operating system's profile buffers
38 .Sh SYNOPSIS
39 .Nm
40 .Op Fl bdhpr
41 .Op Fl M Ar core
42 .Op Fl N Ar system
43 .Sh DESCRIPTION
44 .Nm
45 is a tool used when profiling the operating system.
46 When no arguments are supplied,
47 .Nm
48 indicates the state of operating system profiling as running,
49 off, or not configured
50 (see
51 .Xr config 1 ) .
52 If the
53 .Fl p
54 flag is specified,
55 .Nm
56 extracts profile data from the operating system and produces a
57 .Pa gmon.out
58 file suitable for later analysis by
59 .Xr gprof 1 .
60 .Pp
61 The options are as follows:
62 .Bl -tag -width Ds
63 .It Fl b
64 Resume the collection of profile data.
65 .It Fl d
66 Enable debug output.
67 .It Fl h
68 Stop the collection of profile data.
69 .It Fl M
70 Extract values associated with the name list from the specified core
71 instead of the default
72 .Pa /dev/kmem .
73 .It Fl N
74 Extract the name list from the specified system instead of the
75 default
76 .Pa /netbsd .
77 .It Fl p
78 Dump the contents of the profile buffers into a
79 .Pa gmon.out
80 file.
81 .It Fl r
82 Reset all the profile buffers.
83 If the
84 .Fl p
85 flag is also specified, the
86 .Pa gmon.out
87 file is generated before the buffers are reset.
88 .El
89 .Pp
90 If neither
91 .Fl b
92 nor
93 .Fl h
94 is specified, the state of profiling collection remains unchanged.
95 For example, if the
96 .Fl p
97 flag is specified and profile data is being collected,
98 profiling will be momentarily suspended,
99 the operating system profile buffers will be dumped,
100 and profiling will be immediately resumed.
101 .Sh FILES
102 .Bl -tag -width /dev/kmemx -compact
103 .It Pa /netbsd
104 the default system
105 .It Pa /dev/kmem
106 the default memory
108 .Sh DIAGNOSTICS
109 Users with only read permission on
110 .Pa /dev/kmem
111 cannot change the state of profiling collection.
112 They can get a
113 .Pa gmon.out
114 file with the warning that the data may be
115 inconsistent if profiling is in progress.
116 .Sh SEE ALSO
117 .Xr config 1 ,
118 .Xr gprof 1
119 .Sh HISTORY
122 command appeared in
123 .Bx 4.2 .