Hi,
I'm running into a discrepancy between the results I measure in OProfile
compared to the results I get by simulation in the Cachegrind tool of
Valgrind. I was wondering if you might have some insight or advice.
After doing:
sudo opcontrol --reset
sudo opcontrol --setup --separate=library --event=INST_RETIRED:6000
sudo opcontrol --start
./MMM
opcontrol --dump
sudo opcontrol --shutdown
opreport
I see that MMM (the naive matrix multiplication code to multiply two 500
by 500 int matrices) was sampled 194758 times:
CPU: Core 2, speed 1600 MHz (estimated)
Counted INST_RETIRED.ANY_P events (number of instructions retired) with a
unit mask of 0x00 (No unit mask) count 6000
INST_RETIRED:6000|
samples| %|
------------------
194758 66.4501 MMM
INST_RETIRED:6000|
samples| %|
------------------
194738 99.9897 MMM
14 0.0072 ld-2.6.so
6 0.0031 libc-2.6.so
Thus, I would expect that 194758 * 6000 = 1168548000 instructions were
retired by MMM.
However, when I do a simulation in cachegrind:
valgrind --tool=cachegrind ./MMM
I get the following results:
==19946== I refs: 4,136,870,232
...
==19946== L2 misses: 48,308 ( 1,230 rd + 47,078 wr)
So, cachegrind says that 4136870232 instructions were retired by MMM.
This is a factor of about 3.5 different than the measurement from
OProfile.
Moreover, if I run the above OProfile commands with
--event=L2_RQSTS:6000:0xc1:1:1, it samples 3 times in MMM. At a sample
rate of 6000, this means that I should expect approximately 18000 L2 cache
misses. In fact, Cachegrind simulates 48308 L2 cache misses, which is a
factor of about 2.7 off the OProfile measurement.
Do you have any ideas as to what might be causing these large discrepancies?
Thanks for your help!
Henry
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference_______________________________________________
oprofile-list mailing list
oprofile-list@...
https://lists.sourceforge.net/lists/listinfo/oprofile-list