![Freescale Semiconductor i.MX 6DualLite Reference Manual Download Page 307](http://html1.mh-extra.com/html/freescale-semiconductor/i-mx-6duallite/i-mx-6duallite_reference-manual_2330523307.webp)
44.2.1 Architecture Specific Components
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.
44.2.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.
44.2.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.
44.2.4 OProfile Daemon
The OProfile userspace daemon takes the raw data provided by the kernel and writes it to
the disk. It takes the single data stream from the kernel and logs sample data against a
number of sample files (available in /var/lib/oprofile/samples/current/). For the benefit of
Chapter 44 OProfile
i.MX 6Solo/6DualLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
Freescale Semiconductor, Inc.
307