1 .\" Copyright (c) 1983, 1990 The Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms are permitted provided
5 .\" that: (1) source distributions retain this entire copyright notice and
6 .\" comment, and (2) distributions including binaries display the following
7 .\" acknowledgement: ``This product includes software developed by the
8 .\" University of California, Berkeley and its contributors'' in the
9 .\" documentation or other materials provided with the distribution and in
10 .\" all advertising materials mentioning features or use of this software.
11 .\" Neither the name of the University nor the names of its contributors may
12 .\" be used to endorse or promote products derived from this software without
13 .\" specific prior written permission.
14 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
15 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
16 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 .\" @(#)gprof.1 6.6 (Berkeley) 7/24/90
20 .\" Japanese Version Copyright (c) 1997-2000 NAKANO Takeo all rights reserved.
21 .\" Translated Fri Jan 9 1998 by NAKANO Takeo <nakano@@apm.seikei.ac.jp>
22 .\" Updated Fri 27 Oct 2000 by NAKANO Takeo
24 .TH GPROF 1 "January 29, 1993"
26 .\"O gprof \- display call graph profile data
28 gprof \- コール・グラフ (call graph) のプロファイルを表示する
31 .B gprof [ \-abcsz ] [ \-e|\-E
47 .\"O produces an execution profile of C, Pascal, or Fortran77 programs.
48 .\"O The effect of called routines is incorporated in the profile of each caller.
49 .\"O The profile data is taken from the call graph profile file
50 .\"O \&(`gmon.out' default) which is created by programs
51 .\"O that are compiled with the
59 は C, Pascal, Fortran77 プログラムの実行プロファイルを生成する。呼び出
60 されたルーチンの値は呼び出し元に取り込まれる。プロファイルのためのデー
61 タはコール・グラフ (call graph: 関数コールの親子関係のグラフ) のプロファ
62 イルデータファイル (デフォルトでは `gmon.out') から取り
69 オプションを指定してコンパイルされたプログラムによって作成される。
72 .\"O option also links in versions of the library routines
73 .\"O that are compiled for profiling.
75 .\"O reads the given object file (the default is `a.out')
76 .\"O and establishes the relation between its symbol table
77 .\"O and the call graph profile from `gmon.out'.
78 .\"O If more than one profile file is specified,
81 .\"O output shows the sum of the profile information in the given profile files.
83 オプションでは、リンクされるライブラリもプロファイル用にコンパイルされ
86 は指定されたオブジェクトファイル (デフォルトは `a.out') からシンボ
87 ルテーブルを読み、これと `gmon.out' のコール・グラフ・プロファイルとを
89 複数のプロファイルデータファイルが指定された場合には、
91 はそれらのプロファイル情報をすべて合計して表示する。
94 .\"O calculates the amount of time spent in each routine.
95 .\"O Next, these times are propagated along the edges of the call graph.
96 .\"O Cycles are discovered, and calls into a cycle are made to share the time
98 .\"O The first listing shows the functions
99 .\"O sorted according to the time they represent
100 .\"O including the time of their call graph descendants.
101 .\"O Below each function entry is shown its (direct) call graph children,
102 .\"O and how their times are propagated to this function.
103 .\"O A similar display above the function shows how this function's time and the
104 .\"O time of its descendants is propagated to its (direct) call graph parents.
106 はそれぞれのルーチンによって消費された時間を計算する。次にこれらの時間
107 をコール・グラフの枝に沿って親ルーチンへと伝播させる。プログラムの
108 サイクル (cycle: 再帰呼び出しの循環) をまとめ、サイクルへのコールを行っ
109 たルーチンは、サイクルで消費した時間を共有するとみなす。最初のリストは
111 消費時間にはコール・グラフでの子孫の分も含まれる。それぞれの関数エントリ
112 の下には、その関数のコール・グラフでの (直接の) 子と、そこで消費された
113 時間がどのように関数に伝播したかが表示される。同様の表示は関数の上にも
114 表示されており、その関数とそれらの子孫で消費された時間がどのようにコー
115 ル・グラフの (直接の) 親へ伝播するかが示される。
117 .\"O Cycles are also shown, with an entry for the cycle as a whole and
118 .\"O a listing of the members of the cycle and their contributions to the
119 .\"O time and call counts of the cycle.
120 サイクルも表示される。サイクル全体としてのエントリ、そのサイクルに属す
121 るメンバーのリストとそれぞれのメンバーによって消費された時間、その
124 .\"O Second, a flat profile is given,
125 .\"O similar to that provided by
126 .\"O .BR prof ( 1 ) .
127 .\"O This listing gives the total execution times, the call counts,
128 .\"O the time in milliseconds the call spent in the routine itself, and
129 .\"O the time in milliseconds the call spent in the routine itself including
130 .\"O its descendants.
133 の結果と似たもの) が与えられる。このリストでは合計実行時間、呼び出し回
134 数、そのルーチン自身で消費した時間 (ミリ秒単位)、子孫の分も含めて消費
137 .\"O Finally, an index of the function names is provided.
141 .\"O The following options are available:
145 .\"O suppresses the printing of statically declared functions.
146 .\"O If this option is given, all relevant information about the static function
147 .\"O (e.g., time samples, calls to other functions, calls from other functions)
148 .\"O belongs to the function loaded just before the static function in the
149 .\"O \&`objfile' file.
150 スタティックに宣言された関数を表示しない。このオプションが指定され
151 ると、スタティックな関数に関する全ての情報 (実行時間、他の関数の呼び出
152 し、他の関数から呼び出される関係など) は、ファイル `objfile' 中でこの
153 スタティックな関数の直前にロードされた関数に属することになる。
156 .\"O suppresses the printing of a description of each field in the profile.
157 プロファイルのそれぞれのフィールドに関する説明を表示しない。
160 .\"O the static call graph of the program is discovered by a heuristic
161 .\"O that examines the text space of the object file.
162 .\"O Static-only parents or children are shown
163 .\"O with call counts of 0.
164 プログラムのスタティックなコール・グラフを、オブジェクトファイルのテキ
165 ストセグメントを調べるという発見的 (heuristic) な手法で作成する。ス
166 タティック・コールだけの親や子の呼び出し回数は 0 として表示する。
169 .\"O suppresses the printing of the graph profile entry for routine
171 .\"O and all its descendants
172 .\"O (unless they have other ancestors that aren't suppressed).
175 .\"O option may be given.
178 .\"O may be given with each
183 と、その子孫すべてに関するグラフプロファイルのエントリを表示しない
184 (子孫に関しては、別の祖先がいれば表示される)。
193 .\"O suppresses the printing of the graph profile entry for routine
195 .\"O (and its descendants) as
197 .\"O above, and also excludes the time spent in
199 .\"O (and its descendants) from the total and percentage time computations.
201 .\"O .BI "\-E " mcount
202 .\"O .BI "\-E " mcleanup
203 .\"O is the default.)
207 とその子孫に関するグラフプロファイルのエントリを表示しない。また
209 (とその子孫) によって消費された時間も、プログラム実行の総時間 (および
210 パーセンテージの計算) から除かれる。例えば
216 .\"O prints the graph profile entry of only the specified routine
218 .\"O and its descendants.
221 .\"O option may be given.
224 .\"O may be given with each
229 とその子孫に関してのみ、グラフプロファイルのエントリを表示する。
238 .\"O prints the graph profile entry of only the routine
240 .\"O and its descendants (as
242 .\"O above) and also uses only the times of the printed routines
243 .\"O in total time and percentage computations.
246 .\"O option may be given.
249 .\"O may be given with each
262 とその子孫に関してのみ、グラフプロファイルのエントリを表示する。またこ
263 れらによって用いられた時間だけを合計の実行時間とパーセンテージの計算に
276 .BI "\-k " "fromname toname"
277 .\"O will delete any arcs from routine
281 .\"O This can be used to break undesired cycles.
284 .\"O option may be given.
285 .\"O Only one pair of routine names may be given with each
292 までの枝を削除する。これは不要なサイクルの循環を破壊するのに便利である。
296 オプションに対して指定できるのは一組のルーチン名だけである。
299 .\"O a profile file `gmon.sum' is produced that represents
300 .\"O the sum of the profile information in all the specified profile files.
301 .\"O This summary profile file may be given to later
302 .\"O executions of gprof (probably also with a
304 .\"O to accumulate profile data across several runs of an `objfile' file.
305 プロファイルファイル `gmon.sum' を作成し、指定したプロファイルファイル
306 の情報すべてからのプロファイル情報を総計したものを書き込む。この合計プ
307 ロファイルファイルは後に gprof を (おそらくは
309 と共に) 実行する際に与えて、 `objfile' ファイルを複数回実行して得られ
310 たプロファイルデータを累積するために用いることもできる。
314 .\"O prints the version number for gprof, and then exits.
315 gprof のバージョン番号を表示して終了する。
319 .\"O displays routines that have zero usage (as shown by call counts
320 .\"O and accumulated time).
321 .\"O This is useful with the
323 .\"O option for discovering which routines were never called.
324 用いられなかった関数 (呼び出し回数と実行時間でわかる) も表示する。これ
327 オプションと共に用いると、呼び出されなかったルーチンを見つけるのに役
332 .\"O .ta \w'gmon.sum 'u
333 .\"O a.out the namelist and text space.
336 .\"O gmon.out dynamic call graph and profile.
337 gmon.out ダイナミックなコール・グラフとプロファイル
339 .\"O gmon.sum summarized dynamic call graph and profile.
340 gmon.sum ダイナミックなコール・グラフとプロファイルのまとめ
349 ``An Execution Profiler for Modular Programs'',
350 by S. Graham, P. Kessler, M. McKusick;
352 Software \- Practice and Experience,
353 Vol. 13, pp. 671-685, 1983.
355 ``gprof: A Call Graph Execution Profiler'',
356 by S. Graham, P. Kessler, M. McKusick;
358 Proceedings of the SIGPLAN '82 Symposium on Compiler Construction,
359 SIGPLAN Notices, Vol. 17, No 6, pp. 120-126, June 1982.
364 .\"O appeared in 4.2 BSD.
369 .\"O The granularity of the sampling is shown, but remains
370 .\"O statistical at best.
371 .\"O We assume that the time for each execution of a function
372 .\"O can be expressed by the total time for the function divided
373 .\"O by the number of times the function is called.
374 .\"O Thus the time propagated along the call graph arcs to the function's
375 .\"O parents is directly proportional to the number of times that
376 .\"O arc is traversed.
377 サンプリングの粒度 (granularity) も表示されるが、せいぜい統計的なもの
378 でしかない。ここでは関数の一回あたりの実行時間は、関数の消費した合計時
379 間を呼び出し回数で割ったものと仮定している。したがって、呼び出しグラフの
380 枝を伝播して関数の親に伝わる時間は、枝を通過した回数に直に比例すること
383 .\"O Parents that are not themselves profiled will have the time of
384 .\"O their profiled children propagated to them, but they will appear
385 .\"O to be spontaneously invoked in the call graph listing, and will
386 .\"O not have their time propagated further.
387 .\"O Similarly, signal catchers, even though profiled, will appear
388 .\"O to be spontaneous (although for more obscure reasons).
389 .\"O Any profiled children of signal catchers should have their times
390 .\"O propagated properly, unless the signal catcher was invoked during
391 .\"O the execution of the profiling routine, in which case all is lost.
392 自分自身がプロファイルされていない親でも、子から伝播してくる時間を保有
393 することになる。しかしこれらのルーチンは、呼び出しグラフの中で (どこか
394 ら呼び出されたのでもなく) 勝手に起動するように見えるので、その時間はそ
395 れ以上どこへも伝播しない。同様に、シグナルをキャッチしたルーチンは、プ
396 ロファイルされていても勝手に起動するように見えてしまう (理由はもう少し
397 複雑だが)。シグナルをキャッチしたルーチンの子がプロファイルされてい
398 ればその時間を正しく伝播させることができるが、親ルーチンがプロファ
399 イルルーチンの途中でシグナルがキャッチされた場合には全ての情報は失われる。
401 .\"O The profiled program must call
403 .\"O or return normally for the profiling information to be saved
404 .\"O in the `gmon.out' file.
407 をコールして終了するか、 main ルーチンからの return で終了しなければな
408 らない。さもないと終了時にプロファイル情報が `gmon.out' ファイルにセー