1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
|
.\" Copyright (c) 1983, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement: ``This product includes software developed by the
.\" University of California, Berkeley and its contributors'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of the University nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\" @(#)gprof.1 6.6 (Berkeley) 7/24/90
.\"
.\" Japanese Version Copyright (c) 1997-2000 NAKANO Takeo all rights reserved.
.\" Translated Fri Jan 9 1998 by NAKANO Takeo <nakano@@apm.seikei.ac.jp>
.\" Updated Fri 27 Oct 2000 by NAKANO Takeo
.\"
.TH GPROF 1 "January 29, 1993"
.SH ̾
gprof \- 롦 (call graph) Υץեɽ
.SH
.B gprof [ \-abcsz ] [ \-e|\-E
.I name
.B ] [ \-f|\-F
.I name
.B ]
.B [ \-k
.I fromname toname
.B ] [
.I objfile
.B [
.I gmon.out
.B ]
.B ]
.SH
.B gprof
C, Pascal, Fortran77 ץμ¹ԥץե롣Ƥӽ
줿롼ͤϸƤӽФ˼ޤ롣ץեΤΥǡ
ϥ롦 (call graph: ؿοƻҴطΥ) Υץե
ǡե (ǥեȤǤ `gmon.out')
ޤ롣Υե
.BR cc ( 1 )
.BR pc ( 1 )
.BR f77 ( 1 )
.B \-pg
ץꤷƥѥ뤵줿ץˤäƺ롣
.B \-pg
ץǤϡ饤֥ץեѤ˥ѥ뤵
Τˤʤ롣
.B gprof
ϻꤵ줿֥ȥե (ǥեȤ `a.out') 饷
ơ֥ɤߡ `gmon.out' Υ롦աץեȤ
Ϣդ롣
ʣΥץեǡե뤬ꤵ줿ˤϡ
.B gprof
ϤΥץե٤ƹפɽ롣
.PP
.B gprof
Ϥ줾Υ롼ˤäƾ줿֤롣ˤλ
롦դλޤ˱äƿƥ롼ؤŤ롣ץ
(cycle: ƵƤӽФν۴) ޤȤᡢؤΥԤ
롼ϡǾ֤ͭȤߤʤǽΥꥹȤ
ؿǡ֤ν˥ȤƤ롣
֤ˤϥ롦դǤλ¹ʬޤޤ롣줾δؿȥ
βˤϡδؿΥ롦դǤ (ľܤ) ҤȡǾ줿
֤ɤΤ褦˴ؿŤɽ롣Ʊͤɽϴؿξˤ
ɽƤꡢδؿȤλ¹Ǿ줿֤ɤΤ褦˥
롦դ (ľܤ) ƤŤ뤫롣
.PP
ɽ롣ΤȤƤΥȥꡢΥ°
СΥꥹȤȤ줾ΥСˤäƾ줿֡
θƤӽФʤɤɽ롣
.PP
˥եåȥץե
.RB ( prof (1)
η̤Ȼ) Ϳ롣ΥꥹȤǤϹ¹Ի֡ƤӽФ
Υ롼ȤǾ (ߥñ)¹ʬޤƾ
(ߥñ) ɽ롣
.PP
Ǹ˴ؿ̾κͿ롣
.SH ץ
ʲΥץǤ:
.TP
.B \-a
ƥå줿ؿɽʤΥץꤵ
ȡƥåʴؿ˴ؤƤξ (¹Ի֡¾δؿθƤӽ
¾δؿƤӽФطʤ) ϡե `objfile' Ǥ
ƥåʴؿľ˥ɤ줿ؿ°뤳Ȥˤʤ롣
.TP
.B \-b
ץեΤ줾Υեɤ˴ؤɽʤ
.TP
.B \-c
ץΥƥåʥ롦դ֥ȥեΥƥ
ȥȤĴ٤ȤȯŪ (heuristic) ʼˡǺ롣
ƥåοƤҤθƤӽФ 0 Ȥɽ롣
.TP
.BI "\-e " name
롼
.I name
ȡλ¹٤Ƥ˴ؤ륰եץեΥȥɽʤ
(¹˴ؤƤϡ̤褬ɽ)
.B \-e
ץʣǤ롣Ĥ
.B \-e
ץˤĤƻǤ
.I name
ϰĤǤ롣
.TP
.BI "\-E " name
.B \-e
Ʊͤ˥롼
.I name
Ȥλ¹˴ؤ륰եץեΥȥɽʤޤ
.I name
(Ȥλ¹) ˤäƾ줿֤⡢ץ¹Ԥ (
ѡơη) 롣㤨
.BI "\-E " mcount
.BI "\-E " mcleanup
ϥǥեȤˤʤäƤ롣
.TP
.BI "\-f " name
롼
.I name
Ȥλ¹˴ؤƤΤߡեץեΥȥɽ롣
.B \-f
ץʣǤ롣Ĥ
.B \-f
ץˤĤƻǤ
.I name
ϰĤǤ롣
.TP
.BI "\-F " name
.B \-f
Ʊͤˡ롼
.I name
Ȥλ¹˴ؤƤΤߡեץեΥȥɽ롣ޤ
ˤäѤ줿֤פμ¹Ի֤ȥѡơη
Ѥ롣
.B \-F
ץʣǤ롣Ĥ
.B \-F
ץˤĤƻǤ
.I name
ϰĤǤ롣
.B \-F
ץ
.B \-E
ץˤ롣
.TP
.BI "\-k " "fromname toname"
롼
.I fromname
롼
.I toname
ޤǤλޤ롣פʥν۴Ĥ˲ΤǤ롣
.B \-k
ʣǤ롣Ĥ
.B \-k
ץФƻǤΤϰȤΥ롼̾Ǥ롣
.TP
.B \-s
ץեե `gmon.sum' ꤷץեե
ξ٤ƤΥץեפΤࡣιץ
եեϸ gprof (餯
.B \-s
ȶ) ¹ԤݤͿơ `objfile' եʣ¹Ԥ
ץեǡѤ뤿Ѥ뤳ȤǤ롣
.TP
.B \-v
gprof ΥСֹɽƽλ롣
.TP
.B \-z
Ѥʤäؿ (ƤӽФȼ¹Ի֤Ǥ狼) ɽ롣
.B \-c
ץȶѤȡƤӽФʤä롼ĤΤ
Ωġ
.PP
.SH ե
a.out ̾ΥꥹȤȥƥȶ
.br
gmon.out ʥߥåʥ롦դȥץե
.br
gmon.sum ʥߥåʥ롦դȥץեΤޤȤ
.SH Ϣ
.BR monitor ( 3 ) ,
.BR profil ( 2 ) ,
.BR cc ( 1 ) ,
.BR prof ( 1 )
.sp
``An Execution Profiler for Modular Programs'',
by S. Graham, P. Kessler, M. McKusick;
.I
Software \- Practice and Experience,
Vol. 13, pp. 671-685, 1983.
.sp
``gprof: A Call Graph Execution Profiler'',
by S. Graham, P. Kessler, M. McKusick;
.I
Proceedings of the SIGPLAN '82 Symposium on Compiler Construction,
SIGPLAN Notices, Vol. 17, No 6, pp. 120-126, June 1982.
.SH
.B gprof
4.2 BSD о줷
.SH Х
ץγ (granularity) ɽ뤬Ūʤ
ǤʤǤϴؿΰμ¹Ի֤ϡؿξ
֤ƤӽФdzäΤȲꤷƤ롣äơƤӽФդ
ޤŤƴؿοƤ֤ϡޤ̲ᤷľ㤹뤳
ˤʤ롣
.PP
ʬȤץե뤵ƤʤƤǤ⡢ҤŤƤ֤ͭ
뤳Ȥˤʤ롣Υ롼ϡƤӽФդ (ɤ
ƤӽФ줿ΤǤʤ) ˵ư褦˸Τǡλ֤Ϥ
ʾɤؤŤʤƱͤˡʥå롼ϡ
ե뤵ƤƤ⾡˵ư褦˸Ƥޤ (ͳϤ⤦
ʣ)ʥå롼λҤץե뤵Ƥ
Фλ֤Ť뤳ȤǤ뤬ƥ롼ץե
롼ǥʥ뤬å줿ˤƤξϼ롣
.PP
ץե뤵ץ
.BR exit ( 2 )
뤷ƽλ뤫 main 롼 return ǽλʤФ
ʤʤȽλ˥ץե `gmon.out' ե˥
֤ʤ
|