This section is based on catpages contributed by Mainichi Communications, Inc. Translated by: MYCOM team Converted by: Japanese Online Manual Project <man-jp@jp.FreeBSD.ORG> Submitted by: Kazuo Horikawa <k-horik@yk.rim.or.jp>
105 lines
3.8 KiB
Groff
105 lines
3.8 KiB
Groff
.\" Copyright (c) 1980, 1991, 1992, 1993
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" @(#)moncontrol.3 8.1 (Berkeley) 6/4/93
|
|
.\"
|
|
.Dd June 4, 1993
|
|
.Dt MONCONTROL 3
|
|
.Os BSD 4
|
|
.Sh 名称
|
|
.Nm moncontrol ,
|
|
.Nm monstartup
|
|
.Nd 実行プロファイルの制御
|
|
.Sh 書式
|
|
.Fd #include <sys/types.h>
|
|
.Ft int
|
|
.Fn moncontrol "int mode"
|
|
.Ft int
|
|
.Fn monstartup "u_long *lowpc" "u_long *highpc"
|
|
.Sh 解説
|
|
.Xr cc 1
|
|
の
|
|
.Fl pg
|
|
オプションでコンパイルした実行可能プログラムには、
|
|
.Xr gprof 1
|
|
呼出しグラフ実行プロファイラの統計情報を収集するための関数呼出しが自動的に
|
|
組み込まれます。典型的なオペレーションの場合、プロファイル採取はプログラムの
|
|
起動時に始まり、プログラム呼出しが終了したときに終わります。プログラムが
|
|
終了すると、プロファイリングデータはファイル
|
|
.Em progname.gmon
|
|
に書き込まれ (progname はプログラムの名前)、
|
|
.Xr gprof 1
|
|
で結果が検査されます。
|
|
.Pp
|
|
.Fn moncontrol
|
|
は、プログラムでのプロファイル取得を選択的に制御します。
|
|
プロファイル取得は、プログラムが起動されると始まります。
|
|
ヒストグラムティック値と関数呼び出し回数の収集を止めるには
|
|
.Fn moncontrol 0
|
|
を使用し、ヒストグラムティック値と関数呼び出し回数の収集を再開するには
|
|
.Fn moncontrol 1
|
|
を使用します。この機能により、特定のオペレーションのコストが計測できます。
|
|
プログラムの終了時には、
|
|
.Fn moncontrol
|
|
の状態に関係なく出力ファイルが作成されることに注意してください。
|
|
.Pp
|
|
.Fl pg
|
|
でロードしていないプログラムでも、プロファイルを取得する
|
|
アドレスの範囲を指定して
|
|
.Fn monstartup
|
|
を呼び出し、プロファイリング統計情報を選択的に収集することができます。
|
|
サンプル抽出するアドレスの範囲は、
|
|
.Fa lowpc
|
|
と
|
|
.Fa highpc
|
|
で指定します。
|
|
サンプル抽出される最下位アドレスは
|
|
.Fa lowpc
|
|
で、最上位アドレスは
|
|
.Fa highpc
|
|
のすぐ下になります。出力の呼出しグラフに表示されるのは、この範囲のうち、
|
|
.Xr cc 1
|
|
の
|
|
.Fl pg
|
|
オプションでコンパイルした関数のみですが、実行時間が計測されるのは、
|
|
このアドレス範囲のすべての関数です。プロファイル採取は、
|
|
.Fn monstartup
|
|
から戻ったときに始まります。
|
|
.Sn 関連ファイル
|
|
.Bl -tag -width Pa -compact
|
|
.It Pa progname.gmon 実行データファイル
|
|
.El
|
|
.Sh 関連項目
|
|
.Xr cc 1 ,
|
|
.Xr gprof 1 ,
|
|
.Xr profil 2 ,
|
|
.Xr clocks 7
|
|
.\"kuma 1999-11-12
|