| @@ -1,123 +1,125 @@ | | | @@ -1,123 +1,125 @@ |
1 | .\" $NetBSD: kgmon.8,v 1.18 2005/06/20 13:25:26 peter Exp $ | | 1 | .\" $NetBSD: kgmon.8,v 1.19 2011/04/25 22:46:35 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1983, 1991, 1993 | | 3 | .\" Copyright (c) 1983, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" 3. Neither the name of the University nor the names of its contributors | | 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 | | 15 | .\" may be used to endorse or promote products derived from this software |
16 | .\" without specific prior written permission. | | 16 | .\" without specific prior written permission. |
17 | .\" | | 17 | .\" |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | | 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 | | 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 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 | | 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 | | 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 | | 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 | .\" SUCH DAMAGE. | | 28 | .\" SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .\" from: @(#)kgmon.8 8.1 (Berkeley) 6/6/93 | | 30 | .\" from: @(#)kgmon.8 8.1 (Berkeley) 6/6/93 |
31 | .\" | | 31 | .\" |
32 | .Dd June 6, 1993 | | 32 | .Dd June 6, 1993 |
33 | .Dt KGMON 8 | | 33 | .Dt KGMON 8 |
34 | .Os | | 34 | .Os |
35 | .Sh NAME | | 35 | .Sh NAME |
36 | .Nm kgmon | | 36 | .Nm kgmon |
37 | .Nd generate a dump of the operating system's profile buffers | | 37 | .Nd generate a dump of the operating system's profile buffers |
38 | .Sh SYNOPSIS | | 38 | .Sh SYNOPSIS |
39 | .Nm | | 39 | .Nm |
40 | .Op Fl bdhpr | | 40 | .Op Fl bdhpr |
41 | .Op Fl M Ar core | | 41 | .Op Fl M Ar core |
42 | .Op Fl N Ar system | | 42 | .Op Fl N Ar system |
43 | .Sh DESCRIPTION | | 43 | .Sh DESCRIPTION |
44 | .Nm | | 44 | .Nm |
45 | is a tool used when profiling the operating system. | | 45 | is a tool used when profiling the operating system. |
46 | When no arguments are supplied, | | 46 | When no arguments are supplied, |
47 | .Nm | | 47 | .Nm |
48 | indicates the state of operating system profiling as running, | | 48 | indicates the state of operating system profiling as running, |
49 | off, or not configured | | 49 | off, or not configured |
50 | (see | | 50 | (see |
51 | .Xr config 1 ) . | | 51 | .Xr config 1 ) . |
52 | If the | | 52 | If the |
53 | .Fl p | | 53 | .Fl p |
54 | flag is specified, | | 54 | flag is specified, |
55 | .Nm | | 55 | .Nm |
56 | extracts profile data from the operating system and produces a | | 56 | extracts profile data from the operating system and produces a |
57 | .Pa gmon.out | | 57 | .Pa gmon.out |
58 | file suitable for later analysis by | | 58 | file suitable for later analysis by |
59 | .Xr gprof 1 . | | 59 | .Xr gprof 1 . |
60 | .Pp | | 60 | .Pp |
61 | The options are as follows: | | 61 | The options are as follows: |
62 | .Bl -tag -width Ds | | 62 | .Bl -tag -width Ds |
63 | .It Fl b | | 63 | .It Fl b |
64 | Resume the collection of profile data. | | 64 | Resume the collection of profile data. |
65 | .It Fl d | | 65 | .It Fl d |
66 | Enable debug output. | | 66 | Enable debug output. |
67 | .It Fl h | | 67 | .It Fl h |
68 | Stop the collection of profile data. | | 68 | Stop the collection of profile data. |
69 | .It Fl M | | 69 | .It Fl M Ar core |
70 | Extract values associated with the name list from the specified core | | 70 | Extract values associated with the name list from the specified |
| | | 71 | .Ar core |
71 | instead of the default | | 72 | instead of the default |
72 | .Pa /dev/kmem . | | 73 | .Pa /dev/kmem . |
73 | .It Fl N | | 74 | .It Fl N Ar system |
74 | Extract the name list from the specified system instead of the | | 75 | Extract the name list from the specified |
75 | default | | 76 | .Ar system |
| | | 77 | instead of the default |
76 | .Pa /netbsd . | | 78 | .Pa /netbsd . |
77 | .It Fl p | | 79 | .It Fl p |
78 | Dump the contents of the profile buffers into a | | 80 | Dump the contents of the profile buffers into a |
79 | .Pa gmon.out | | 81 | .Pa gmon.out |
80 | file. | | 82 | file. |
81 | .It Fl r | | 83 | .It Fl r |
82 | Reset all the profile buffers. | | 84 | Reset all the profile buffers. |
83 | If the | | 85 | If the |
84 | .Fl p | | 86 | .Fl p |
85 | flag is also specified, the | | 87 | flag is also specified, the |
86 | .Pa gmon.out | | 88 | .Pa gmon.out |
87 | file is generated before the buffers are reset. | | 89 | file is generated before the buffers are reset. |
88 | .El | | 90 | .El |
89 | .Pp | | 91 | .Pp |
90 | If neither | | 92 | If neither |
91 | .Fl b | | 93 | .Fl b |
92 | nor | | 94 | nor |
93 | .Fl h | | 95 | .Fl h |
94 | is specified, the state of profiling collection remains unchanged. | | 96 | is specified, the state of profiling collection remains unchanged. |
95 | For example, if the | | 97 | For example, if the |
96 | .Fl p | | 98 | .Fl p |
97 | flag is specified and profile data is being collected, | | 99 | flag is specified and profile data is being collected, |
98 | profiling will be momentarily suspended, | | 100 | profiling will be momentarily suspended, |
99 | the operating system profile buffers will be dumped, | | 101 | the operating system profile buffers will be dumped, |
100 | and profiling will be immediately resumed. | | 102 | and profiling will be immediately resumed. |
101 | .Sh FILES | | 103 | .Sh FILES |
102 | .Bl -tag -width /dev/kmemx -compact | | 104 | .Bl -tag -width /dev/kmemx -compact |
103 | .It Pa /netbsd | | 105 | .It Pa /netbsd |
104 | the default system | | 106 | the default system |
105 | .It Pa /dev/kmem | | 107 | .It Pa /dev/kmem |
106 | the default memory | | 108 | the default memory |
107 | .El | | 109 | .El |
108 | .Sh DIAGNOSTICS | | 110 | .Sh DIAGNOSTICS |
109 | Users with only read permission on | | 111 | Users with only read permission on |
110 | .Pa /dev/kmem | | 112 | .Pa /dev/kmem |
111 | cannot change the state of profiling collection. | | 113 | cannot change the state of profiling collection. |
112 | They can get a | | 114 | They can get a |
113 | .Pa gmon.out | | 115 | .Pa gmon.out |
114 | file with the warning that the data may be | | 116 | file with the warning that the data may be |
115 | inconsistent if profiling is in progress. | | 117 | inconsistent if profiling is in progress. |
116 | .Sh SEE ALSO | | 118 | .Sh SEE ALSO |
117 | .Xr config 1 , | | 119 | .Xr config 1 , |
118 | .Xr gprof 1 | | 120 | .Xr gprof 1 |
119 | .Sh HISTORY | | 121 | .Sh HISTORY |
120 | The | | 122 | The |
121 | .Nm | | 123 | .Nm |
122 | command appeared in | | 124 | command appeared in |
123 | .Bx 4.2 . | | 125 | .Bx 4.2 . |