Toolbox

Our Emperor Sponsors

  • InternetNZ
  • Google
  • IBM
  • HP

<-- Back to schedule

The new Linux performance counter subsystem

Time:11:30 - 12:15
Day:Friday 22 January 2010
Location:Renouf 1 (MFC)
Project: Linux kernel

This paper describes the perf_counter subsystem, which was introduced to Linux in version 2.6.31. This subsystem provides a way to measure and profile events that occur in a Linux system, both hardware events counted by the processors' Performance Monitor Units (PMUs) and software events that occur in the kernel. The perf_counter subsystem exposes a 'counter' abstraction which encapsulates the ideas of counting and sampling based on the occurrence of some event. For counters that are counting hardware events, the kernel takes care of programming the PMU to count those events, and if not all the requested counters can be counted by the PMU at the same time, the kernel time-slices the PMU between the requested counters.



The perf_counter subsystem supports a range of sophisticated features, including grouping of counters, counter inheritance, automatic adjustment of the sampling interval for sampling counters, and recording of mmap and exec events. These are described in detail in the paper.



The "perf" command is a userspace tool for doing measurement and profiling of applications and systems using the perf_counter kernel subsystem. It is designed for use by kernel and application developers to find places in their code that need optimization, and to measure the effect of changes to their code. The capabilities and usage of the perf command are also described in this paper.

Paul Mackerras

Paul is a Linux kernel hacker who has been hacking on the Linux kernel
for the past 14 years. He started his kernel hacking career by
porting Linux to run on the PCI Power Macintosh in 1996. From 2000
until 2007 Paul was the maintainer for the PowerPC architecture
support in the Linux kernel. Since then, Paul has been working on
Ingo Molnar, Peter Zijlstra and others on the perf_counter subsystem
in the Linux kernel. Paul wrote the support for IBM's POWER
processors in the perf_counter subsystem as well as parts of the
generic perf_counter code.