Re: Cumulative samples without callgraph?

William Cohen <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
On 04/16/2015 01:00 PM, Nikolaus Rath wrote:
> Hello,
> 
> I have gathered some profile data using just "operf <program>" (i.e., no
> -g option to gather callgraph data).
> 
> However, when looking at the gmon output with
> 
> $ opgprof <program>
> $ gprof -p <program> | head
> 
> I find that there are distinct counts for cumulative and self:
> 
>> Flat profile:
>>
>> Each sample counts as 1 samples.
>>   %   cumulative   self              self     total           
>>  time   samples   samples    calls  T1/call  T1/call  name    
>>   5.19 14089090.00 14089090.00                             dagmg_mumps_302_
>>   4.85 27256080.00 13166990.00                             mcdriver_mp_mc_push_
>>   4.83 40373868.00 13117788.00                             dagmg_mumps_249_
>>   4.56 52738720.00 12364852.00      
> 
> 
> I'm confused by this. Doesn't "cumulative" mean the time spend in a
> function including time spend in calls to other functions? But if operf
> didn't look at the callgraph, how can it know anything about this? I
> thought that for every sample operf just records what function is being
> executed, but not how this function was called.
> 
> Best,
> -Nikolaus
> 

Hi Nikolaus,

gprof is only providing the flat sample information.  The cumulative samples is the sum of all the samples up to that point. Thus, the first line cumulative samples has 14089090.00, second line is 14089090+13117788=27256080, the third line is 14089090+13117788+13117788=40373868.

-Will


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.