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

NAME

6       libpfm_core - support for Intel Core processor family
7

SYNOPSIS

9       #include <perfmon/pfmlib.h>
10       #include <perfmon/pfmlib_core.h>
11
12

DESCRIPTION

14       The  libpfm  library provides full support for the Intel Core processor
15       family, including the Core 2 Duo and  Quad  series.  The  interface  is
16       defined  in pfmlib_core.h. It consists of a set of functions and struc‐
17       tures which describe and allow access to the Intel Core processors spe‐
18       cific PMU features.
19
20       When  Intel  Core  processor  specific features are needed to support a
21       measurement, their descriptions must be passed as model-specific  input
22       arguments to the pfm_dispatch_events() function. The Intel Core proces‐
23       sors   specific   input   arguments   are   described   in   the   pfm‐
24       lib_core_input_param_t  structure.  No  output parameters are currently
25       defined. The input parameters are defined as follows:
26
27       typedef struct {
28            unsigned int   cnt_mask;
29            unsigned int   flags;
30       } pfmlib_core_counter_t;
31
32       typedef struct {
33            unsigned int pebs_used;
34       } pfmlib_core_pebs_t;
35
36       typedef struct {
37            pfmlib_core_counter_t    pfp_core_counters[PMU_CORE_NUM_COUNTERS];
38            pfmlib_core_pebs_t  pfp_core_pebs;
39            uint64_t       reserved[4];
40       } pfmlib_core_input_param_t;
41
42
43       The Intel Core processor provides a few additional  per-event  features
44       for  counters: thresholding, inversion, edge detection. They can be set
45       using the pfp_core_counters data structure for each event.   The  flags
46       field can be initialized with any combinations of the following values:
47
48       PFMLIB_CORE_SEL_INV
49              Inverse the results of the cnt_mask comparison when set
50
51       PFMLIB_CORE_SEL_EDGE
52              Enables edge detection of events.
53
54       The  cnt_mask  field  is used to set the event threshold.  The value of
55       the counter is incremented each time  the  number  of  occurrences  per
56       cycle of the event is greater or equal to the value of the field.  Thus
57       the event is modified to actually  measure  the  number  of  qualifying
58       cycles.  When zero all occurrences are counted (this is the default).
59
60

Support for Precise-Event Based Sampling (PEBS)

62       The  library can be used to setup the PMC registers when using PEBS. In
63       this case, the pfp_core_pebs structure must be used and  the  pebs_used
64       field must be set to 1. When using PEBS, it is not possible to use more
65       than one event.
66

Support for Intel Core 2 Duo and Quad processors

68       The Intel Core 2 Duo and Quad processors are based on  the  Intel  Core
69       micro-architecture.   They  implement  the  Intel architectural PMU and
70       some extensions such as  PEBS.   They  support  all  the  architectural
71       events and a lot more Core 2 specific events.  The library auto-detects
72       the processor and provides access to Core 2 events whenever possible.
73

ERRORS

75       Refer to the description  of  the  pfm_dispatch_events()  function  for
76       errors.
77

SEE ALSO

79       pfm_dispatch_events(3) and set of examples shipped with the library
80

AUTHOR

82       Stephane Eranian <eranian@hpl.hp.com>
83
84                                November, 2006                       LIBPFM(3)
Impressum