1LIBPFM(3)                  Linux Programmer's Manual                 LIBPFM(3)
2
3
4

NAME

6       pfm_get_impl_pmcs,       pfm_get_impl_pmds,      pfm_get_impl_counters,
7       pfm_get_num_counters,        pfm_get_num_pmcs,        pfm_get_num_pmds,
8       pfm_get_hw_counter_width  - return bitmask of implemented PMU registers
9       or number of PMU registers
10

SYNOPSIS

12       #include <perfmon/pfmlib.h>
13
14       int pfm_get_impl_pmcs(pfmlib_regmask_t *impl_pmcs);
15       int pfm_get_impl_pmds(pfmlib_regmask_t *impl_pmds);
16       int pfm_get_impl_counters(pfmlib_regmask_t *impl_counters);
17       int pfm_get_num_counters(unsigned int *num);
18       int pfm_get_num_pmcs(unsigned int *num);
19       int pfm_get_num_pmds(unsigned int *num);
20       int pfm_get_num_counters(unsigned int *num);
21       int pfm_get_hw_counter_width(unsigned int *width);
22
23

DESCRIPTION

25       The pfm_get_impl_*() functions can be used to figure out which PMU reg‐
26       isters  are  implemented on the host CPU. All implemented registers may
27       not necessarily be available to applications. Programs  need  to  query
28       the operating system kernel monitoring interface to figure out the list
29       of available registers.
30
31       The pfm_get_impl_*() functions all return a bitmask of registers corre‐
32       sponding  to the query. The bitmask pointer passed as argument is reset
33       to zero by each function.  The returned bitmask must be accessed  using
34       the set of functions provided by the library to ensure portability. See
35       related man pages below.
36
37       The pfm_get_num_*() functions return the number of implemented  PMC  or
38       PMD registers. Those numbers may be different from the actual number of
39       registers available to applications.
40
41       The pfm_get_impl_pmcs() function returns in impl_pmcs  the  bitmask  of
42       implemented PMCS.
43
44       The  pfm_get_impl_pmds()  function  returns in impl_pmds the bitmask of
45       implemented PMDS.
46
47       The pfm_get_impl_counters() function returns in impl_counters a bitmask
48       of  the  PMD registers used as counters. Depending on the PMU mode, not
49       all PMD registers are necessarily used as counters.
50
51       The pfm_get_num_counters() function returns in num the  number  of  PMD
52       used  as  counters.  A counter is a PMD which is used to accumulate the
53       number of occurrences of an event.
54
55       The pfm_get_num_pmcs() function returns in num  the  number  of  imple‐
56       mented PMCs by the host PMU.
57
58       The  pfm_get_num_pmds()  function  returns  in num the number of imple‐
59       mented PMDs by the host PMU.
60
61       The pfm_get_hw_counter_width() function returns the width  in  bits  of
62       the counters in width. PMU implementations can have different number of
63       bits implemented. For instance, Itanium has 32-bit counters, while Ita‐
64       nium 2 has 47-bits.
65

RETURN

67       The  function returns whether or not it was successful.  A return value
68       of PFMLIB_SUCCESS indicates success, otherwise the value is  the  error
69       code.
70

ERRORS

72       PFMLIB_ERR_NOINIT the library has not been initialized properly.
73

SEE ALSO

75       pfm_regmask_set(3), pfm_regmask_isset(3)
76

AUTHOR

78       Stephane Eranian <eranian@hpl.hp.com>
79
80                                  July, 2003                         LIBPFM(3)
Impressum