


README
ARM v7 Performance Counter Program
Neil Klingensmith
2011-12-24

Overview

This program was used as a tool for a class project in CS758 at UW-Madison, Fall semester 2011. There are still some glaring defects, but it is useful as a quick and dirty method for reading values out of the performance counters on an ARM v7 device.


Usage

Before using the performance counter tool, a kernel module must be inserted that enables userspace programs to read the performance counters. The kernel module source is located in the counter directory. In order to run the kernel module, you must have root access. The steps to build and run it are:

# cd counter
# make
# insmod countermod.ko

To verify it has been inserted and is running properly:

# lsmod

Module                  Size  Used by
countermod               614  0 

# dmesg | tail

Enabling performance counters.

Once userspace performance counter reading has been enabled, run performance counter tests using:

# cd userspace-perfcounter
# make
# taskset 2 ./userspace-perfcounter <command>

Where <command> is the program to count performance events on. By running it as an argument to taskset, it is forced to run only on core 1. This is necessary because the machine instructions that read the performance counters must be run on core 1. I could not find a way to force only those instructions to be run on core 1, but allow all other instructions to run on either core.

NOTE: This software was tested on an ARM Cortex-A9 device (the Panda Board). It may not work properly on other ARM v7 cores.


License

This software is licensed under the GNU GPL v3.0. You should have received a copy of the license when you downloaded the software. If not, please download a copy for www.gnu.org.

