These pages contain the source for the user-space performance counter code. The code is meant to be called by a user-space application program like a benchmark or some other program that you want to analyze. Include the file rpi_pmu.h to define the ARM11 (ARMv6) performance events and function prototypes. The file rpi_pmu.c implements the functions and is intended to be compiled and linked with the application program.
There are two other source files: test_common.h and test_common.c. These files implement a few utility functions that I use in benchmark programs. You need these files, too, when building the benchmarks and other example programs. Include test_common.h into a program to use its definitions and functions. The file test_common.c implements the functions and is intended to be compiled and linked with the application program.
I usually keep all four of these source files in a directory called test_common. The make files for the example programs include the .h files and .c files from this common directory. That way, any change to the common routines percolates out to the example/benchmark programs.