A serious bug was found that affects operf profiling with
multiple events. Samples for an event may be incorrectly
attributed to another event. For example, profiling on
a Sandybridge laptop with CPU_CLK_UNHALTED and INST_RETIRED
events produces the following summary counts from opreport:
CPU_CLK_UNHALTED |INST_RETIRED |
samples| %| samples| %|
32412 100.000 20104 100.000 foo
Using operf to produce separate profiles for these two events
results in these sample counts:
CPU_CLK_UNHALTED |
samples| %|
18962 100.000 foo
INST_RETIRED |
samples| %|
33464 100.000 foo
The attached patch fixes this bug.
This patch was committed upstream on Dec 20, 2013.