I just pushed a patch to the GIT tree that enables support
for RDPMC from user level on all X86 processors.
RDPMC is an instruction that allows applications to read counters
at very low overhead (<50 cycles). By nature, only the hardware portion
of each register is returned. Given that no X86 processor implements 64-bit
counters, that means that only partial values are returned (e.g, 31 bit
worth on Intel Core 2) compared to a pfm_read_pmds() call. Yet, if the
values are read frequently enough, that should not be a problem. We can
eventually add support to expose the software maintained upper part of the
RDPMC is allowed for:
- system-wide context
- per-thread context which are self-monitoring
RDPMC is accessible between calls to pfm_load_context() and
I will soon push a patch for libpfm which will make it easier
to figure out which index to pass to RDPMC based on the PMD
registers used by the measurement.
Please test this in your setup and let me know how it works.