Please enable Javascript to view the contents

 ·  ☕ 2 分钟

PMC: retired instruction

http://web.eece.maine.edu/~vweaver/projects/perf_counters/retired_instructions.html

x86 and x86_64

Retired instruction counts on x86 in general also include at least one extra instruction each time a hardware interrupt happens, even if only user space code is being monitored. The one exception to this is the Pentium 4 counter.

Another special case are rep prefixed string instructions. Even if the instruction repeats many times, the instruction is only counted as one instruction.

A page fault that brings a page into memory for the first time (on a load or store) also counts as an additional instruction.

If the x87 top-of-stack pointer overflows an extra instruction is counted.

Note that instructions incorporating floating point “fwait” count as two instructions even though the disassembler only lists them as one.

PMC: retired Branches

http://web.eece.maine.edu/~vweaver/projects/perf_counters/retired_instructions.html

x86 and x86_64

Retired branch counts on x86 in general include at least one extra instruction each time a hardware interrupt or page fault happens, even if only user space code is being monitored.

On x86 the non-determinism is related to the hardware interrupt and page-fault count, similar to the way the retired instruction count behaves.

  • Pentium Pro, II, III

    • BR_INST_RETIRED (0xc4,0x00) - This particular counter seems to overcount by approximately an integer multiple of the number of hardware interrupts taken. This value was measured as 4x on a Pentium III using perf, and 3x on a Pentium Pro using pfmon.
  • AMD

    • RETIRED_BRANCH_INSTRUCTIONS (r5000c2:u) - Documentation specifies this includes all control-flow changes, including exceptions and interrupts.
  • Atom

    • BRANCH_INSTRUCTIONS_RETIRED (branches:u)
  • Core2

    • BRANCH_INSTRUCTIONS_RETIRED (branches:u) – The cpuid instruction also counts as a branch.
  • Nehalem

    • BRANCH_INSTRUCTIONS_RETIRED (branches:u) –
  • SandyBridge

    • BRANCH_INSTRUCTIONS_RETIRED (branches:u) –
  • Pentium D

    • BRANCH_RETIRED:MMNP:MMNM:MMTP:MMTM
分享

Mark Zhu
作者
Mark Zhu
An old developer