39.2.3. Separating Kernel and User-space Profiles

39.2.3. Separating Kernel and User-space Profiles

By default, kernel mode and user mode information is gathered for each event. To configure OProfile to ignore events in kernel mode for a specific counter, execute the following command:

opcontrol --event=<event-name>:<sample-rate>:<unit-mask>:0

Execute the following command to start profiling kernel mode for the counter again:

opcontrol --event=<event-name>:<sample-rate>:<unit-mask>:1

To configure OProfile to ignore events in user mode for a specific counter, execute the following command:

opcontrol --event=<event-name>:<sample-rate>:<unit-mask>:<kernel>:0

Execute the following command to start profiling user mode for the counter again:

opcontrol --event=<event-name>:<sample-rate>:<unit-mask>:<kernel>:1

When the OProfile daemon writes the profile data to sample files, it can separate the kernel and library profile data into separate sample files. To configure how the daemon writes to sample files, execute the following command as root:

opcontrol --separate=<choice>

<choice> can be one of the following:

If --separate=library is used, the sample file name includes the name of the executable as well as the name of the library.

Note

These configuration changes will take effect when oprofile is restarted.


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.