Got it. Thanks!

My CPU is “Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz”. As I can see, the CPU is 
kind of running slower when ‘cpu-cycles’ event is enabled, while it is normal 
with ‘instructions’ event is enabled.

You can see the difference shown below. Texts in red are vector counts for the 
two events, in 3s. I got this by running ‘set pmc instructions-per-clock’. 
Therefore, it is hard to believe the ‘rdpmc’ cause the big difference – 80%.

t1-ip4-input

instructions-per-clo

1609959354

510202112

3.16E+00


instructions

1609959354

15727872

1.02E+02


cpu-cycles

510202112

12838400

3.97E+01


Hope somebody point out the root cause.

Regards,
Kingwel


From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Damjan Marion via 
Lists.Fd.Io
Sent: Wednesday, December 12, 2018 12:30 AM
To: Dave Barach <dbar...@cisco.com>
Cc: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] perfmon plugin


rdtsc instruction reads timestamp counter which ticks on the constant nominal 
frequency
which means that it will count ticks equally even when CPU is in deep sleep or 
when CPU is in turbo burst
mode. That gives very precise time measurement (i.e. on 2.5GHz CPU  tick will 
always be 0.4ns) but
it is not appropriate for counting real cpu clock cycles.

--
Damjan


On 11 Dec 2018, at 06:02, Dave Barach via Lists.Fd.Io 
<dbarach=cisco....@lists.fd.io<mailto:dbarach=cisco....@lists.fd.io>> wrote:

The “show run” stats use rdtsc instructions, vs. “show pmc” which uses rdpmc 
instructions with a specific counter selected.

Perhaps Damjan or one of our colleagues from Intel can explain the difference.

D.

From: vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io> 
<vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>> On Behalf Of Kingwel Xie
Sent: Tuesday, December 11, 2018 5:18 AM
To: Dave Barach (dbarach) <dbar...@cisco.com<mailto:dbar...@cisco.com>>; 
vpp-dev <vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>>
Subject: [vpp-dev] perfmon plugin

Hi Dave,

I’m looking at the perfmon plugin. It is a fantastic tool tuning node 
performance, extremely helpful. Thanks for the great contribution.

Here I got a question about ‘cpu-cycles’ event. It shows very different results 
if comparing with clocks of ‘show run’. Around 20% slower. I checked the code 
but didn’t find anything wrong. Also I tried ‘instructions’, it is normal. 
Please check below:

Show run:
ip4-input

active

41843

10711808

0

3.32E+01

256

ppf-pdcp-encap

active

41843

10711808

0

2.69E+01

256


Show pmc:
t1-ip4-input

instructions-per-clo

1609959354

510202112

3.16E+00


instructions

1609959354

15727872

1.02E+02


cpu-cycles

510202112

12838400

3.97E+01

t1-ppf-pdcp-encap

instructions-per-clo

1229445506

415212396

2.96E+00


instructions

1229445506

15727872

7.82E+01


cpu-cycles

415212396

12838400

3.23E+01


So the question is : will the turning on perf event impact system performance? 
If so, why ‘instruction’ event does not? You might notice that packet count 
recorded by ‘instructions’ is very different from that by ‘cpu-cycles’, even 
they are both measured under the same circumstance – running for 3s.

Regards,
Kingwel

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11562): https://lists.fd.io/g/vpp-dev/message/11562
Mute This Topic: https://lists.fd.io/mt/28717911/675642
Group Owner: vpp-dev+ow...@lists.fd.io<mailto:vpp-dev+ow...@lists.fd.io>
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  
[dmar...@me.com<mailto:dmar...@me.com>]
-=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11570): https://lists.fd.io/g/vpp-dev/message/11570
Mute This Topic: https://lists.fd.io/mt/28717911/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to