---
name: "pfm_get_impl_pmcs"
section: "3"
platform: "linux"
package: "libpfm3-3.2-dev"
version: "3.2.070507-1.1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/pfm_get_impl_pmcs"
---

# pfm\_get\_impl\_pmcs(3)

return bitmask of implemented PMU registers or number of PMU registers

## NAME

pfm\_get\_impl\_pmcs, pfm\_get\_impl\_pmds, pfm\_get\_impl\_counters, pfm\_get\_num\_counters, pfm\_get\_num\_pmcs, pfm\_get\_num\_pmds, pfm\_get\_hw\_counter\_width - return  bitmask of implemented PMU registers or number of PMU registers

## SYNOPSIS

```
#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);

```

## DESCRIPTION

The **pfm\_get\_impl\_\*** functions can be used to figure out which PMU registers are implemented on the host CPU. All implemented registers may not necessarily be available to applications. Programs need to query the operating system kernel monitoring interface to figure out the list of available registers.

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.

## RETURN

The function returns whether or not it was successful. A return value of **PFMLIB\_SUCCESS** indicates success,  otherwise the value is the error code.

## ERRORS

**PFMLIB\_ERR\_NOINIT** the library has not been initialized properly.

## SEE ALSO

[pfm\_regmask\_set(3)](/pfm_regmask_set/3.md), [pfm\_regmask\_isset(3)](/pfm_regmask_isset/3.md)

## AUTHOR

Stephane Eranian \<eranian@hpl.hp.com\>
