xref: /original-bsd/usr.sbin/kgmon/kgmon.8 (revision 8ac6efdd)
1*8ac6efddSbostic.\" Copyright (c) 1983, 1991, 1993
2*8ac6efddSbostic.\"	The Regents of the University of California.  All rights reserved.
31efe90faSmckusick.\"
4a0ffcc67Strent.\" %sccs.include.redist.man%
5728bdb68Sbostic.\"
6*8ac6efddSbostic.\"     @(#)kgmon.8	8.1 (Berkeley) 06/06/93
71efe90faSmckusick.\"
813251ec2Scael.Dd
913251ec2Scael.Dt KGMON 8
1013251ec2Scael.Os BSD 4.2
1113251ec2Scael.Sh NAME
1213251ec2Scael.Nm kgmon
1313251ec2Scael.Nd generate a dump of the operating system's profile buffers
1413251ec2Scael.Sh SYNOPSIS
1513251ec2Scael.Nm kgmon
160d88cba0Sbostic.Op Fl bhpr
170d88cba0Sbostic.Op Fl M core
180d88cba0Sbostic.Op Fl N system
1913251ec2Scael.Sh DESCRIPTION
2013251ec2Scael.Nm Kgmon
211efe90faSmckusickis a tool used when profiling the operating system.
221efe90faSmckusickWhen no arguments are supplied,
2313251ec2Scael.Nm kgmon
241efe90faSmckusickindicates the state of operating system profiling as running,
251efe90faSmckusickoff, or not configured.
261efe90faSmckusick(see
2713251ec2Scael.Xr config 8 )
281efe90faSmckusickIf the
2913251ec2Scael.Fl p
301efe90faSmckusickflag is specified,
3113251ec2Scael.Nm kgmon
321efe90faSmckusickextracts profile data from the operating system and produces a
3313251ec2Scael.Pa gmon.out
341efe90faSmckusickfile suitable for later analysis by
3513251ec2Scael.Xr gprof 1 .
3613251ec2Scael.Pp
370d88cba0SbosticThe options are as follows:
3813251ec2Scael.Bl -tag -width Ds
3913251ec2Scael.It Fl b
401efe90faSmckusickResume the collection of profile data.
4113251ec2Scael.It Fl h
421efe90faSmckusickStop the collection of profile data.
4313251ec2Scael.It Fl p
441efe90faSmckusickDump the contents of the profile buffers into a
4513251ec2Scael.Pa gmon.out
461efe90faSmckusickfile.
4713251ec2Scael.It Fl r
481efe90faSmckusickReset all the profile buffers.
491efe90faSmckusickIf the
5013251ec2Scael.Fl p
511efe90faSmckusickflag is also specified, the
5213251ec2Scael.Pa gmon.out
531efe90faSmckusickfile is generated before the buffers are reset.
540d88cba0Sbostic.It Fl M
550d88cba0SbosticExtract values associated with the name list from the specified core
560d88cba0Sbosticinstead of the default ``/dev/kmem''.
570d88cba0Sbostic.It Fl N
580d88cba0SbosticExtract the name list from the specified system instead of the
590d88cba0Sbosticdefault ``/vmunix''.
6013251ec2Scael.El
6113251ec2Scael.Pp
621efe90faSmckusickIf neither
6313251ec2Scael.Fl b
641efe90faSmckusicknor
6513251ec2Scael.Fl h
661efe90faSmckusickis specified, the state of profiling collection remains unchanged.
671efe90faSmckusickFor example, if the
6813251ec2Scael.Fl p
691efe90faSmckusickflag is specified and profile data is being collected,
701efe90faSmckusickprofiling will be momentarily suspended,
711efe90faSmckusickthe operating system profile buffers will be dumped,
721efe90faSmckusickand profiling will be immediately resumed.
7313251ec2Scael.Sh FILES
7413251ec2Scael.Bl -tag -width /dev/kmemx -compact
7513251ec2Scael.It Pa /vmunix
7613251ec2Scaelthe default system
7713251ec2Scael.It Pa /dev/kmem
7813251ec2Scaelthe default memory
7913251ec2Scael.El
8013251ec2Scael.Sh SEE ALSO
8113251ec2Scael.Xr gprof 1 ,
8213251ec2Scael.Xr config 8
8313251ec2Scael.Sh DIAGNOSTICS
8413251ec2ScaelUsers with only read permission on
8513251ec2Scael.Pa /dev/kmem
8613251ec2Scaelcannot change the state
871efe90faSmckusickof profiling collection.
881efe90faSmckusickThey can get a
8913251ec2Scael.Pa gmon.out
901efe90faSmckusickfile with the warning that the data may be
911efe90faSmckusickinconsistent if profiling is in progress.
9213251ec2Scael.Sh HISTORY
9313251ec2ScaelThe
9413251ec2Scael.Nm
9513251ec2Scaelcommand appeared in
9613251ec2Scael.Bx 4.2 .
97