System information
94 System Analysis and Tuning Guide
Figure7.1: Architecture of perfmon2
-
pfmon
Generic
perfmon
Architecture specific
perfmon
PMU
CPU Hardware
Linux Kernel
Userspace
Each PMU model consists of a set of registers: the performance monitor configura-
tion (PMC) and the performance monitor data (PMD). Only PMCs are writeable, but
both can be read. These registers store configuration information and data.
7.1.2 Sampling and Counting
Perfmon2 supports two modes where you can run your profiling: sampling or count-
ing.
Sampling is usually expressed by an interval of time (time-based) or an occurance of
a definied number of events (event-based). Perfmon indirectly supports time-based
sampling by using an event-based sample with constant correlation to time (for exam-
ple, unhalted_reference_cycles.)
In contrast, Counting is expressed in terms of a number of occurances of an event.
Both methods store their information into a sample. This sample contains information
about, for example, where a thread was or instruction pointers.
The following example demonstrates the counting of the CPU_OP_CYCLES event
and the sampling of this event, generating a sample per 100000 occurances of the
event:
pfmon --no-cmd-output -e CPU_OP_CYCLES_ALL /bin/ls