1LIBPFM(3) Linux Programmer's Manual LIBPFM(3)
2
3
4
6 libpfm_i386_p6 - support for AMD X86-64 processor family
7
9 #include <perfmon/pfmlib.h>
10 #include <perfmon/pfmlib_gen_x86_64.h>
11
12
14 The libpfm library provides full support for the X86-64 processor fam‐
15 ily when running in 64-bit mode. The interface is defined in pfm‐
16 lib_gen_x86_64.h. It consists of a set of functions and structures
17 which describe and allow access to the X86-64 specific PMU features.
18 Note that it does not support Intel EM64T processors.
19
20 When X86-64 processor specific features are needed to support a mea‐
21 surement their descriptions must be passed as model-specific input
22 arguments to the pfm_dispatch_events call. The X86-64 processors spe‐
23 cific input arguments are described in the pfm‐
24 lib_gen_x86_64_input_param_t structure and the output parameters in
25 pfmlib_gen_x86_64_output_param_t. They are defined as follows:
26
27 typedef struct {
28 unsigned int cnt_mask;
29 unsigned int flags;
30 } pfmlib_gen_x86_64_counter_t;
31
32 typedef struct {
33 pfmlib_gen_x86_64_counter_t pfp_gen_x86_64_counters[PMU_GEN_X86_64_NUM_COUNTERS];
34 uint64_t reserved[4];
35 } pfmlib_gen_x86_64_input_param_t;
36
37 typedef struct {
38 uint64_t reserved[8];
39 } pfmlib_gen_x86_64_output_param_t;
40
41
42 The X86-64 processor provides a few additional per-event features for
43 counters: thresholding, inversion, edge detection. They can be set
44 using the pfp_gen_x86_64_counters data structure for each event. The
45 flags field can be initialized as follows:
46
47 PFMLIB_GEN_X86_64_SEL_INV
48 Inverse the results of the cnt_mask comparison when set
49
50 PFMLIB_GEN_X86_64_SEL_EDGE
51 Enables edge detection of events.
52
53 The cnt_mask field contains is used to set the event threshold. The
54 value of the counter is incremented each time the number of occurrences
55 per cycle of the event is greater or equal to the value of the field.
56 When zero all occurrences are counted.
57
58
60 Refer to the description of pfm_dispatch_events() for errors.
61
63 pfm_dispatch_events(3) and set of examples shipped with the library
64
66 Stephane Eranian <eranian@hpl.hp.com>
67
68 September, 2005 LIBPFM(3)