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

Packit Service a1973e
.TH LIBPFM 3  "November, 2003" "" "Linux Programmer's Manual"
Packit Service a1973e
.SH NAME
Packit Service a1973e
pfm_get_pmu_name, pfm_get_pmu_type, pfm_get_pmu_name_bytype, pfm_pmu_is_supported, pfm_force_pmu,pfm_list_supported_pmu \- query library about supported PMU models
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_pmu_name(char *"name ", int " maxlen);
Packit Service a1973e
.BI "int pfm_get_pmu_type(int *" type);
Packit Service a1973e
.BI "int pfm_get_pmu_name_bytype(int " type ", char *" name ", int " maxlen);
Packit Service a1973e
.BI "int pfm_pmu_is_supported(int " type);
Packit Service a1973e
.BI "int pfm_force_pmu(int " type);
Packit Service a1973e
.BI "int pfm_list_supported_pmus(int (*" pf ")(const char *"fmt ",...));"
Packit Service a1973e
.sp
Packit Service a1973e
.SH DESCRIPTION
Packit Service a1973e
These functions retrieve information about the detected host PMU
Packit Service a1973e
and the PMU models supported by the library. More than one model
Packit Service a1973e
can be supported by the same library.
Packit Service a1973e
Packit Service a1973e
Each PMU model is assigned a type and a name. The latter is just
Packit Service a1973e
a string and the former is a unique identifier. The currently 
Packit Service a1973e
supported types are:
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_GENERIC_PMU
Packit Service a1973e
Intel Itanium default architected PMU model, i.e., the basic model.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_ITANIUM_PMU
Packit Service a1973e
Intel Itanium processor PMU model. The model is found in the first
Packit Service a1973e
implementation of the IA-64 architecture, code name Merced.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_ITANIUM2_PMU
Packit Service a1973e
Intel Itanium 2 processor PMU model. This is the model provided
Packit Service a1973e
by McKinley, Madison, and Deerfield processors.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MONTECITO_PMU
Packit Service a1973e
Intel Dual-core Itanium 2 processor PMU model. This is the model provided
Packit Service a1973e
by Montecito, Montvale processors.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_AMD64_PMU
Packit Service a1973e
AMD AMD64 processors (family 15 and 16)
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_GEN_IA32_PMU
Packit Service a1973e
 Intel X86 architectural PMU v1, v2, v3
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_I386_P6_PMU
Packit Service a1973e
Intel P6 processors. That includes Pentium Pro, Pentium II, Pentium III, but excludes Pentium M
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_I386_PM_PMU
Packit Service a1973e
Intel Pentium M processors.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_INTEL_PII_PMU
Packit Service a1973e
Intel Pentium II processors.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_PENTIUM4_PMU
Packit Service a1973e
Intel processors based on Netburst micro-architecture. That includes Pentium 4.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_COREDUO_PMU
Packit Service a1973e
Intel processors based on Yonah micro-architecture. That includes Intel Core Duo/Core Solo processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_I386_PM_PMU
Packit Service a1973e
Intel Pentium M processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_INTEL_CORE_PMU
Packit Service a1973e
Intel processors based on the Core micro-architecture. That includes Intel Core 2 Duo/Quad processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_INTEL_ATOM_PMU
Packit Service a1973e
Intel processors based on the Atom micro-architecture.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_INTEL_NHM_PMU
Packit Service a1973e
Intel processors based on the Nehalem micro-architectures. That includes Intel Core i7 processors.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_20KC_PMU
Packit Service a1973e
MIPS 20KC  processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_24K_PMU
Packit Service a1973e
MIPS 24K processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_25KF_PMU
Packit Service a1973e
MIPS 25KF processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_34K_PMU
Packit Service a1973e
MIPS 34K processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_5KC_PMU
Packit Service a1973e
MIPS 5KC processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_74K_PMU
Packit Service a1973e
MIPS 74K  processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_R10000_PMU
Packit Service a1973e
MIPS R10000 processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_R12000_PMU
Packit Service a1973e
MIPS R12000 processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_RM7000_PMU
Packit Service a1973e
MIPS RM7000 processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_RM9000_PMU
Packit Service a1973e
MIPS RM9000 processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_SB1_PMU
Packit Service a1973e
MIPS SB1/SB1A processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_VR5432_PMU
Packit Service a1973e
MIPS VR5432 processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_VR5500_PMU
Packit Service a1973e
MIPS VR5500 processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_ICE9A_PMU
Packit Service a1973e
SiCortex ICE9A
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_MIPS_ICE9B_PMU
Packit Service a1973e
SiCortex ICE9B
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_POWERPC_PMU
Packit Service a1973e
IBM POWERPC processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_CRAYX2_PMU
Packit Service a1973e
Cray X2  processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_CELL_PMU
Packit Service a1973e
IBM Cell processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_PPC970_PMU
Packit Service a1973e
IBM PowerPC 970(FX,GX) processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_PPC970MP_PMU
Packit Service a1973e
IBM PowerPC 970MP processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_POWER3_PMU
Packit Service a1973e
IBM POWER3  processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_POWER4_PMU
Packit Service a1973e
IBM POWER4 processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_POWER5_PMU
Packit Service a1973e
IBM POWER5 processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_POWER5p_PMU
Packit Service a1973e
BM POWER5+ processors
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_POWER6_PMU
Packit Service a1973e
IBM POWER6 processors
Packit Service a1973e
.LP
Packit Service a1973e
The \fBpfm_get_pmu_name()\fR function returns the name of the detected 
Packit Service a1973e
host PMU. The library must have been initialized properly before making this
Packit Service a1973e
call. The name is returned in the \fBname\fR argument. The \fBmaxlen\fR argument 
Packit Service a1973e
indicates the maximum length of the buffer provided for \fBname\fR.
Packit Service a1973e
Up to \fBmaxlen-1\fR characters will be returned, not including the
Packit Service a1973e
termination character.
Packit Service a1973e
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_get_pmu_type()\fR function returns the type of the detected host
Packit Service a1973e
PMU. The library must have been initialized properly before making this
Packit Service a1973e
call. The type returned in  \fBtype\fR can be any one of the three listed above. 
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_get_pmu_name_bytype()\fR function returns the name of a PMU model in
Packit Service a1973e
\fBname\fR given a type in the \fBtype\fR argument. The \fBmaxlen\fR argument 
Packit Service a1973e
indicates the maximum length of the buffer provided for \fBname\fR.
Packit Service a1973e
Up to \fBmaxlen-1\fR characters will be returned, not including the
Packit Service a1973e
termination character.
Packit Service a1973e
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_pmu_is_supported()\fR function returns \fBPFMLIB_SUCCESS\fR if the given
Packit Service a1973e
PMU type is supported by the library independently of what the host PMU model is.
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_force_pmu()\fR function is used to forced the library to use a particular
Packit Service a1973e
PMU model compared to what it has detected. The library checks that the selected 
Packit Service a1973e
type can be supported by the host PMU. This is mostly useful to force the
Packit Service a1973e
library to the use generic PMU model \fBPFMLIB_GENERIC_PMU\fR.  This function can
Packit Service a1973e
be called at any time and upon return the library is considered initialized.
Packit Service a1973e
.sp
Packit Service a1973e
The \fBpfm_list_supported_pmu()\fR function is used to print the list PMU types
Packit Service a1973e
that the library supports. The results is printed using the function provided
Packit Service a1973e
in the \fBpf\fR argument, which must be a printf-style function.
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
.TP
Packit Service a1973e
.B PFMLIB_ERR_INVAL
Packit Service a1973e
invalid argument was given, most likely invalid pointer or invalid PMU type.
Packit Service a1973e
.TP
Packit Service a1973e
.B PFMLIB_ERR_NOTSUPP
Packit Service a1973e
the selected PMU type can be used on the host CPU.
Packit Service a1973e
.SH AUTHOR
Packit Service a1973e
Stephane Eranian <eranian@hpl.hp.com>
Packit Service a1973e
.PP