English Portuguese (Brazil)
indexterm:[oprof_start] Some OProfile preferences can be set with a graphical interface. Make sure you have the `oprofile-gui` package that provides the OProfile GUI installed on your system. To start the interface, execute the [command]#oprof_start# command as root at a shell prompt.
After changing any of the options, save them by clicking the btn:[Save and quit] button. The preferences are written to `/root/.oprofile/daemonrc`, and the application exits. Exiting the application does not stop OProfile from sampling.
On the `Setup` tab, to set events for the processor counters as discussed in xref:OProfile.adoc#s2-oprofile-events[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.
[[fig-oprofile-setup]] .OProfile Setup
image::oprof-start-setup.png[oprof_start interface]
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 xref:OProfile.adoc#s2-oprofile-starting-separate[Separating Kernel and User-space Profiles]. If this option is not selected, 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 xref:OProfile.adoc#s2-oprofile-starting-separate[Separating Kernel and User-space Profiles]. If this option is not selected, 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 xref:OProfile.adoc#s3-oprofile-events-sampling[Sampling Rate].
If any unit masks are available for the currently selected event, as discussed in xref:OProfile.adoc#s3-oprofile-events-unit-masks[Unit Masks], they are displayed in the `Unit Masks` area on the right side of the `Setup` tab. Select the check box 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`.
[[fig-oprofile-configuration]] .OProfile Configuration
image::oprof-start-config.png[OProfile Configuration]
If the `Verbose` option is selected, the [command]#oprofiled# daemon log includes more detailed information.
If `Per-application profiles` is selected, OProfile generates per-application profiles for libraries. This is equivalent to the [command]#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 xref:OProfile.adoc#s2-oprofile-starting-separate[Separating Kernel and User-space Profiles]. This is equivalent to the [command]#opcontrol --separate=kernel# command.
To force data to be written to samples files as discussed in xref:OProfile.adoc#s1-oprofile-analyzing-data[Analyzing the Data], click the btn:[Flush] button. This is equivalent to the [command]#opcontrol --dump# command.
To start OProfile from the graphical interface, click btn:[Start]. To stop the profiler, click btn:[Stop]. Exiting the application does not stop OProfile from sampling.
[[s1-oprofile-and-systemtap]]
OProfile and SystemTap
indexterm:[OProfile,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 [command]#netstat#, [command]#ps#, [command]#top#, and [command]#iostat#pass:attributes[{blank}]; however, SystemTap is designed to provide more filtering and analysis options for the 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.