Tree [b86c8c] v4.1.0 /

File Date Author Commit
 debian 2011-05-11 Stephane Eranian Stephane Eranian [1f2e03] add man pages to libpfm4-dev package
 docs 2011-03-24 Stephane Eranian Stephane Eranian [cdf5ce] fix man section mistmatch and NAME typos
 examples 2011-03-01 Stephane Eranian Stephane Eranian [ac66a0] add PFM_PMU_TYPE_OS_GENERIC
 include 2011-05-13 Stephane Eranian Stephane Eranian [ec366f] fix PERF_SAMPLE_MAX and PERF_FORMAT_MAX in perf...
 lib 2011-05-09 Stephane Eranian Stephane Eranian [d88744] add CPU_CLK_UNHALTED:TOTAL_CYCLES to Intel NHM/WSM
 perf_examples 2011-05-10 Corey Ashford Corey Ashford [104238] Enable translating of libpfm4 user/kernel/hyper...
 python 2011-03-17 Arun Sharma Arun Sharma [2d3ef1] fix duplicate function prototype pfm_get_perf_e...
 tests 2011-04-18 Stephane Eranian Stephane Eranian [6f0745] add support for AMD Fam14h processors
 .gitignore 2010-07-15 Corey Ashford Corey Ashford [f799ff] Exclude more compilation artifacts from git's v...
 COPYING 2011-02-28 Stephane Eranian Stephane Eranian [73e1ce] replace perf_event.h with a brand new version
 Makefile 2011-05-17 Stephane Eranian Stephane Eranian [b86c8c] cleanup debian subdir when using distclean make...
 README 2011-05-11 Stephane Eranian Stephane Eranian [ce25da] minor updates to README 2011-03-19 Stephane Eranian Stephane Eranian [759854] add missing Linux OS detection macro
 libpfm4.spec 2011-03-04 Arun Sharma Arun Sharma [c3bc12] add SPEC file to generate libpfm4 RPM packages 2009-10-02 Stephane Eranian Stephane Eranian [4ba6cc] initial commit

Read Me

          a helper library to program the performance monitoring events
 	  Copyright (c) 2009 Google, Inc
	                Contributed by Stephane Eranian <>

 	  Copyright (c) 2001-2007 Hewlett-Packard Development Company, L.P.
	                Contributed by Stephane Eranian <>

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

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.

The library supports many PMUs. The current version can handle:

	- For AMD X86:
		AMD64 K7, K8, Fam 10h, Fam14h (Bobcat)

	- 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 (Core i7, Core i5, Core i3)
		Intel Sandy Bridge (Core i7 2xxx)
		Intel architectural perfmon v1, v2, v3

	- For ARM:
		ARMV7 Cortex A8
		ARMV7 Cortex A9

	- 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

	- the library source code including support for all processors listed

	- 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

	- 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

	- edit to :
		- update some of the configuration variables
		- select your compiler options

	- type make
	- type make 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

	- 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"

	- to compile and install the library for 64-bit Power processors,
	  invoke make as follows:
		$ make BITMODE=64
		$ make BITMODE=64 install

	The library comes with the config files necessary to generate RPMs or
	Debian packages. The source code produces 3 packages:
	- libpfm4 : runtime library
	- libpfm4-dev: development files (headers, manpages, static library)
	- libpfm4-python: Python bindings for the library

	To generate the RPMs:
	$ rpmbuild -ba libpfm4.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.

	- 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

	- man pages for all entry points. It is recommended you start with: man libpfm
	- More information can be found on library web site:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks