Blame src/libpfm4/README

Packit Service a1973e
          ------------------------------------------------------------
Packit Service a1973e
                                    libpfm-4.x:
Packit Service a1973e
          a helper library to program the performance monitoring events
Packit Service a1973e
          ------------------------------------------------------------
Packit Service a1973e
 	  Copyright (c) 2009 Google, Inc
Packit Service a1973e
	                Contributed by Stephane Eranian <eranian@gmail.com>
Packit Service a1973e
Packit Service a1973e
 	  Copyright (c) 2001-2007 Hewlett-Packard Development Company, L.P.
Packit Service a1973e
	                Contributed by Stephane Eranian <eranian@hpl.hp.com>
Packit Service a1973e
	
Packit Service a1973e
Packit Service a1973e
This package provides a library, called libpfm4 which is used to develop
Packit Service a1973e
monitoring tools exploiting the performance monitoring events such as those
Packit Service a1973e
provided by the Performance Monitoring Unit (PMU) of modern processors.
Packit Service a1973e
Packit Service a1973e
This is a complete rewrite of libpfm3 and it is NOT backward compatible
Packit Service a1973e
with it.
Packit Service a1973e
Packit Service a1973e
Libpfm4 helps convert from an event name, expressed as a string, to 
Packit Service a1973e
the event encoding that is either the raw event as documented by HW vendor
Packit Service a1973e
or the OS-specific encoding. In the latter case, the library is able to
Packit Service a1973e
prepare the OS-specific data structures needed by the kernel to setup the
Packit Service a1973e
event.
Packit Service a1973e
Packit Service a1973e
The current libpfm4 provides support for the perf_events interface which was
Packit Service a1973e
introduced in Linux v2.6.31. Perfmon support is not present yet.
Packit Service a1973e
Packit Service a1973e
The library does not make any performance monitoring system calls. It is
Packit Service a1973e
portable and supports other operating system environments beyond Linux,
Packit Service a1973e
such as Mac OS X, and Windows.
Packit Service a1973e
Packit Service a1973e
The library supports many PMUs. The current version can handle:
Packit Service a1973e
Packit Service a1973e
	- For AMD X86:
Packit Service a1973e
		AMD64 K7, K8
Packit Service a1973e
		AMD64 Fam10h (Barcelona, Shanghai, Istanbul)
Packit Service a1973e
		AMD64 Fam11h (Turion)
Packit Service a1973e
		AMD64 Fam12h (Llano)
Packit Service a1973e
		AMD64 Fam14h (Bobcat)
Packit Service a1973e
		AMD64 Fam15h (Bulldozer) (core and uncore)
Packit Service a1973e
		AMD64 Fam16h (Jaguar)
Packit Service a1973e
		AMD64 Fam17h (Zen)
Packit Service a1973e
Packit Service a1973e
	- For Intel X86: 
Packit Service a1973e
		Intel P6 (Pentium II, Pentium Pro, Pentium III, Pentium M)
Packit Service a1973e
		Intel Yonah (Core Duo/Core Solo),
Packit Service a1973e
		Intel Core (Merom, Penryn, Dunnington)
Packit Service a1973e
		Intel Atom
Packit Service a1973e
		Intel Nehalem, Westmere
Packit Service a1973e
		Intel Sandy Bridge
Packit Service a1973e
		Intel Ivy Bridge
Packit Service a1973e
		Intel Haswell
Packit Service a1973e
		Intel Broadwell
Packit Service a1973e
		Intel SkyLake
Packit Service a1973e
		Intel Silvermont
Packit Service a1973e
		Intel Airmont
Packit Service a1973e
		Intel Goldmont
Packit Service a1973e
		Intel RAPL (energy consumption)
Packit Service a1973e
		Intel Knights Corner
Packit Service a1973e
		Intel Knights Landing (core, uncore)
Packit Service a1973e
		Intel architectural perfmon v1, v2, v3
Packit Service a1973e
Packit Service a1973e
	- For ARM:
Packit Service a1973e
		ARMV7 Cortex A8
Packit Service a1973e
		ARMV7 Cortex A9
Packit Service a1973e
		ARMV7 Cortex A15
Packit Service a1973e
		ARMV8 Cortex A57, A53
Packit Service a1973e
		Applied Micro X-Gene
Packit Service a1973e
		Qualcomm Krait
Packit Service a1973e
Packit Service a1973e
	- For SPARC
Packit Service a1973e
		Ultra I, II
Packit Service a1973e
		Ultra III, IIIi, III+
Packit Service a1973e
		Ultra IV+
Packit Service a1973e
		Niagara I, Niagara II
Packit Service a1973e
Packit Service a1973e
	- For IBM
Packit Service a1973e
		Power 4
Packit Service a1973e
		Power 5
Packit Service a1973e
		Power 6
Packit Service a1973e
		Power 7
Packit Service a1973e
		Power 8
Packit Service a1973e
		Power 8 Nest
Packit Service a1973e
		Power 9
Packit Service a1973e
		PPC970
Packit Service a1973e
		Torrent
Packit Service a1973e
		System z (s390x)
Packit Service a1973e
Packit Service a1973e
	- For MIPS
Packit Service a1973e
		Mips 74k
Packit Service a1973e
Packit Service a1973e
WHAT'S THERE
Packit Service a1973e
-------------
Packit Service a1973e
	- the library source code including support for all processors listed
Packit Service a1973e
	  above
Packit Service a1973e
Packit Service a1973e
	- a set of generic examples showing how to list and query events. They
Packit Service a1973e
	  are in examples.
Packit Service a1973e
Packit Service a1973e
	- a set of examples showing how the library can be used with the
Packit Service a1973e
	  perf_events interface. They are in perf_examples.
Packit Service a1973e
Packit Service a1973e
	- a set of library header files used to compile the library and
Packit Service a1973e
	  perf_examples
Packit Service a1973e
Packit Service a1973e
	- man pages for all the library entry points
Packit Service a1973e
Packit Service a1973e
	- Python bindings for the library
Packit Service a1973e
Packit Service a1973e
	- a SPEC file to build RPMs from the library
Packit Service a1973e
Packit Service a1973e
	- the Debian-style config file to build a .deb package from the library
Packit Service a1973e
Packit Service a1973e
INSTALLATION
Packit Service a1973e
------------
Packit Service a1973e
	- edit config.mk to :
Packit Service a1973e
		- update some of the configuration variables
Packit Service a1973e
		- select your compiler options
Packit Service a1973e
Packit Service a1973e
	- type make
Packit Service a1973e
	- type make install
Packit Service a1973e
Packit Service a1973e
	- The default installation location is /usr/local. You can specify
Packit Service a1973e
	  a diffierent install location as follows:
Packit Service a1973e
	        $ make PREFIX=<install-dir> install
Packit Service a1973e
	  Depending on your install location, you may need to run the 'ldconfig'
Packit Service a1973e
	  command or use LD_LIBRARY_PATH when you build and run tools that
Packit Service a1973e
	  link to the libpfm4 library.
Packit Service a1973e
Packit Service a1973e
	- By default, libpfm library files are installed in <install-dir>/lib.
Packit Service a1973e
	  If 'make' builds 64-bit libraries on your system, and your target
Packit Service a1973e
	  architecture expects 64-bit libraries to be located in a library
Packit Service a1973e
	  named "lib64", then you should use the LIBDIR variable when installing,
Packit Service a1973e
	  as follows:
Packit Service a1973e
	        $ make LIBDIR=<install-dir>/lib64 install
Packit Service a1973e
Packit Service a1973e
 	- To compile and install the Python bindings, you need to go to the
Packit Service a1973e
	  python sub-directory and type make. Python may not be systematically
Packit Service a1973e
	  built.
Packit Service a1973e
Packit Service a1973e
	- to compile the library for another ABI (e.g. 32-bit x86 on a
Packit Service a1973e
	  64-bit x86) system, you can pass the ABI flag to the compiler as
Packit Service a1973e
	  follows (assuming you have the multilib version of gcc):
Packit Service a1973e
		$ make OPTIM="-m32 -O2"
Packit Service a1973e
Packit Service a1973e
PACKAGING
Packit Service a1973e
---------
Packit Service a1973e
	The library comes with the config files necessary to generate RPMs or
Packit Service a1973e
	Debian packages. The source code produces 3 packages:
Packit Service a1973e
	- libpfm : runtime library
Packit Service a1973e
	- libpfm-dev: development files (headers, manpages, static library)
Packit Service a1973e
	- libpfm-python: Python bindings for the library
Packit Service a1973e
Packit Service a1973e
	To generate the RPMs:
Packit Service a1973e
	$ rpmbuild -ba libpfm.spec
Packit Service a1973e
Packit Service a1973e
	To generate the Debian packages:
Packit Service a1973e
	$ debuild -i -us -uc -b
Packit Service a1973e
Packit Service a1973e
	You may need to install some extra packages to make Debian package
Packit Service a1973e
	generation possible.
Packit Service a1973e
Packit Service a1973e
REQUIREMENTS:
Packit Service a1973e
-------------
Packit Service a1973e
	- to run the programs in the perf_examples subdir, you MUST be using a
Packit Service a1973e
	  linux kernel with perf_events. That means v2.6.31 or later.
Packit Service a1973e
Packit Service a1973e
	- to compile the Python bindings, you need to have SWIG and the python
Packit Service a1973e
	  development packages installed
Packit Service a1973e
Packit Service a1973e
	- To compile on Windows, you need the MinGW and MSYS compiler environment
Packit Service a1973e
	  (see www.mingw.org). The environment needs to be augmented with the
Packit Service a1973e
	  mingw regex user contributed package (mingw-libgnurx-2.5.1.dev.tar.gz).
Packit Service a1973e
Packit Service a1973e
	- To compile on Mac OS X, you need to have gmake installed.
Packit Service a1973e
Packit Service a1973e
DOCUMENTATION
Packit Service a1973e
-------------
Packit Service a1973e
	- man pages for all entry points. It is recommended you start with: man libpfm
Packit Service a1973e
	- More information can be found on library web site:
Packit Service a1973e
			http://perfmon2.sf.net