Re: [squid-users] 'gprof squid squid.gmon' only shows the initial configuration functions

From: Guy Bashkansky <guybas_at_gmail.com>
Date: Wed, 9 Dec 2009 09:57:52 -0800

Is there an oprofile version for FreeBSD? I thought it is limited to
Linux. On FreeBSD I tried pmcstat, but it gives an initialization
error.

My version of Squid is old and customized (so I can't upgrade) and may
not have builtin timers. Since what version did they appear?

As for gprof - even with the event loop on top, still the rest of the
table might give some idea why the CPU is overloaded. The problem is
- I see only initial configuration functions:

                                 called/total parents
index %time self descendents called+self name index
                                 called/total children
                                                    <spontaneous>
[1] 63.4 0.17 0.00 _mcount [1]
-----------------------------------------------
               0.00 0.10 1/1 _start [3]
[2] 36.0 0.00 0.10 1 main [2]
               0.00 0.10 1/1 parseConfigFile [4]
<...>
-----------------------------------------------
                                                    <spontaneous>
[3] 36.0 0.00 0.10 _start [3]
               0.00 0.10 1/1 main [2]
-----------------------------------------------
               0.00 0.10 1/1 main [2]
[4] 36.0 0.00 0.10 1 parseConfigFile [4]
               0.00 0.09 1/1 readConfigLines [5]
               0.00 0.00 169/6413 parse_line [6]
...
========================

System info:

# uname -m -r -s
FreeBSD 6.2-RELEASE-p9 amd64

# gcc -v
Using built-in specs.
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 3.4.6 [FreeBSD] 20060305

There are 7 fork()s for unlinkd/diskd helpers. Can these fork()s
affect profiling info?

On Wed, Dec 9, 2009 at 2:04 AM, Robert Collins
<robertc_at_robertcollins.net> wrote:
> On Tue, 2009-12-08 at 15:32 -0800, Guy Bashkansky wrote:
>> I've built squid with the -pg flag and run it in the no-daemon mode
>> (-N flag), without the initial fork().
>>
>> I send it the SIGTERM signal which is caught by the signal handler, to
>> flag graceful exit from main().
>>
>> I expect to see meaningful squid.gmon, but 'gprof squid squid.gmon'
>> only shows the initial configuration functions:
>
> gprof isn't terribly useful anyway - due to squids callback based model,
> it will see nearly all the time belonging to the event loop.
>
> oprofile and/or squids built in analytic timers will get much better
> info.
>
> -Rob
>
Received on Wed Dec 09 2009 - 17:58:20 MST

This archive was generated by hypermail 2.2.0 : Thu Dec 10 2009 - 12:00:01 MST