* Bogus PMCs on Linux 3.13
@ 2016-03-09 20:48 Brendan Gregg
2016-03-12 14:12 ` Andi Kleen
0 siblings, 1 reply; 2+ messages in thread
From: Brendan Gregg @ 2016-03-09 20:48 UTC (permalink / raw)
To: linux-perf-use.
G'Day,
I'm guessing/hoping this has been fixed and someone knows this
offhand... I just noticed the following crazyness involving measuring
the same PMC multiple times:
On Linux 4.2:
# perf stat -e cycles -e instructions -e instructions -e instructions
-e instructions -e instructions -e instructions -e instructions -e
instructions dd if=/dev/zero of=/dev/null bs=1024k count=10k
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB) copied, 0.559049 s, 19.2 GB/s
Performance counter stats for 'dd if=/dev/zero of=/dev/null bs=1024k
count=10k':
1,846,674,979 cycles
5,643,478,284 instructions # 3.06 insns per
cycle
5,643,478,284 instructions # 3.06 insns per
cycle
5,643,478,284 instructions # 3.06 insns per
cycle
5,643,478,284 instructions # 3.06 insns per
cycle
5,643,478,284 instructions # 3.06 insns per
cycle
5,643,478,284 instructions # 3.06 insns per
cycle
5,643,478,284 instructions # 3.06 insns per
cycle
5,643,478,284 instructions # 3.06 insns per
cycle
0.560372803 seconds time elapsed
Ok, what am I trying to do here? Look like I've lost my mind. Now on Linux 3.13:
# perf stat -e cycles -e instructions -e instructions -e instructions
-e instructions -e instructions -e instructions -e instructions -e
instructions dd if=/dev/zero of=/dev/null bs=1024k count=10k
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB) copied, 0.592963 s, 18.1 GB/s
Performance counter stats for 'dd if=/dev/zero of=/dev/null bs=1024k
count=10k':
1,784,251,390 cycles [33.80%]
388,784,218,053 instructions # 217.90 insns per
cycle [34.25%]
29,210,705,287 instructions # 16.37 insns per
cycle [34.69%]
29,130,543,782 instructions # 16.33 insns per
cycle [34.44%]
386,106,445,334 instructions # 216.40 insns per
cycle [33.93%]
24,142,195,608 instructions # 13.53 insns per
cycle [33.26%]
24,634,254,460 instructions # 13.81 insns per
cycle [32.59%]
313,401,323,744 instructions # 175.65 insns per
cycle [33.58%]
5,326,841,700 instructions # 2.99 insns per
cycle [33.34%]
0.593762053 seconds time elapsed
Now I've definitely lost my mind.
If I measure the instructions PMC once, it doesn't work. Need to
measure it at least twice. In the above output, it's the last
"instructions" line that is sane.
If you've seen this before and know offhand, please let me know. If
not, I wouldn't dig on it -- it works fine on Linux 4.2, so might have
been fixed already. I've also mucked with this 3.13 server, so it
could just be me...
Brendan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Bogus PMCs on Linux 3.13
2016-03-09 20:48 Bogus PMCs on Linux 3.13 Brendan Gregg
@ 2016-03-12 14:12 ` Andi Kleen
0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2016-03-12 14:12 UTC (permalink / raw)
To: Brendan Gregg; +Cc: linux-perf-use.
Brendan Gregg <brendan.d.gregg@gmail.com> writes:
>
> Performance counter stats for 'dd if=/dev/zero of=/dev/null bs=1024k
> count=10k':
>
> 1,784,251,390 cycles [33.80%]
> 388,784,218,053 instructions # 217.90 insns per
> cycle [34.25%]
The obvious problem is that you're multiplexing. Multiplexing can cause
large measuring errors. Try to stop whoever else uses perf.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-12 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09 20:48 Bogus PMCs on Linux 3.13 Brendan Gregg
2016-03-12 14:12 ` Andi Kleen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.