#include <perfmon/pfmlib.h> int pfm_get_impl_pmcs(pfmlib_regmask_t *impl_pmcs); int pfm_get_impl_pmds(pfmlib_regmask_t *impl_pmds); int pfm_get_impl_counters(pfmlib_regmask_t *impl_counters); int pfm_get_num_counters(unsigned int *num); int pfm_get_num_pmcs(unsigned int *num); int pfm_get_num_pmds(unsigned int *num); int pfm_get_num_counters(unsigned int *num); int pfm_get_hw_counter_width(unsigned int *width);
The pfm_get_impl_* functions all return a bitmask of registers corresponding to the query. The bitmask pointer passed as argument is reset to zero by each function. The returned bitmask must be accessed using the set of functions provided by the library to ensure portability. See related man pages below.
The pfm_get_num_* functions return the number of implemented PMC or PMD registers. Those numbers may be different from the actual number of registers available to applications.
The pfm_get_impl_pmcs returns in impl_pmcs the bitmask of implemented PMCS.
The pfm_get_impl_pmds returns in impl_pmds the bitmask of implemented PMDS.
The pfm_get_impl_counters returns in impl_counters a bitmask of the PMD registers used as counters. Depending on the PMU mode, not all PMD registers are necessarily used as counters.
The pfm_get_num_counters function returns in num the number of PMD used as counters. A counter is a PMD which is used to accumulate the number of occurences of an event.
The pfm_get_num_pmcs function returns in num the number of implemented PMCs by the host PMU.
The pfm_get_num_pmds function returns in num the number of implemented PMDs by the host PMU.
The pfm_get_hw_counter_width function returns the width in bits of the counters in width. PMU implementations can have different number of bits implemented. For instance, Itanium has 32-bit counters, while Itanium 2 has 47-bits.