#201 opreport xml total count differs

closed-fixed
None
5
2012-08-27
2011-09-07
Roland Grunberg
No

The total samples collected with opreport and opreport -X differ when using --separate=lib. In particular it seems that the total count displayed by opreport -X is off by exactly the number of samples collected for the last module.

This seems to be slightly related to https://sourceforge.net/tracker/index.php?func=detail&aid=1982201&group_id=16191&atid=116191

Steps to reproduce : (Any simple C program executed multiple times as below should reproduce the issue)

rgrunber@tornero:Debug$ opcontrol -v
opcontrol: oprofile 0.9.8git compiled on Sep 2 2011 14:11:00
rgrunber@tornero:Debug$ opreport -v
opreport: oprofile 0.9.8git compiled on Sep 2 2011 14:11:00
rgrunber@tornero:Debug$ opreport
opreport error: No sample file found: try running opcontrol --dump
or specify a session containing sample files

rgrunber@tornero:Debug$ sudo opcontrol --init
rgrunber@tornero:Debug$ sudo opcontrol --status
Daemon not running
Separate options: library
vmlinux file: none
Image filter: /home/yyz/rgrunber/runtime-EclipseApplication/fibonacci/Debug/fibonacci
Call-graph depth: 0
rgrunber@tornero:Debug$
rgrunber@tornero:Debug$ sudo opcontrol --start
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
rgrunber@tornero:Debug$
rgrunber@tornero:Debug$ for (( i=1; i<100; i++ )); do ~/runtime-EclipseApplication/fibonacci/Debug/fibonacci 1>/dev/null; done;
rgrunber@tornero:Debug$
rgrunber@tornero:Debug$ sudo opcontrol --dump
rgrunber@tornero:Debug$
rgrunber@tornero:Debug$ opreport
CPU: Intel Architectural Perfmon, speed 1600 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
CPU_CLK_UNHALT...|
samples| %|
------------------
360 100.000 fibonacci
CPU_CLK_UNHALT...|
samples| %|
------------------
199 55.2778 fibonacci
103 28.6111 ld-2.14.so
58 16.1111 libc-2.14.so
rgrunber@tornero:Debug$
rgrunber@tornero:Debug$ opreport -X -d | head -20
<?xml version="1.0" ?>
<profile schemaversion="3.0" cputype="i386"
processor="arch_perfmon"
mhz="1600.00"
title="opreport -X -d ">
<options details="true"/>
<setup>
<eventsetup id="0" eventname="CPU_CLK_UNHALTED" unitmask="0" setupcount="100000"/>
</setup>

<binary name="/home/yyz/rgrunber/runtime-EclipseApplication/fibonacci/Debug/fibonacci">
<count>
302</count>
<symbol idref="0" detaillo="0" detailhi="19">
<count>
198</count>
</symbol>
<symbol idref="1" detaillo="0" detailhi="0">
<count>
1</count>

Discussion

  • Patch to fix this bug

     
  • Roland, please test the attached patch and let me know if that fixes your problem. I was able to reproduce the problem, so I'm pretty sure this patch is correct.

     
    • assigned_to: nobody --> maynardj
     
  • Yes, the patch fixes the issue. Thanks again.

     
    • status: open --> open-fixed
     
  • Patch committed as git commit c12d08bb3e7589819d491122dae1d679a7bb5278. Thanks for reporting this bug.

     
    • status: open-fixed --> closed-fixed