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