<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=GB2312">
<STYLE>
BLOCKQUOTE {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
FONT-SIZE: 10.5pt; COLOR: #000080; LINE-HEIGHT: 1.5; FONT-FAMILY: ËÎÌå
}
</STYLE>
<META content="MSHTML 6.00.6000.17107" name=GENERATOR></HEAD>
<BODY style="MARGIN: 10px">
<DIV>
<DIV>zhanghaikuo <zhanghaikuo@cnnic.cn> wrote:</DIV>
<DIV> </DIV>
<DIV>> I want to make a discussion about how to get the profiling data by gprof.</DIV>
<DIV>> I wrote down an approach about it, and the method is on the followed linked:</DIV>
<DIV>> http://bind10.isc.org/wiki/ProfilingGprof</DIV>
<DIV>> this approach should modify the codes of boss (/PREFIX/sbin/bind10), and of course it would work in this way.</DIV>
<DIV>> But I think it is not the best way to do that.</DIV>
<DIV>> who has some better idea to collect profiling data without code modification?</DIV>
<DIV>> welcome to join this discussion.</DIV>
<DIV> </DIV>
<DIV>jinmei wrote:</DIV>
<DIV>>Why do we have to modify the bind10 script? Doesn't it work if we do</DIV>
<DIV>>something like:</DIV>
<DIV>>% GMON_OUT_PREFIX=something /PREFIX/sbin/bind10</DIV>
<DIV>>?</DIV></DIV>
<DIV>Jinmei, the rule of profiling file name is followed:</DIV>
<DIV style="TEXT-INDENT: 2em">If the GMON_OUT_PREFIX is not
defined,all the binary executable files will collect the profiling data to
the same file(gmon.out) in the current directory,so it will be a conflict in
the gmon.out file.Take for example, our bind 10 is a
multiple-processes software, so b10-auth and b10-resolver executable file
will write the profiling data to the same "gmon.out" file.</DIV>
<DIV style="TEXT-INDENT: 2em">If the GMON_OUT_PREFIX is defined
as you said,the rule of profiling data file
name is "GMON_OUT_PREFIX"+"PID" (PID is process ID).When you run
bind10,all the sub-processes will get the same value of GMON_OUT_PREFIX and you
don't know sub-processes's PID, so you don't know which profiling
data file is for b10-auth,and which is for b10-resolver. Take for
example, if you set GMON_OUT_PREFIX=bind10, then bind10.1123 file
bind10.2122 file and so on will be made after bind10 finished, and it
is difficult to identify which one is made by b10-auth.</DIV>
<DIV style="TEXT-INDENT: 2em">Of course you can get the PID by
running "pidof b10-auth" before you destroy b10-auth process, but I
think it is not easy to use for gprof.</DIV>
<DIV style="TEXT-INDENT: 2em"> </DIV>
<DIV style="TEXT-INDENT: 2em">In my method, bind10 will assign different value
to GMON_OUT_PREFIX for different sub-process,it will be easy to identify
which profiling data file is created or
made by the binary executable file. Take for example,
b10-auth.1322 file should be created and produced by b10-auth,and
b10-resolver.4323 file should be made by b10-resolver. </DIV>
<DIV style="TEXT-INDENT: 2em"> </DIV>
<DIV style="TEXT-INDENT: 2em">Users could get the right profiling
information by both of methods,but I don't know which method is better or
is ease to use,which one is better to understand. </DIV>
<DIV> </DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>zhanghaikuo</SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<DIV
style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; COLOR: #000000; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:jinmei@isc.org">JINMEI Tatuya
/ÉñÃ÷ß_ÔÕ</A></DIV>
<DIV><B>Date:</B> 2012-02-08 02:29</DIV>
<DIV><B>To:</B> <A href="mailto:zhanghaikuo@cnnic.cn">zhanghaikuo</A></DIV>
<DIV><B>CC:</B> <A
href="mailto:bind10-dev@lists.isc.org">bind10-dev</A></DIV>
<DIV><B>Subject:</B> Re: [bind10-dev] discussion about the approach of
gprof</DIV></DIV></DIV>
<DIV>
<DIV>At Tue, 7 Feb 2012 17:21:13 +0800,</DIV>
<DIV>zhanghaikuo <zhanghaikuo@cnnic.cn> wrote:</DIV>
<DIV> </DIV>
<DIV>> I want to make a discussion about how to get the profiling data by gprof.</DIV>
<DIV>> I wrote down an approach about it, and the method is on the followed linked:</DIV>
<DIV>> http://bind10.isc.org/wiki/ProfilingGprof</DIV>
<DIV>> this approach should modify the codes of boss (/PREFIX/sbin/bind10), and of course it would work in this way.</DIV>
<DIV>> But I think it is not the best way to do that.</DIV>
<DIV>> who has some better idea to collect profiling data without code modification?</DIV>
<DIV>> welcome to join this discussion.</DIV>
<DIV> </DIV>
<DIV>Why do we have to modify the bind10 script? Doesn't it work if we do</DIV>
<DIV>something like:</DIV>
<DIV>% GMON_OUT_PREFIX=something /PREFIX/sbin/bind10</DIV>
<DIV>?</DIV>
<DIV> </DIV>
<DIV>---</DIV>
<DIV>JINMEI, Tatuya</DIV>
<DIV>Internet Systems Consortium, Inc.</DIV></DIV></BODY></HTML>