OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / profil.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified Fri Jun 23 01:35:19 1995 Andries Brouwer <aeb@cwi.nl>
26 .\" (prompted by Bas V. de Bakker <bas@phys.uva.nl>)
27 .\" Corrected (and moved to man3), 980612, aeb
28 .\"
29 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
30 .\"         all rights reserved.
31 .\" Translated San Feb 23 20:40:50 JST 1997
32 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
33 .\" Modified Sun Jun 21 17:30:21 JST 1998
34 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Updated & Modified Thu Feb 17 00:57:49 JST 2005
36 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
37 .\"
38 .\"WORD:        profile                 ¥×¥í¥Õ¥¡¥¤¥ë
39 .\"WORD:        kernel                  ¥«¡¼¥Í¥ë
40 .\"WORD:        implement               ¼ÂÁõ
41 .\"WORD:        library                 ¥é¥¤¥Ö¥é¥ê
42 .\"WORD:        core                    ¥á¥â¥ê
43 .\"WORD:        virtual                 ²¾ÁÛ
44 .\"WORD:        word                    ¥ï¡¼¥É
45 .\"WORD:        increment               ¥¤¥ó¥¯¥ê¥á¥ó¥È
46 .\"WORD:        core dump               ¥³¥¢¡¦¥À¥ó¥×
47 .\"
48 .TH PROFIL 3 2007-07-26 "Linux" "Linux Programmer's Manual"
49 .\"O .SH NAME
50 .SH Ì¾Á°
51 .\"O profil \- execution time profile
52 profil \- ¼Â¹Ô»þ´Ö¥×¥í¥Õ¥¡¥¤¥ë (profile)
53 .\"O .SH SYNOPSIS
54 .SH ½ñ¼°
55 .B #include <unistd.h>
56 .sp
57 .BI "int profil(unsigned short *" buf ", size_t " bufsiz \
58 ", size_t " offset ", unsigned int " scale );
59 .sp
60 .in -4n
61 .\"O Feature Test Macro Requirements for glibc (see
62 .\"O .BR feature_test_macros (7)):
63 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
64 .RB ( feature_test_macros (7)
65 »²¾È):
66 .in
67 .sp
68 .BR profil ():
69 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
70 .\"O .SH DESCRIPTION
71 .SH ÀâÌÀ
72 .\"O This routine provides a means to find out in what areas your program
73 .\"O spends most of its time.
74 .\"O The argument
75 .\"O .I buf
76 .\"O points to
77 .\"O .I bufsiz
78 .\"O bytes of core.
79 .\"O Every virtual 10 milliseconds, the user's program counter (PC)
80 .\"O is examined:
81 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¥×¥í¥°¥é¥à¤Î¤É¤³¤ÎÉôʬ¤Ç»þ´Ö¤òÈñ¤ä¤·¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë
82 ¼êÃʤòÄ󶡤¹¤ë¡£°ú¤­¿ô
83 .I buf
84 ¤Ï
85 .I bufsiz
86 ¥Ð¥¤¥È¤Î¥á¥â¥ê¤ò»Ø¤·¤Æ¤¤¤ë¡£²¾ÁۤΠ10 ¥ß¥êÉ䴤Ȥˡ¢¥æ¡¼¥¶¡¼¤Î
87 ¥×¥í¥°¥é¥à¡¦¥«¥¦¥ó¥¿¡¼ (PC) ¤¬¸¡ºº¤µ¤ì¤ë:
88 .\"O .I offset
89 .\"O is subtracted and the result is multiplied by
90 .\"O .I scale
91 .\"O and divided by 65536.
92 .I offset
93 ¤¬°ú¤«¤ì¡¢¤½¤Î·ë²Ì¤¬
94 .I scale
95 Çܤµ¤ì 65536 ¤Ç³ä¤é¤ì¤ë¡£
96 .\"O If the resulting value is less than
97 .\"O .IR bufsiz ,
98 .\"O then the corresponding entry in
99 .\"O .I buf
100 .\"O is incremented.
101 ·ë²Ì¤¬
102 .I bufsiz
103 ¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ï
104 .I buf
105 ¤ÎÂбþ¤¹¤ë¥¨¥ó¥È¥ê¤¬¥¤¥ó¥¯¥ê¥á¥ó¥È¤µ¤ì¤ë¡£
106 .\"O If
107 .\"O .I buf
108 .\"O is NULL, profiling is disabled.
109 .I buf
110 ¤¬ NULL ¤Ê¤é¤Ð¡¢¥×¥í¥Õ¥¡¥¤¥ë (profile) ¤Ï̵¸ú¤Ë¤µ¤ì¤ë¡£
111 .\"O .SH "RETURN VALUE"
112 .SH ÊÖ¤êÃÍ
113 .\"O Zero is always returned.
114 ¾ï¤Ë 0 ¤¬ÊÖ¤µ¤ì¤ë¡£
115 .\"O .SH "CONFORMING TO"
116 .SH ½àµò
117 .\"O Similar to a call in SVr4 (but not POSIX.1-2001).
118 SVr4 ¤Î¥³¡¼¥ë¤Ë»÷¤Æ¤¤¤ë (¤·¤«¤· POSIX.1-2001 ¤Ç¤Ï¤Ê¤¤)¡£
119 .\"O .SH BUGS
120 .SH ¥Ð¥°
121 .\"O .BR profil ()
122 .\"O cannot be used on a program that also uses
123 .\"O .B ITIMER_PROF
124 .\"O interval timers (see
125 .\"O .BR setitimer (2)).
126 .BR profil ()
127 ¤Ï
128 .B ITIMER_PROF
129 ¥¤¥ó¥¿¡¼¥Ð¥ë¡¦¥¿¥¤¥Þ¡¼¤â»ÈÍѤ·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ç¤Ï»ÈÍѤǤ­¤Ê¤¤
130 .RB ( setitimer (2)
131 »²¾È)¡£
132
133 .\"O True kernel profiling provides more accurate results.
134 .\"O Libc 4.4 contained a kernel patch providing a system call profil.
135 ËÜÅö¤Î¥«¡¼¥Í¥ë¡¦¥×¥í¥Õ¥¡¥¤¥ë¤Ï¤è¤êÀµ³Î¤Ê·ë²Ì¤òÍ¿¤¨¤ë¡£
136 libc 4.4 ¤Ë¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë profil ¤òÄ󶡤¹¤ë¤¿¤á¤Î
137 ¥«¡¼¥Í¥ë¥Ñ¥Ã¥Á¤¬´Þ¤Þ¤ì¤Æ¤¤¤¿¡£
138 .\"O .SH "SEE ALSO"
139 .SH ´ØÏ¢¹àÌÜ
140 .BR gprof (1),
141 .BR setitimer (2),
142 .BR sigaction (2),
143 .BR signal (2)