When profiling a program with "cpu-cycle" event using "pref record -p $pid && perf report" command, I think the underlying hardware PMC does the following things:
- Increase the counter when a cycle come
- Record the "current instruction" when the counter overflows
I wonder which instruction is recorded as "current instruction" in step-2 since there should be several instructions on the fly in different pipeline stages or execution units.