[bind10-dev] discussion about the approach of gprof

zhanghaikuo zhanghaikuo at cnnic.cn
Wed Feb 8 02:18:28 UTC 2012


zhanghaikuo <zhanghaikuo at cnnic.cn> wrote:

> I want to make a discussion about how to get the profiling data by gprof.
> I wrote down an approach about it, and the method is on the followed linked:
> http://bind10.isc.org/wiki/ProfilingGprof
> this approach should modify the codes of boss (/PREFIX/sbin/bind10), and of course it would work in this way.
> But I think it is not the best way to do that.
> who has some better idea to collect profiling data without code modification?
> welcome to join this discussion.

jinmei wrote:
>Why do we have to modify the bind10 script?  Doesn't it work if we do
>something like:
>% GMON_OUT_PREFIX=something /PREFIX/sbin/bind10
>?
Jinmei, the rule of profiling file name is followed:
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.
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.
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.

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. 

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.   




zhanghaikuo

From: JINMEI Tatuya /ÉñÃ÷ß_ÔÕ
Date: 2012-02-08 02:29
To: zhanghaikuo
CC: bind10-dev
Subject: Re: [bind10-dev] discussion about the approach of gprof
At Tue, 7 Feb 2012 17:21:13 +0800,
zhanghaikuo <zhanghaikuo at cnnic.cn> wrote:

> I want to make a discussion about how to get the profiling data by gprof.
> I wrote down an approach about it, and the method is on the followed linked:
> http://bind10.isc.org/wiki/ProfilingGprof
> this approach should modify the codes of boss (/PREFIX/sbin/bind10), and of course it would work in this way.
> But I think it is not the best way to do that.
> who has some better idea to collect profiling data without code modification?
> welcome to join this discussion.

Why do we have to modify the bind10 script?  Doesn't it work if we do
something like:
% GMON_OUT_PREFIX=something /PREFIX/sbin/bind10
?

---
JINMEI, Tatuya
Internet Systems Consortium, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20120208/1d0dd3db/attachment.html>


More information about the bind10-dev mailing list