Lably
Skip to content

Hardware performance counter

Registers that count hardware-related activities

  • 2 min read
  • 3 chapters

Related on Lably

Through Computer and Microprocessor

Implementations

The number of available hardware counters in a processor is limited while each CPU model might have a lot of different events that a developer might like to measure. Each counter can be programmed with the index of an event type to be monitored, like a L1 cache miss or a branch misprediction.

One of the first processors to implement a hardware counter and an associated instruction to access it (the RDPMC instruction) was the Intel Pentium, but they were not documented until Terje Mathisen wrote an article about reverse engineering them in Byte July 1994.

The following table shows some examples of CPUs and the number of available hardware counters:

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication