You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[This issue is the outcome of a discussion at a softdev thrash]
The Idea
On modern Intel CPUs there are 8 programmable performance counters which can be used to measure things like:
Number of cache hit/misses (at varying L-levels).
Number of branch predilections.
...
Krun could collect some of this stuff and it may help in diagnosing odd behaviours.
How
The programmable performance counters can be read from userspace if a flag in an MSR is set (and I think there's a Linux /proc or /sys node to enable it too). However in order to be able to read the counter for the specified core, you would need a way to force the instruction execute on a given core. This can be done with:
cpu_set_affinity() from user space.
smp_call_function_single() from the kernel.
[We already have code in the kernel to do the latter for a couple of fixed-function performance counters (albeit via MSRs, just because we could), but also to read APERF and MPERF.]
The text was updated successfully, but these errors were encountered:
[This issue is the outcome of a discussion at a softdev thrash]
The Idea
On modern Intel CPUs there are 8 programmable performance counters which can be used to measure things like:
Krun could collect some of this stuff and it may help in diagnosing odd behaviours.
How
The programmable performance counters can be read from userspace if a flag in an MSR is set (and I think there's a Linux
/proc
or/sys
node to enable it too). However in order to be able to read the counter for the specified core, you would need a way to force the instruction execute on a given core. This can be done with:cpu_set_affinity()
from user space.smp_call_function_single()
from the kernel.[We already have code in the kernel to do the latter for a couple of fixed-function performance counters (albeit via MSRs, just because we could), but also to read
APERF
andMPERF
.]The text was updated successfully, but these errors were encountered: