|
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:
|
|
|
[command]#operf# [option]`--events`pass:attributes[{blank}]=pass:attributes[{blank}]_event1_,_event2_pass:attributes[{blank}]…
|
|
|
Here, pass a comma-separated list of event specifications for profiling. Each event specification is a colon-separated list of attributes in the following form:
|
|
|
_event-name_:pass:attributes[{blank}]_sample-rate_:pass:attributes[{blank}]_unit-mask_:pass:attributes[{blank}]_kernel_:pass:attributes[{blank}]_user_
|
|
|
xref:OProfile.adoc#tab_event_specifications[Event Specifications] summarizes these options. The last three values are optional, if you omit them, they will be set to their default values. Note that certain events do require a unit mask.
|
|
|
Event Specifications
|
|
|
|Specification|Description |_event-name_|The exact symbolic event name taken from [command]#ophelp# |_sample-rate_|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 a statistically significant number of event instances. On the other hand, sampling too frequently can overload the system. By default, OProfile uses a time-based event set, which creates a sample every 100,000 clock cycles per processor. |_unit-mask_|Unit masks, which further define the event, are listed in [command]#ophelp#. You can insert either a hexadecimal value, beginning with "0x", or a string that matches the first word of the unit mask description in [command]#ophelp#. Definition by name is valid only for unit masks having "extra:" parameters, as shown by the output of [command]#ophelp#. This type of unit mask cannot be defined with a hexadecimal value. Note that on certain architectures, there can be multiple unit masks with the same hexadecimal value. In that case they have to be specified by their names only. |_kernel_|Specifies whether to profile kernel code (insert `0` or `1`(default)) |_user_|Specifies whether to profile user-space code (insert `0` or `1` (default))
|
|
|
The events available vary depending on the processor type. When no event specification is given, the default event for the running processor type will be used for profiling. See xref:OProfile.adoc#tb-oprofile-default-events[Default Events] for a list of these default events. To determine the events available for profiling, use the [command]#ophelp# command.
|
|