monitor.3

来自「莱昂氏UNIX源代码分析UNIXv6src.tar.gz」· 3 代码 · 共 74 行

3
74
字号
.th MONITOR III 2/11/74.sh NAMEmonitor \*- prepare execution profile.sh SYNOPSIS.ft Bmonitor(lowpc, highpc, buffer, bufsize).brint lowpc( ), highpc( ), buffer[ ], bufsize;.ft R.sh DESCRIPTION.it Monitoris an interface to the system's profile entry (II)..it Lowpcand.it highpcare the names of two functions;.it bufferis the address of a (user supplied)array of.it bufsizeintegers..it Monitorarranges for the system to sample the user'sprogram counter periodicallyand record the execution histogram inthe buffer.The lowest address sampledis that of.it lowpcand the highest isjust below.it highpc.For the results to be significant,especially where there are small, heavilyused routines,it is suggested that the buffer be no morethan a few times smaller than the rangeof locations sampled..s3To profile the entire program,it is sufficient to use.s3	extern etext;.br	....br	monitor(2, &etext, buf, bufsize);.s3.it Etextis a loader-defined symbol which lies just above all theprogram text..s3To stop execution monitoring and write the resultson the file.it mon.out,use.s3	monitor(0);.s3Then, when the program exits, prof (I) can be usedto examine the results..s3It is seldom necessary to call this routinedirectly; the.bd \*-poption of.it ccis simpler if one is satisfied withits default profile range and resolution..sh FILESmon.out.sh "SEE ALSO"prof (I), profil (II), cc (I)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?