Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Using gperftools, not able to see all nodes in the call graph of the lower dependencies

Date: Mon, 5 Nov 2012 00:29:08 -0800 (PST)
From: Deepak Vijayvergiy <dvsqu...@gmail.com>
To: google-perftools@googlegroups.com
Message-Id: <55f6c261-7e8b-4c5c-a372-d410c754dea7@googlegroups.com>
Subject: Using gperftools, not able to see all nodes in the call graph of
 the lower dependencies
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1461_430885.1352104148657"

------=_Part_1461_430885.1352104148657
Content-Type: multipart/alternative; 
	boundary="----=_Part_1462_27696287.1352104148657"

------=_Part_1462_27696287.1352104148657
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,
I have been trying to use google perftools to profile my product, but=20
facing a few issues.
We have a dependency like this -=20
main_server (deamon running which will take up all the DNS queries coming=
=20
in)
Then it will make the threads to take care of dns resolutions, and that=20
library is thread_lib.
This thread_lib will call the our_dns_lib library to lookup and resolve the=
=20
query and respond.

The dep:
main_server - > thread_lib -> our_dns_lib -> =E2=80=A6 -> =E2=80=A6.

I have all the above linked with -lprofiler at built-time.

Now, the way I have tried like this -
(1) Started the deamon with the env CPUPROFILE=3D<prof file>
(2) Now, send the queries through the other terminal in the same=20
environment.
(3) As soon as deamon receives the first query, it process and responds and=
=20
also this line generated -
PROFILE: interrupts/evictions/bytes =3D 10/0/380
(4) Ideally, it shouldn't have generated this line and the profile file=20
untill we are done with sending all the queries and stop the deamon, am I=
=20
correct?
(5) I tried to read the profile file generated using the pprof --text, but=
=20
it only contained information about the main_server (deamon stuff). It=20
didn't contain much nodes about the other dependent libraries.
Please point out, if something is missing here?

After that, as another experiment, I tried as below -=20
(1) Since, I was very much interested in one of the dependent libraries=20
nodes, so I added ProfilerStart() and stop() function with the profile file=
=20
name as argument in the lookup() function of the dependent library=20
(our_dns_lib). Compiled it and loaded the new libraries in the system.
(2) Now, I ran the deamon without using the env CPUPROFILE, and it started.
(3) Now, after sending the query/packet, I get the response, and I have=20
checked that it is going to the our_dns_lib library (as we checked in ur=20
logs), but profiling is not kicking in somehow.
(4) But, to simulate the lookup() function in our our_dns_lib library, we=
=20
have a utility command to test the lookup function, if I use that, I see=20
profiling kicking in, but I get this -
PROFILE: interrupts/evictions/bytes =3D 0/0/32
Later, I changed the env CPUPROFILE_FREQUENCY=3D10000, and then ran the=20
utility command, it showed something -
PROFILE: interrupts/evictions/bytes =3D 1/0/64

But, when I tried reading this using pprof, I only get 1 function=20
(different each time).
So, finally no luck in profiling my code yet.

Please let me know if I am missing something significant in the process.
And also, I need to take care of some thing in the process?

Thanks
Regards
Deepak

------=_Part_1462_27696287.1352104148657
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,<br>I have been trying to use google perftools to profile my product, bu=
t facing a few issues.<br>We have a dependency like this - <br>main_server =
(deamon running which will take up all the DNS queries coming in)<br>Then i=
t will make the threads to take care of dns resolutions, and that library i=
s thread_lib.<br>This thread_lib will call the our_dns_lib library to looku=
p and resolve the query and respond.<br><br>The dep:<br>main_server - &gt; =
thread_lib -&gt; our_dns_lib -&gt; =E2=80=A6 -&gt; =E2=80=A6.<br><br>I have=
 all the above linked with -lprofiler at built-time.<br><br>Now, the way I =
have tried like this -<br>(1) Started the deamon with the env CPUPROFILE=3D=
&lt;prof file&gt;<br>(2) Now, send the queries through the other terminal i=
n the same environment.<br>(3) As soon as deamon receives the first query, =
it process and responds and also this line generated -<br>PROFILE: interrup=
ts/evictions/bytes =3D 10/0/380<br>(4) Ideally, it shouldn't have generated=
 this line and the profile file untill we are done with sending all the que=
ries and stop the deamon, am I correct?<br>(5) I tried to read the profile =
file generated using the pprof --text, but it only contained information ab=
out the main_server (deamon stuff). It didn't contain much nodes about the =
other dependent libraries.<br>Please point out, if something is missing her=
e?<br><br>After that, as another experiment, I tried as below - <br>(1) Sin=
ce, I was very much interested in one of the dependent libraries nodes, so =
I added ProfilerStart() and stop() function with the profile file name as a=
rgument in the lookup() function of the dependent library (our_dns_lib). Co=
mpiled it and loaded the new libraries in the system.<br>(2) Now, I ran the=
 deamon without using the env CPUPROFILE, and it started.<br>(3) Now, after=
 sending the query/packet, I get the response, and I have checked that it i=
s going to the our_dns_lib library (as we checked in ur logs), but profilin=
g is not kicking in somehow.<br>(4) But, to simulate the lookup() function =
in our our_dns_lib library, we have a utility command to test the lookup fu=
nction, if I use that, I see profiling kicking in, but I get this -<br>PROF=
ILE: interrupts/evictions/bytes =3D 0/0/32<br>Later, I changed the env CPUP=
ROFILE_FREQUENCY=3D10000, and then ran the utility command, it showed somet=
hing -<br>PROFILE: interrupts/evictions/bytes =3D 1/0/64<br><br>But, when I=
 tried reading this using pprof, I only get 1 function (different each time=
).<br>So, finally no luck in profiling my code yet.<br><br>Please let me kn=
ow if I am missing something significant in the process.<br>And also, I nee=
d to take care of some thing in the process?<br><br>Thanks<br>Regards<br>De=
epak<br><div style=3D"display: none;" id=3D"__af745f8f43-e961-4b88-8424-80b=
67790c964__"></div>
------=_Part_1462_27696287.1352104148657--

------=_Part_1461_430885.1352104148657--