-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
227 lines (187 loc) · 6.37 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
------------------------------------------------------------
libpfm-4.x:
a helper library to program the performance monitoring events
------------------------------------------------------------
Copyright (c) 2009 Google, Inc
Contributed by Stephane Eranian <[email protected]>
Copyright (c) 2001-2007 Hewlett-Packard Development Company, L.P.
Contributed by Stephane Eranian <[email protected]>
This package provides a library, called libpfm4 which is used to develop
monitoring tools exploiting the performance monitoring events such as those
provided by the Performance Monitoring Unit (PMU) of modern processors.
This is a complete rewrite of libpfm3 and it is NOT backward compatible
with it.
Libpfm4 helps convert from an event name, expressed as a string, to
the event encoding that is either the raw event as documented by HW vendor
or the OS-specific encoding. In the latter case, the library is able to
prepare the OS-specific data structures needed by the kernel to setup the
event.
The current libpfm4 provides support for the perf_events interface which was
introduced in Linux v2.6.31. Perfmon support is not present yet.
The library does not make any performance monitoring system calls. It is
portable and supports other operating system environments beyond Linux,
such as Mac OS X, and Windows.
The library supports many PMUs. The current version can handle:
- For AMD X86:
AMD64 K7, K8
AMD64 Fam10h (Barcelona, Shanghai, Istanbul)
AMD64 Fam11h (Turion)
AMD64 Fam12h (Llano)
AMD64 Fam14h (Bobcat)
AMD64 Fam15h (Bulldozer) (core and uncore)
AMD64 Fam16h (Jaguar)
AMD64 Fam17h (Zen1)
AMD64 Fam17h (Zen2)
AMD64 Fam19h (Zen3) (core and L3)
AMD64 Fam19h (Zen4)
- For Intel X86:
Intel P6 (Pentium II, Pentium Pro, Pentium III, Pentium M)
Intel Yonah (Core Duo/Core Solo),
Intel Core (Merom, Penryn, Dunnington)
Intel Atom
Intel Nehalem, Westmere
Intel Sandy Bridge
Intel Ivy Bridge
Intel Haswell
Intel Broadwell
Intel SkyLake
Intel CascadeLake
Intel IceLake
Intel SapphireRapid
Intel Silvermont
Intel Airmont
Intel Goldmont
Intel Tremont
Intel RAPL (energy consumption)
Intel Knights Corner
Intel Knights Landing (core, uncore)
Intel Knights Mill (core, uncore)
Intel architectural perfmon v1, v2, v3
- For ARM:
ARMV6 1136, 1176
ARMV7 Cortex A5
ARMV7 Cortex A8
ARMV7 Cortex A9
ARMV7 Cortex A15
ARMV7 Cortex A17
ARMV7 Cortex R4
ARMV7 Cortex R5
ARMV7 Cortex R7
ARMV7 Cortex R8
ARMV8 Cortex A32
ARMV8 Cortex A34
ARMV8 Cortex A35
ARMV8 Cortex A65
ARMV8 Cortex A72
ARMV8 Cortex A73
ARMV8 Cortex A75
ARMV8 Cortex A76Ae
ARMV8 Cortex A77
ARMV8 Cortex A78C
ARMV8 Cortex R52
ARMV8 Cortex R82
ARMV8 Cortex X1
ARMV8 Cortex X1C
ARMV8 Neoverse E1
ARMV8 Neoverse V1
ARMV8 Rainier
ARMV8 Cortex A57, A53, A55, A76, A78, X1
ARMV9 Cortex A510
ARMV9 Cortex A710
ARMV9 Cortex A715
ARMV9 Cortex X2
ARMV9 Cortex X3
ARMV9 Neoverse V2
Applied Micro X-Gene
Qualcomm Krait
Fujitsu A64FX
ARM Neoverse N1
ARM Neoverse N2
Huawei HiSilicon Kunpeng 920
- For SPARC
Ultra I, II
Ultra III, IIIi, III+
Ultra IV+
Niagara I, Niagara II
- For IBM
Power 4
Power 5
Power 6
Power 7
Power 8
Power 8 Nest
Power 9
Power 10
PPC970
Torrent
System z (s390x)
- For MIPS
Mips 74k
WHAT'S THERE
-------------
- the library source code including support for all processors listed
above
- a set of generic examples showing how to list and query events. They
are in examples.
- a set of examples showing how the library can be used with the
perf_events interface. They are in perf_examples.
- a set of library header files used to compile the library and
perf_examples
- man pages for all the library entry points
- Python bindings for the library
- a SPEC file to build RPMs from the library
- the Debian-style config file to build a .deb package from the library
INSTALLATION
------------
- edit config.mk to :
- update some of the configuration variables
- select your compiler options
- type make
- type make install
- The default installation location is /usr/local. You can specify
a diffierent install location as follows:
$ make PREFIX=<install-dir> install
Depending on your install location, you may need to run the 'ldconfig'
command or use LD_LIBRARY_PATH when you build and run tools that
link to the libpfm4 library.
- By default, libpfm library files are installed in <install-dir>/lib.
If 'make' builds 64-bit libraries on your system, and your target
architecture expects 64-bit libraries to be located in a library
named "lib64", then you should use the LIBDIR variable when installing,
as follows:
$ make LIBDIR=<install-dir>/lib64 install
- To compile and install the Python bindings, you need to go to the
python sub-directory and type make. Python may not be systematically
built.
- to compile the library for another ABI (e.g. 32-bit x86 on a
64-bit x86) system, you can pass the ABI flag to the compiler as
follows (assuming you have the multilib version of gcc):
$ make OPTIM="-m32 -O2"
PACKAGING
---------
The library comes with the config files necessary to generate RPMs or
Debian packages. The source code produces 3 packages:
- libpfm : runtime library
- libpfm-dev: development files (headers, manpages, static library)
- libpfm-python: Python bindings for the library
To generate the RPMs:
$ rpmbuild -ba libpfm.spec
To generate the Debian packages:
$ debuild -i -us -uc -b
You may need to install some extra packages to make Debian package
generation possible.
REQUIREMENTS:
-------------
- to run the programs in the perf_examples subdir, you MUST be using a
linux kernel with perf_events. That means v2.6.31 or later.
- to compile the Python bindings, you need to have SWIG and the python
development packages installed
- To compile on Windows, you need the MinGW and MSYS compiler environment
(see www.mingw.org). The environment needs to be augmented with the
mingw regex user contributed package (mingw-libgnurx-2.5.1.dev.tar.gz).
- To compile on Mac OS X, you need to have gmake installed.
DOCUMENTATION
-------------
- man pages for all entry points. It is recommended you start with: man libpfm
- More information can be found on library web site:
http://perfmon2.sf.net