Cari di RHE Linux 
    RHE Linux User Manual
Daftar Isi
(Sebelumnya) 13 : Chapter 22. Automatic Bug ...13 : Part VII. Kernel, Module ... (Berikutnya)

Deployment Guide

Chapter 23. OProfile

OProfile is a low overhead, system-wide performance monitoring tool. It uses the performance monitoring hardware on the processor to retrieve information about the kernel and executables on the system, such as when memory is referenced, the number of L2 cache requests, and the number of hardware interrupts received. On a Red Hat Enterprise Linux system, the oprofile package must be installed to use this tool.
Many processors include dedicated performance monitoring hardware. This hardware makes it possible to detect when certain events happen (such as the requested data not being in cache). The hardware normally takes the form of one or more counters that are incremented each time an event takes place. When the counter value, essentially rolls over, an interrupt is generated, making it possible to control the amount of detail (and therefore, overhead) produced by performance monitoring.
OProfile uses this hardware (or a timer-based substitute in cases where performance monitoring hardware is not present) to collect samples of performance-related data each time a counter generates an interrupt. These samples are periodically written out to disk; later, the data contained in these samples can then be used to generate reports on system-level and application-level performance.
OProfile is a useful tool, but be aware of some limitations when using it:
  • Use of shared libraries - Samples for code in shared libraries are not attributed to the particular application unless the --separate=library option is used.
  • Performance monitoring samples are inexact - When a performance monitoring register triggers a sample, the interrupt handling is not precise like a divide by zero exception. Due to the out-of-order execution of instructions by the processor, the sample may be recorded on a nearby instruction.
  • opreport does not associate samples for inline functions properly - opreport uses a simple address range mechanism to determine which function an address is in. Inline function samples are not attributed to the inline function but rather to the function the inline function was inserted into.
  • OProfile accumulates data from multiple runs - OProfile is a system-wide profiler and expects processes to start up and shut down multiple times. Thus, samples from multiple runs accumulate. Use the command opcontrol --reset to clear out the samples from previous runs.
  • Hardware performance counters do not work on guest virtual machines - Because the hardware performance counters are not available on virtual systems, you need to use the timer mode. Run the command opcontrol --deinit, and then execute modprobe oprofile timer=1 to enable the timer mode.
  • Non-CPU-limited performance problems - OProfile is oriented to finding problems with CPU-limited processes. OProfile does not identify processes that are asleep because they are waiting on locks or for some other event to occur (for example an I/O device to finish an operation).

23.1. Overview of Tools

Table 23.1, "OProfile Commands" provides a brief overview of the tools provided with the oprofile package.

Table 23.1. OProfile Commands

CommandDescription
ophelp
Displays available events for the system's processor along with a brief description of each.
opimport
Converts sample database files from a foreign binary format to the native format for the system. Only use this option when analyzing a sample database from a different architecture.
opannotateCreates annotated source for an executable if the application was compiled with debugging symbols. Refer to Section 23.5.4, "Using opannotate" for details.
opcontrol
Configures what data is collected. Refer to Section 23.2, "Configuring OProfile" for details.
opreport
Retrieves profile data. Refer to Section 23.5.1, "Using opreport" for details.
oprofiled
Runs as a daemon to periodically write sample data to disk.

23.2. Configuring OProfile

Before OProfile can be run, it must be configured. At a minimum, selecting to monitor the kernel (or selecting not to monitor the kernel) is required. The following sections describe how to use the opcontrol utility to configure OProfile. As the opcontrol commands are executed, the setup options are saved to the /root/.oprofile/daemonrc file.

23.2.1. Specifying the Kernel

First, configure whether OProfile should monitor the kernel. This is the only configuration option that is required before starting OProfile. All others are optional.
To monitor the kernel, execute the following command as root:
~]# opcontrol --setup --vmlinux=/usr/lib/debug/lib/modules/`uname -r`/vmlinux

Install the debuginfo package

The debuginfo package for the kernel must be installed (which contains the uncompressed kernel) in order to monitor the kernel.
To configure OProfile not to monitor the kernel, execute the following command as root:
~]# opcontrol --setup --no-vmlinux
This command also loads the oprofile kernel module, if it is not already loaded, and creates the /dev/oprofile/ directory, if it does not already exist. Refer to Section 23.6, "Understanding /dev/oprofile/" for details about this directory.
Setting whether samples should be collected within the kernel only changes what data is collected, not how or where the collected data is stored. To generate different sample files for the kernel and application libraries, refer to Section 23.2.3, "Separating Kernel and User-space Profiles".

23.2.2. Setting Events to Monitor

Most processors contain counters, which are used by OProfile to monitor specific events. As shown in Table 23.2, "OProfile Processors and Counters", the number of counters available depends on the processor.

Table 23.2. OProfile Processors and Counters

Processorcpu_typeNumber of Counters
AMD64x86-64/hammer4
AMD Athloni386/athlon4
AMD Family 10hx86-64/family104
AMD Family 11hx86-64/family114
AMD Family 12hx86-64/family124
AMD Family 14hx86-64/family144
AMD Family 15hx86-64/family156
IBM eServer System i and IBM eServer System ptimer1
IBM POWER4ppc64/power48
IBM POWER5ppc64/power56
IBM PowerPC 970ppc64/9708
IBM S/390 and IBM System ztimer1
Intel Core i7i386/core_i74
Intel Nehalem microarchitecturei386/nehalem4
Intel Pentium 4 (non-hyper-threaded)i386/p48
Intel Pentium 4 (hyper-threaded)i386/p4-ht4
Intel Westmere microarchitecturei386/westmere4
TIMER_INTtimer1

Use Table 23.2, "OProfile Processors and Counters" to verify that the correct processor type was detected and to determine the number of events that can be monitored simultaneously. timer is used as the processor type if the processor does not have supported performance monitoring hardware.
If timer is used, events cannot be set for any processor because the hardware does not have support for hardware performance counters. Instead, the timer interrupt is used for profiling.
If timer is not used as the processor type, the events monitored can be changed, and counter 0 for the processor is set to a time-based event by default. If more than one counter exists on the processor, the counters other than counter 0 are not set to an event by default. The default events monitored are shown in Table 23.3, "Default Events".

Table 23.3. Default Events

ProcessorDefault Event for CounterDescription
AMD Athlon and AMD64CPU_CLK_UNHALTEDThe processor's clock is not halted
AMD Family 10h, AMD Family 11h, AMD Family 12hCPU_CLK_UNHALTEDThe processor's clock is not halted
AMD Family 14h, AMD Family 15hCPU_CLK_UNHALTEDThe processor's clock is not halted
IBM POWER4CYCLESProcessor Cycles
IBM POWER5CYCLESProcessor Cycles
IBM PowerPC 970CYCLESProcessor Cycles
Intel Core i7CPU_CLK_UNHALTEDThe processor's clock is not halted
Intel Nehalem microarchitectureCPU_CLK_UNHALTEDThe processor's clock is not halted
Intel Pentium 4 (hyper-threaded and non-hyper-threaded)GLOBAL_POWER_EVENTSThe time during which the processor is not stopped
Intel Westmere microarchitectureCPU_CLK_UNHALTEDThe processor's clock is not halted
TIMER_INT(none)Sample for each timer interrupt

The number of events that can be monitored at one time is determined by the number of counters for the processor. However, it is not a one-to-one correlation; on some processors, certain events must be mapped to specific counters. To determine the number of counters available, execute the following command:
~]# ls -d /dev/oprofile/[0-9]*
The events available vary depending on the processor type. To determine the events available for profiling, execute the following command as root (the list is specific to the system's processor type):
~]# ophelp

Make sure that OProfile is configured

Unless OProfile is be properly configured, the ophelp fails with the following error message:
Unable to open cpu_type file for readingMake sure you have done opcontrol --initcpu_type 'unset' is not validyou should upgrade oprofile or force the use of timer mode
To configure OProfile, follow the instructions in Section 23.2, "Configuring OProfile".
The events for each counter can be configured via the command line or with a graphical interface. For more information on the graphical interface, refer to Section 23.9, "Graphical Interface". If the counter cannot be set to a specific event, an error message is displayed.
To set the event for each configurable counter via the command line, use opcontrol:
~]# opcontrol --event=event-name:sample-rate
Replace event-name with the exact name of the event from ophelp, and replace sample-rate with the number of events between samples.

23.2.2.1. Sampling Rate

By default, a time-based event set is selected. It creates a sample every 100,000 clock cycles per processor. If the timer interrupt is used, the timer is set to whatever the jiffy rate is and is not user-settable. If the cpu_type is not timer, each event can have a sampling rate set for it. The sampling rate is the number of events between each sample snapshot.
When setting the event for the counter, a sample rate can also be specified:
~]# opcontrol --event=event-name:sample-rate
Replace sample-rate with the number of events to wait before sampling again. The smaller the count, the more frequent the samples. For events that do not happen frequently, a lower count may be needed to capture the event instances.

Sampling too frequently can overload the system

Be extremely careful when setting sampling rates. Sampling too frequently can overload the system, causing the system to appear as if it is frozen or causing the system to actually freeze.

23.2.2.2. Unit Masks

Some user performance monitoring events may also require unit masks to further define the event.
Unit masks for each event are listed with the ophelp command. The values for each unit mask are listed in hexadecimal format. To specify more than one unit mask, the hexadecimal values must be combined using a bitwise or operation.
~]# opcontrol --event=event-name:sample-rate:unit-mask

23.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:
  • none - Do not separate the profiles (default).
  • library - Generate per-application profiles for libraries.
  • kernel - Generate per-application profiles for the kernel and kernel modules.
  • all - Generate per-application profiles for libraries and per-application profiles for the kernel and kernel modules.
If --separate=library is used, the sample file name includes the name of the executable as well as the name of the library.

Restart the OProfile profiler

These configuration changes will take effect when the OProfile profiler is restarted.

23.3. Starting and Stopping OProfile

To start monitoring the system with OProfile, execute the following command as root:
~]# opcontrol --start
Output similar to the following is displayed:
Using log file /var/lib/oprofile/oprofiled.log Daemon started. Profiler running.
The settings in /root/.oprofile/daemonrc are used.
The OProfile daemon, oprofiled, is started; it periodically writes the sample data to the /var/lib/oprofile/samples/ directory. The log file for the daemon is located at /var/lib/oprofile/oprofiled.log.

Disable the nmi_watchdog registers

On a Red Hat Enterprise Linux 6 system, the nmi_watchdog registers with the perf subsystem. Due to this, the perf subsystem grabs control of the performance counter registers at boot time, blocking OProfile from working.
To resolve this, either boot with the nmi_watchdog=0 kernel parameter set, or run the following command to disable nmi_watchdog at run time:
~]# echo 0 > /proc/sys/kernel/nmi_watchdog
To re-enable nmi_watchdog, use the following command:
~]# echo 1 > /proc/sys/kernel/nmi_watchdog
To stop the profiler, execute the following command as root:
~]# opcontrol --shutdown

23.4. Saving Data

Sometimes it is useful to save samples at a specific time. For example, when profiling an executable, it may be useful to gather different samples based on different input data sets. If the number of events to be monitored exceeds the number of counters available for the processor, multiple runs of OProfile can be used to collect data, saving the sample data to different files each time.
To save the current set of sample files, execute the following command, replacing name with a unique descriptive name for the current session.
~]# opcontrol --save=name
The directory /var/lib/oprofile/samples/name/ is created and the current sample files are copied to it.

23.5. Analyzing the Data

Periodically, the OProfile daemon, oprofiled, collects the samples and writes them to the /var/lib/oprofile/samples/ directory. Before reading the data, make sure all data has been written to this directory by executing the following command as root:
~]# opcontrol --dump
Each sample file name is based on the name of the executable. For example, the samples for the default event on a Pentium III processor for /bin/bash becomes:
\{root\}/bin/bash/\{dep\}/\{root\}/bin/bash/CPU_CLK_UNHALTED.100000
The following tools are available to profile the sample data once it has been collected:
  • opreport
  • opannotate
Use these tools, along with the binaries profiled, to generate reports that can be further analyzed.

Back up the executable and the sample files

The executable being profiled must be used with these tools to analyze the data. If it must change after the data is collected, back up the executable used to create the samples as well as the sample files. Please note that the sample file and the binary have to agree. Making a backup is not going to work if they do not match. oparchive can be used to address this problem.
Samples for each executable are written to a single sample file. Samples from each dynamically linked library are also written to a single sample file. While OProfile is running, if the executable being monitored changes and a sample file for the executable exists, the existing sample file is automatically deleted. Thus, if the existing sample file is needed, it must be backed up, along with the executable used to create it before replacing the executable with a new version. The OProfile analysis tools use the executable file that created the samples during analysis. If the executable changes the analysis tools will be unable to analyze the associated samples. Refer to Section 23.4, "Saving Data" for details on how to back up the sample file.

23.5.1. Using opreport

The opreport tool provides an overview of all the executables being profiled.
The following is part of a sample output:
Profiling through timer interruptTIMER:0|samples|  %|------------------25926 97.5212 no-vmlinux359  1.3504 pi65  0.2445 Xorg62  0.2332 libvte.so.4.4.056  0.2106 libc-2.3.4.so34  0.1279 libglib-2.0.so.0.400.719  0.0715 libXft.so.2.1.217  0.0639 bash8  0.0301 ld-2.3.4.so8  0.0301 libgdk-x11-2.0.so.0.400.136  0.0226 libgobject-2.0.so.0.400.75  0.0188 oprofiled4  0.0150 libpthread-2.3.4.so4  0.0150 libgtk-x11-2.0.so.0.400.133  0.0113 libXrender.so.1.2.23  0.0113 du1  0.0038 libcrypto.so.0.9.7a1  0.0038 libpam.so.0.771  0.0038 libtermcap.so.2.0.81  0.0038 libX11.so.6.21  0.0038 libgthread-2.0.so.0.400.71  0.0038 libwnck-1.so.4.9.0
Each executable is listed on its own line. The first column is the number of samples recorded for the executable. The second column is the percentage of samples relative to the total number of samples. The third column is the name of the executable.
Refer to the opreport man page for a list of available command line options, such as the -r option used to sort the output from the executable with the smallest number of samples to the one with the largest number of samples.

23.5.2. Using opreport on a Single Executable

To retrieve more detailed profiled information about a specific executable, use opreport:
~]# opreport mode executable
executable must be the full path to the executable to be analyzed. mode must be one of the following:
-l
List sample data by symbols. For example, the following is part of the output from running the command opreport -l /lib/tls/libc-version.so:
samples % symbol name 12 21.4286 __gconv_transform_utf8_internal 5 8.9286 _int_malloc 4 7.1429 malloc 3 5.3571 __i686.get_pc_thunk.bx 3 5.3571 _dl_mcount_wrapper_check 3 5.3571 mbrtowc 3 5.3571 memcpy 2 3.5714 _int_realloc 2 3.5714 _nl_intern_locale_data 2 3.5714 free 2 3.5714 strcmp 1 1.7857 __ctype_get_mb_cur_max 1 1.7857 __unregister_atfork 1 1.7857 __write_nocancel 1 1.7857 _dl_addr 1 1.7857 _int_free 1 1.7857 _itoa_word 1 1.7857 calc_eclosure_iter 1 1.7857 fopen@@GLIBC_2.1 1 1.7857 getpid 1 1.7857 memmove 1 1.7857 msort_with_tmp 1 1.7857 strcpy 1 1.7857 strlen 1 1.7857 vfprintf 1 1.7857 write
The first column is the number of samples for the symbol, the second column is the percentage of samples for this symbol relative to the overall samples for the executable, and the third column is the symbol name.
To sort the output from the largest number of samples to the smallest (reverse order), use -r in conjunction with the -l option.
-i symbol-name
List sample data specific to a symbol name. For example, the following output is from the command opreport -l -i __gconv_transform_utf8_internal /lib/tls/libc-version.so:
samples % symbol name 12 100.000 __gconv_transform_utf8_internal
The first line is a summary for the symbol/executable combination.
The first column is the number of samples for the memory symbol. The second column is the percentage of samples for the memory address relative to the total number of samples for the symbol. The third column is the symbol name.
-d
List sample data by symbols with more detail than -l. For example, the following output is from the command opreport -l -d __gconv_transform_utf8_internal /lib/tls/libc-version.so:
vma samples % symbol name 00a98640 12 100.000 __gconv_transform_utf8_internal 00a98640 1 8.3333 00a9868c 2 16.6667 00a9869a 1 8.3333 00a986c1 1 8.3333 00a98720 1 8.3333 00a98749 1 8.3333 00a98753 1 8.3333 00a98789 1 8.3333 00a98864 1 8.3333 00a98869 1 8.3333 00a98b08 1 8.3333
The data is the same as the -l option except that for each symbol, each virtual memory address used is shown. For each virtual memory address, the number of samples and percentage of samples relative to the number of samples for the symbol is displayed.
-x symbol-name
Exclude the comma-separated list of symbols from the output.
session:name
Specify the full path to the session or a directory relative to the /var/lib/oprofile/samples/ directory.

23.5.3. Getting more detailed output on the modules

OProfile collects data on a system-wide basis for kernel- and user-space code running on the machine. However, once a module is loaded into the kernel, the information about the origin of the kernel module is lost. The module could have come from the initrd file on boot up, the directory with the various kernel modules, or a locally created kernel module. As a result, when OProfile records sample for a module, it just lists the samples for the modules for an executable in the root directory, but this is unlikely to be the place with the actual code for the module. You will need to take some steps to make sure that analysis tools get the executable.
To get a more detailed view of the actions of the module, you will need to either have the module "unstripped" (that is installed from a custom build) or have the debuginfo package installed for the kernel.
Find out which kernel is running with the uname -a command, obtain the appropriate debuginfo package and install it on the machine.
Then proceed with clearing out the samples from previous runs with the following command:
~]# opcontrol --reset
To start the monitoring process, for example, on a machine with Westmere processor, run the following command:
~]# opcontrol --setup --vmlinux=/usr/lib/debug/lib/modules/`uname -r`/vmlinux --event=CPU_CLK_UNHALTED:500000
Then the detailed information, for instance, for the ext4 module can be obtained with:
~]# opreport /ext4 -l --image-path /lib/modules/`uname -r`/kernelCPU: Intel Westmere microarchitecture, speed 2.667e+06 MHz (estimated)Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 500000warning: could not check that the binary file /lib/modules/2.6.32-191.el6.x86_64/kernel/fs/ext4/ext4.ko has not been modified since the profile was taken. Results may be inaccurate.samples  % symbol name1622  9.8381  ext4_iget1591  9.6500  ext4_find_entry1231  7.4665  __ext4_get_inode_loc783   4.7492  ext4_ext_get_blocks752   4.5612  ext4_check_dir_entry644   3.9061  ext4_mark_iloc_dirty583   3.5361  ext4_get_blocks583   3.5361  ext4_xattr_get479   2.9053  ext4_htree_store_dirent469   2.8447  ext4_get_group_desc414   2.5111  ext4_dx_find_entry

23.5.4. Using opannotate

The opannotate tool tries to match the samples for particular instructions to the corresponding lines in the source code. The resulting files generated should have the samples for the lines at the left. It also puts in a comment at the beginning of each function listing the total samples for the function.
For this utility to work, the appropriate debuginfo package for the executable must be installed on the system. On Red Hat Enterprise Linux, the debuginfo packages are not automatically installed with the corresponding packages that contain the executable. You have to obtain and install them separately.
The general syntax for opannotate is as follows:
~]# opannotate --search-dirs src-dir --source executable
The directory containing the source code and the executable to be analyzed must be specified. Refer to the opannotate man page for a list of additional command line options.

23.6. Understanding /dev/oprofile/

The /dev/oprofile/ directory contains the file system for OProfile. Use the cat command to display the values of the virtual files in this file system. For example, the following command displays the type of processor OProfile detected:
~]# cat /dev/oprofile/cpu_type
A directory exists in /dev/oprofile/ for each counter. For example, if there are 2 counters, the directories /dev/oprofile/0/ and dev/oprofile/1/ exist.
Each directory for a counter contains the following files:
  • count - The interval between samples.
  • enabled - If 0, the counter is off and no samples are collected for it; if 1, the counter is on and samples are being collected for it.
  • event - The event to monitor.
  • extra - Used on machines with Nehalem processors to further specify the event to monitor.
  • kernel - If 0, samples are not collected for this counter event when the processor is in kernel-space; if 1, samples are collected even if the processor is in kernel-space.
  • unit_mask - Defines which unit masks are enabled for the counter.
  • user - If 0, samples are not collected for the counter event when the processor is in user-space; if 1, samples are collected even if the processor is in user-space.
The values of these files can be retrieved with the cat command. For example:
~]# cat /dev/oprofile/0/count

23.7. Example Usage

While OProfile can be used by developers to analyze application performance, it can also be used by system administrators to perform system analysis. For example:
  • Determine which applications and services are used the most on a system - opreport can be used to determine how much processor time an application or service uses. If the system is used for multiple services but is under performing, the services consuming the most processor time can be moved to dedicated systems.
  • Determine processor usage - The CPU_CLK_UNHALTED event can be monitored to determine the processor load over a given period of time. This data can then be used to determine if additional processors or a faster processor might improve system performance.

23.8. OProfile Support for Java

OProfile allows you to profile dynamically compiled code (also known as "just-in-time" or JIT code) of the Java Virtual Machine (JVM). OProfile in Red Hat Enterprise Linux 6 includes built-in support for the JVM Tools Interface (JVMTI) agent library, which supports Java 1.5 and higher.

23.8.1. Profiling Java Code

To profile JIT code from the Java Virtual Machine with the JVMTI agent, add the following to the JVM startup parameters:
-agentlib:jvmti_oprofile

Install the oprofile-jit package

The oprofile-jit package must be installed on the system in order to profile JIT code with OProfile.
To learn more about Java support in OProfile, refer to the OProfile Manual, which is linked from Section 23.11, "Additional Resources".

23.9. Graphical Interface

Some OProfile preferences can be set with a graphical interface. To start it, execute the oprof_start command as root at a shell prompt. To use the graphical interface, you will need to have the oprofile-gui package installed.
After changing any of the options, save them by clicking the Save and quit button. The preferences are written to /root/.oprofile/daemonrc, and the application exits.

Clicking the Save and quit button

Exiting the application does not stop OProfile from sampling.
On the Setup tab, to set events for the processor counters as discussed in Section 23.2.2, "Setting Events to Monitor", select the counter from the pulldown menu and select the event from the list. A brief description of the event appears in the text box below the list. Only events available for the specific counter and the specific architecture are displayed. The interface also displays whether the profiler is running and some brief statistics about it.
OProfile Setup
oprof_start interface

Figure 23.1. OProfile Setup


On the right side of the tab, select the Profile kernel option to count events in kernel mode for the currently selected event, as discussed in Section 23.2.3, "Separating Kernel and User-space Profiles". If this option is unselected, no samples are collected for the kernel.
Select the Profile user binaries option to count events in user mode for the currently selected event, as discussed in Section 23.2.3, "Separating Kernel and User-space Profiles". If this option is unselected, no samples are collected for user applications.
Use the Count text field to set the sampling rate for the currently selected event as discussed in Section 23.2.2.1, "Sampling Rate".
If any unit masks are available for the currently selected event, as discussed in Section 23.2.2.2, "Unit Masks", they are displayed in the Unit Masks area on the right side of the Setup tab. Select the checkbox beside the unit mask to enable it for the event.
On the Configuration tab, to profile the kernel, enter the name and location of the vmlinux file for the kernel to monitor in the Kernel image file text field. To configure OProfile not to monitor the kernel, select No kernel image.
OProfile Configuration
OProfile Configuration

Figure 23.2. OProfile Configuration


If the Verbose option is selected, the oprofiled daemon log includes more information.
If Per-application profiles is selected, OProfile generates per-application profiles for libraries. This is equivalent to the opcontrol --separate=library command. If Per-application profiles, including kernel is selected, OProfile generates per-application profiles for the kernel and kernel modules as discussed in Section 23.2.3, "Separating Kernel and User-space Profiles". This is equivalent to the opcontrol --separate=kernel command.
To force data to be written to samples files as discussed in Section 23.5, "Analyzing the Data", click the Flush button. This is equivalent to the opcontrol --dump command.
To start OProfile from the graphical interface, click Start. To stop the profiler, click Stop. Exiting the application does not stop OProfile from sampling.

23.10. OProfile and SystemTap

SystemTap is a tracing and probing tool that allows users to study and monitor the activities of the operating system in fine detail. It provides information similar to the output of tools like netstat, ps, top, and iostat; however, SystemTap is designed to provide more filtering and analysis options for collected information.
While using OProfile is suggested in cases of collecting data on where and why the processor spends time in a particular area of code, it is less usable when finding out why the processor stays idle.
You might want to use SystemTap when instrumenting specific places in code. Because SystemTap allows you to run the code instrumentation without having to stop and restart the instrumentation, it is particularly useful for instrumenting the kernel and daemons.
For more information on SystemTap, refer to Section 23.11.2, "Useful Websites" for the relevant SystemTap documentation.

23.11. Additional Resources

This chapter only highlights OProfile and how to configure and use it. To learn more, refer to the following resources.

23.11.1. Installed Docs

  • /usr/share/doc/oprofile-version/oprofile.html - OProfile Manual
  • oprofile man page - Discusses opcontrol, opreport, opannotate, and ophelp

23.11.2. Useful Websites

(Sebelumnya) 13 : Chapter 22. Automatic Bug ...13 : Part VII. Kernel, Module ... (Berikutnya)