logoalt Hacker News

ErikCorrytoday at 12:35 AM1 replyview on HN

Yeah performance counters


Replies

cloudbonsaitoday at 7:00 AM

To fill in the details, here is the code used for the measurement:

https://github.com/lemire/counters/blob/main/include/counter...

It fetches the number of mispredicted instructions from Linux's perf subsystem, which in turn gathers the metrics from CPU's PMU (Performance Monitoring Unit) interface.