xref: /original-bsd/usr.sbin/kgmon/kgmon.8 (revision ae45e3e8)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)kgmon.8	8.1 (Berkeley) 06/06/93
7.\"
8.Dd
9.Dt KGMON 8
10.Os BSD 4.2
11.Sh NAME
12.Nm kgmon
13.Nd generate a dump of the operating system's profile buffers
14.Sh SYNOPSIS
15.Nm kgmon
16.Op Fl bhpr
17.Op Fl M core
18.Op Fl N system
19.Sh DESCRIPTION
20.Nm Kgmon
21is a tool used when profiling the operating system.
22When no arguments are supplied,
23.Nm kgmon
24indicates the state of operating system profiling as running,
25off, or not configured.
26(see
27.Xr config 8 )
28If the
29.Fl p
30flag is specified,
31.Nm kgmon
32extracts profile data from the operating system and produces a
33.Pa gmon.out
34file suitable for later analysis by
35.Xr gprof 1 .
36.Pp
37The options are as follows:
38.Bl -tag -width Ds
39.It Fl b
40Resume the collection of profile data.
41.It Fl h
42Stop the collection of profile data.
43.It Fl p
44Dump the contents of the profile buffers into a
45.Pa gmon.out
46file.
47.It Fl r
48Reset all the profile buffers.
49If the
50.Fl p
51flag is also specified, the
52.Pa gmon.out
53file is generated before the buffers are reset.
54.It Fl M
55Extract values associated with the name list from the specified core
56instead of the default ``/dev/kmem''.
57.It Fl N
58Extract the name list from the specified system instead of the
59default ``/vmunix''.
60.El
61.Pp
62If neither
63.Fl b
64nor
65.Fl h
66is specified, the state of profiling collection remains unchanged.
67For example, if the
68.Fl p
69flag is specified and profile data is being collected,
70profiling will be momentarily suspended,
71the operating system profile buffers will be dumped,
72and profiling will be immediately resumed.
73.Sh FILES
74.Bl -tag -width /dev/kmemx -compact
75.It Pa /vmunix
76the default system
77.It Pa /dev/kmem
78the default memory
79.El
80.Sh SEE ALSO
81.Xr gprof 1 ,
82.Xr config 8
83.Sh DIAGNOSTICS
84Users with only read permission on
85.Pa /dev/kmem
86cannot change the state
87of profiling collection.
88They can get a
89.Pa gmon.out
90file with the warning that the data may be
91inconsistent if profiling is in progress.
92.Sh HISTORY
93The
94.Nm
95command appeared in
96.Bx 4.2 .
97