Thanks for your reply Will,
Please find the additional details.
Can you give some background on what type of performance data you are trying to collect with OProfile? Also what specific processor you are collecting data on?
>> I was monitoring my process %CPU which is going high during performance testing , so using oprofile I was trying to get the function/commands which is consuming most %CPU.
****processor details
Overflow stats not available
warning: [vdso] (tgid:7231 range:0x7fffd60a9000-0x7fffd60aa000) could not be found.
CPU: Intel Sandy Bridge microarchitecture, speed 1700 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
samples  %        linenr info                 symbol name


So is there any way I could get the info mentioned above?




On Mon, Dec 2, 2013 at 10:52 PM, William Cohen <wcohen@redhat.com> wrote:
On 11/29/2013 01:30 AM, Rasna T wrote:
> Hi,
> Could you please help me to get clarity on analyzing the opreport results. I couldnt find any good analysis document for opreport.
>
> Steps:
> 1.starting the oprofile
> #opcontrol --start --no-vmlinux
> 2.waiting for some sample collections (*example for 60 secs*)
> 3. Dumping the oprofile results
> #opcontrol --dump
> 4. Saving the session
> #opcontrol --save report_1
>
> So while viewing the results using opreport how do we can map the number of *samples* wrt to the time the test ran. Here we ran it 60 seconds.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
> samples  %        linenr info                 symbol name
> 765      28.2080 function.cpp:1325  function.cppXXX
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Can i get a exact map of the number of function calls in that period?
> --
> Rasna T

Hi Rasna,

Can you give some background on what type of performance data you are trying to collect with OProfile? Also what specific processor you are collecting data on?

OProfile uses event sampling.  In this case it is doing sampling on the processor clock.  It isn't noting the number of times that the function is called.  Some processors do allow sampling on calls, but this is processor implementation dependent, but this will not give exact number of times a function is called.  On the Intel Ivy Bridge processor I could do something like the following events to get both cycle counts and calls (the same events should also apply to 'opcontrol'):

$ operf --event CPU_CLK_UNHALTED:1000000:0:1:1 --event br_inst_retired:1000000:near_call:1:1 make


The output is something like the following (the -t10 prints executables that have 10% or more of the total number of samples):

$ opreport -t10
Using /home/wcohen/research/profiling/oprofile/oprofile/oprofile_data/samples/ for samples directory.
CPU: Intel Ivy Bridge microarchitecture, speed 3300 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 1000000
Counted br_inst_retired events (Conditional branch instructions retired.) with a unit mask of 0x02 (Direct and indirect near call instructions retired.) count 1000000
CPU_CLK_UNHALT...|br_inst_retire...|
  samples|      %|  samples|      %|
------------------------------------
    33556 70.8755    138080 86.5315 cc1plus
        CPU_CLK_UNHALT...|br_inst_retire...|
          samples|      %|  samples|      %|
        ------------------------------------
            27450 81.8036    120435 87.2212 cc1plus
             3769 11.2320     11365  8.2307 libc-2.17.so
             2309  6.8810      6197  4.4880 no-vmlinux
               17  0.0507        63  0.0456 libgmp.so.10.1.1
               11  0.0328        20  0.0145 ld-2.17.so

-Will



--
Rasna T
Model Engineering College-2k11