OProfile
i.MX51 EVK Linux Reference Manual
33-2
Freescale Semiconductor
file. Each PC value is thus converted into a tuple (group or set) of binary-image offset. The userspace tools
can use this data to reconstruct where the code came from, including the particular assembly instructions,
symbol, and source line (through the binary debug information if present).
Regularly sampling the PC value like this approximates what actually was executed and how often and
more often than not, this statistical approximation is good enough to reflect reality. In common operation,
the time between each sample interrupt is regulated by a fixed number of clock cycles. This implies that
the results reflect where the CPU is spending the most time. This is a very useful information source for
performance analysis.
The ARM CPU provides hardware performance counters capable of measuring these events at the
hardware level. Typically, these counters increment once per each event and generate an interrupt on
reaching some pre-defined number of events. OProfile can use these interrupts to generate samples and the
profile results are a statistical approximation of which code caused how many instances of the given event.
33.4
Software Operation
33.4.1
Architecture Specific Components
If OProfile supports the hardware performance counters available on a particular architecture. Code for
managing the details of setting up and managing these counters can be located in the kernel source tree in
the relevant
<ltib_dir>/rpm/BUILD/linux
/
arch/arm/oprofile
directory. The architecture-specific
implementation operates through filling in the
oprofile_operations
structure at initialization. This
provides a set of operations, such as setup(), start(), stop(), and so on, that manage the hardware-specific
details the performance counter registers.
The other important facility available to the architecture code is
oprofile_add_sample
(). This is where a
particular sample taken at interrupt time is fed into the generic OProfile driver code.
33.4.2
oprofilefs Pseudo Filesystem
OProfile implements a pseudo-filesystem known as oprofilefs, which is mounted from userspace at
/dev/oprofile
. This consists of small files for reporting and receiving configuration from userspace, as
well as the actual character device that the OProfile userspace receives samples from. At setup() time, the
architecture-specific code may add further configuration files related to the details of the performance
counters. The filesystem also contains a
stats
directory with a number of useful counters for various
OProfile events.
33.4.3
Generic Kernel Driver
The generic kernel driver resides in
<ltib_dir>/rpm/BUILD/linux/drivers/oprofile/
, and forms the core
of how OProfile operates in the kernel. The generic kernel driver takes samples delivered from the
architecture-specific code (through
oprofile_add_sample
()), and buffers this data (in a transformed
configuration) until releasing the data to the userspace daemon through the
/dev/oprofile/buffer
character device.
Summary of Contents for i.MX51 EVK
Page 1: ...Part Number 924 76374 Rev 10 11 01 11 2010 i MX51 EVK Linux Reference Manual...
Page 14: ...i MX51 EVK Linux Reference Manual xiv Freescale Semiconductor...
Page 18: ...i MX51 EVK Linux Reference Manual xviii Freescale Semiconductor...
Page 24: ...i MX51 EVK Linux Reference Manual xxiv Freescale Semiconductor...
Page 38: ...Machine Specific Layer MSL i MX51 EVK Linux Reference Manual 2 8 Freescale Semiconductor...
Page 52: ...MC13892 Digitizer Driver i MX51 EVK Linux Reference Manual 5 4 Freescale Semiconductor...
Page 64: ...TV Encoder TVE Driver i MX51 EVK Linux Reference Manual 10 4 Freescale Semiconductor...
Page 82: ...Video for Linux Two V4L2 Driver i MX51 EVK Linux Reference Manual 12 8 Freescale Semiconductor...
Page 86: ...i MX5 Dual Display i MX51 EVK Linux Reference Manual 13 4 Freescale Semiconductor...
Page 100: ...X Windows Acceleration i MX51 EVK Linux Reference Manual 16 6 Freescale Semiconductor...
Page 118: ...Low Level Keypad Driver i MX51 EVK Linux Reference Manual 20 6 Freescale Semiconductor...
Page 134: ...Security Drivers i MX51 EVK Linux Reference Manual 22 10 Freescale Semiconductor...
Page 148: ...Inter IC I2C Driver i MX51 EVK Linux Reference Manual 24 4 Freescale Semiconductor...
Page 178: ...ARC USB Driver i MX51 EVK Linux Reference Manual 29 10 Freescale Semiconductor...
Page 194: ...OProfile i MX51 EVK Linux Reference Manual 33 6 Freescale Semiconductor...