Blame src/libpfm-3.y/docs/man3/pfm_get_impl_pmcs.3

Packit Service a1973e
.TH LIBPFM 3  "July, 2003" "" "Linux Programmer's Manual"
Packit Service a1973e
.SH NAME
Packit Service a1973e
pfm_get_impl_pmcs, pfm_get_impl_pmds, pfm_get_impl_counters,
Packit Service a1973e
pfm_get_num_counters, pfm_get_num_pmcs, pfm_get_num_pmds,
Packit Service a1973e
pfm_get_hw_counter_width \- return 
Packit Service a1973e
bitmask of implemented PMU registers or number of PMU registers
Packit Service a1973e
.SH SYNOPSIS
Packit Service a1973e
.nf
Packit Service a1973e
.B #include <perfmon/pfmlib.h>
Packit Service a1973e
.sp
Packit Service a1973e
.BI "int pfm_get_impl_pmcs(pfmlib_regmask_t *" impl_pmcs ");"
Packit Service a1973e
.BI "int pfm_get_impl_pmds(pfmlib_regmask_t *" impl_pmds ");"
Packit Service a1973e
.BI "int pfm_get_impl_counters(pfmlib_regmask_t *" impl_counters ");"
Packit Service a1973e
.BI "int pfm_get_num_counters(unsigned int *"num ");"
Packit Service a1973e
.BI "int pfm_get_num_pmcs(unsigned int *"num ");"
Packit Service a1973e
.BI "int pfm_get_num_pmds(unsigned int *"num ");"
Packit Service a1973e
.BI "int pfm_get_num_counters(unsigned int *"num ");"
Packit Service a1973e
.BI "int pfm_get_hw_counter_width(unsigned int *"width ");"
Packit Service a1973e
.sp
Packit Service a1973e
.SH DESCRIPTION
Packit Service a1973e
The \fBpfm_get_impl_*()\fR functions can be used to figure out which
Packit Service a1973e
PMU registers are implemented on the host CPU. All implemented registers
Packit Service a1973e
may not necessarily be available to applications. Programs need to query
Packit Service a1973e
the operating system kernel monitoring interface to figure out the list
Packit Service a1973e
of available registers.
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_get_impl_*()\fR functions all return a bitmask of registers corresponding to
Packit Service a1973e
the query. The bitmask pointer passed as argument is reset to zero by each function.
Packit Service a1973e
The returned bitmask must be accessed using the set of functions provided by the
Packit Service a1973e
library to ensure portability. See related man pages below.
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_get_num_*()\fR functions return the number of implemented PMC or PMD
Packit Service a1973e
registers. Those numbers may be different from the actual number of registers
Packit Service a1973e
available to applications.
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_get_impl_pmcs()\fR function returns in \fBimpl_pmcs\fR the bitmask of implemented PMCS.
Packit Service a1973e
Packit Service a1973e
The \fBpfm_get_impl_pmds()\fR function returns in \fBimpl_pmds\fR the bitmask of implemented PMDS.
Packit Service a1973e
Packit Service a1973e
The \fBpfm_get_impl_counters()\fR function returns in \fBimpl_counters\fR a bitmask of the PMD
Packit Service a1973e
registers used as counters. Depending on the PMU mode, not all PMD registers are
Packit Service a1973e
necessarily used as counters.
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_get_num_counters()\fR function returns in \fBnum\fR the number of PMD
Packit Service a1973e
used as counters. A counter is a PMD which is used to accumulate the
Packit Service a1973e
number of occurrences of an event.
Packit Service a1973e
Packit Service a1973e
The \fBpfm_get_num_pmcs()\fR function returns in \fBnum\fR the number of 
Packit Service a1973e
implemented PMCs by the host PMU.
Packit Service a1973e
Packit Service a1973e
The \fBpfm_get_num_pmds()\fR function returns in \fBnum\fR the number of 
Packit Service a1973e
implemented PMDs by the host PMU.
Packit Service a1973e
Packit Service a1973e
The \fBpfm_get_hw_counter_width()\fR function returns the width in bits of the 
Packit Service a1973e
counters in \fBwidth\fR. PMU implementations can have different number of 
Packit Service a1973e
bits implemented. For instance, Itanium has 32-bit counters, while Itanium 
Packit Service a1973e
2 has 47-bits. 
Packit Service a1973e
.SH RETURN
Packit Service a1973e
The function returns whether or not it was successful.
Packit Service a1973e
A return value of \fBPFMLIB_SUCCESS\fR indicates success, 
Packit Service a1973e
otherwise the value is the error code.
Packit Service a1973e
.SH ERRORS
Packit Service a1973e
.B PFMLIB_ERR_NOINIT
Packit Service a1973e
the library has not been initialized properly.
Packit Service a1973e
.SH SEE ALSO
Packit Service a1973e
pfm_regmask_set(3), pfm_regmask_isset(3)
Packit Service a1973e
.SH AUTHOR
Packit Service a1973e
Stephane Eranian <eranian@hpl.hp.com>
Packit Service a1973e
.PP