The translation is temporarily closed for contributions due to maintenance, please come back later.
English Spanish
To run [command]#operf# [option]`--system-wide`, you need `root` authority. When finished profiling, you can stop [command]#operf# with `Ctrl+C`.
If you run [command]#operf# [option]`--system-wide` as a background process (with `&`), stop it in a controlled manner in order to process the collected profile data. For this purpose, use:
[command]#kill -SIGINT operf-PID#
When running [command]#operf# [option]`--system-wide`, it is recommended that your current working directory is `/root` or a subdirectory of `/root` so that sample data files are not stored in locations accessible by regular users.
Specifying the Kernel
To monitor the kernel, execute the following command:
operf --vmlinux=pass:quotes[_vmlinux_path_]
With this option, you can specify a path to a vmlinux file that matches the running kernel. Kernel samples will be attributed to this binary, allowing post-processing tools to attribute samples to the appropriate kernel symbols. If this option is not specified, all kernel samples will be attributed to a pseudo binary named "no-vmlinux".
Setting Events to Monitor
Most processors contain counters, which are used by OProfile to monitor specific events. As shown in xref:OProfile.adoc#tb-oprofile-processors[OProfile Processors and Counters], the number of counters available depends on the processor.
The events for each counter can be configured via the command line or with a graphical interface. For more information on the graphical interface, see xref:OProfile.adoc#s1-oprofile-gui[Graphical Interface]. If the counter cannot be set to a specific event, an error message is displayed.
Older Processors and operf
Some older processor models are not supported by the underlying Linux Performance Events Subsystem kernel and therefore are not supported by [command]#operf#. If you receive this message:
Your kernel's Performance Events Subsystem does not support your processor type
when attempting to use [command]#operf#, try profiling with [command]#opcontrol# to see if your processor type may be supported by OProfile's legacy mode.
Using operf on Virtual Systems
Since hardware performance counters are not available on guest virtual machines, you have to enable *timer* mode to use [application]*operf* on virtual systems. To do so, type as `root`:
[command]#opcontrol# [option]`--deinit`
[command]#modprobe# [command]#oprofile# [option]`timer=1`
To set the event for each configurable counter via the command line, use: