Both methods of profiling (operf and opcontrol)
allow you to give one or more event specifications to provide details of how each
hardware performance counter should be setup. With operf, you
can provide a comma-separated list of event specfications using the --events
option. With opcontrol, you use the --event option
for each desired event specification.
The event specification is a colon-separated string of the form
name:count:unitmask:kernel:user
as described in the table below.
If no event specs are passed to operf or opcontrol,
the default event will be used for profiling. With opcontrol, if you have
previously specified some non-default event but want to revert to the default event, use
--event=default. Use of this option overrides all previous event selections
that have been cached.
name
|
The symbolic event name, e.g. CPU_CLK_UNHALTED |
count
|
The counter reset value, e.g. 100000 |
unitmask
|
The unit mask, as given in the events list: e.g. 0x0f; or a symbolic name as given by the first word of the description (only valid for unit masks having an "extra:" parameter) |
kernel
|
Whether to profile kernel code |
user
|
Whether to profile userspace code |
The last three values are optional, if you omit them (e.g. --event=DATA_MEM_REFS:30000),
they will be set to the default values (the default unit mask value for the given event, and profiling both kernel and userspace code). Note that some events require a unit mask.
When specifying a unit mask value, it may be either a hexadecimal value (which must begin with "0x") or a string (i.e, symbolic name) which matches the first word in the unit mask description. Specifying a symbolic name for the unit mask is valid only for unit masks having "extra:" parameters, as shown by the output of ophelp. Unit masks with "extra:" parameters must be specified using the symbolic name.
When using legacy mode opcontrol on PowerPC platforms, all events specified must be in the same group;
i.e., the group number appended to the event name (e.g. <some-event-name>_GRP9
) must be the same.
If OProfile is using timer-interrupt mode, there is no event configuration possible.
The table below lists the default event for various processor types:
| Processor | cpu_type | Default event |
| Alpha EV4 | alpha/ev4 | CYCLES:100000:0:1:1 |
| Alpha EV5 | alpha/ev5 | CYCLES:100000:0:1:1 |
| Alpha PCA56 | alpha/pca56 | CYCLES:100000:0:1:1 |
| Alpha EV6 | alpha/ev6 | CYCLES:100000:0:1:1 |
| Alpha EV67 | alpha/ev67 | CYCLES:100000:0:1:1 |
| ARM/XScale PMU1 | arm/xscale1 | CPU_CYCLES:100000:0:1:1 |
| ARM/XScale PMU2 | arm/xscale2 | CPU_CYCLES:100000:0:1:1 |
| ARM/MPCore | arm/mpcore | CPU_CYCLES:100000:0:1:1 |
| AVR32 | avr32 | CPU_CYCLES:100000:0:1:1 |
| Athlon | i386/athlon | CPU_CLK_UNHALTED:100000:0:1:1 |
| Pentium Pro | i386/ppro | CPU_CLK_UNHALTED:100000:0:1:1 |
| Pentium II | i386/pii | CPU_CLK_UNHALTED:100000:0:1:1 |
| Pentium III | i386/piii | CPU_CLK_UNHALTED:100000:0:1:1 |
| Pentium M (P6 core) | i386/p6_mobile | CPU_CLK_UNHALTED:100000:0:1:1 |
| Pentium 4 (non-HT) | i386/p4 | GLOBAL_POWER_EVENTS:100000:1:1:1 |
| Pentium 4 (HT) | i386/p4-ht | GLOBAL_POWER_EVENTS:100000:1:1:1 |
| Hammer | x86-64/hammer | CPU_CLK_UNHALTED:100000:0:1:1 |
| Family10h | x86-64/family10 | CPU_CLK_UNHALTED:100000:0:1:1 |
| Family11h | x86-64/family11h | CPU_CLK_UNHALTED:100000:0:1:1 |
| Itanium | ia64/itanium | CPU_CYCLES:100000:0:1:1 |
| Itanium 2 | ia64/itanium2 | CPU_CYCLES:100000:0:1:1 |
| TIMER_INT | timer | None selectable |
| IBM pseries | PowerPC 4/5/6/7/970/Cell | CYCLES:100000:0:1:1 |
| IBM s390 | timer | None selectable |
| IBM s390x | timer | None selectable |