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> 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 
> <https://lists.fd.io/g/vpp-dev/message/11562>
> Mute This Topic: https://lists.fd.io/mt/28717911/675642 
> <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 
> <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 (#11566): https://lists.fd.io/g/vpp-dev/message/11566
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