Skip to content
Andi Kleen edited this page Apr 30, 2022 · 5 revisions

toplev tunables

toplev has some internal tunables to tune the group scheduler and some other options. These can be overridden with the (undocumented) --tune option.

Normal operation should not need to change any of this, but it can be useful to get different grouping for special purposes.

Change with --tune 'var = Value'

--tune 'any_merge = False'

Disable merging of unrelated groups. Default True. In theory it's better to have smaller groups that could run in parallel with other users to increase the time share of specific groups. However the Linux perf scheduler isn't very good at dynamically figuring out those cases, so larger groups give it less trouble.

--tune 'run_l1_parallel = True'

One Icelake+ with the fixed counter metrics avoid any conflicts between the fixed metrics group and other groups. This requires using an extra generic counter to get 'slots' in the other groups. In theory this should allow running the fixed metrics group in parallel with everything else, but right now the perf scheduler doesn't do this unfortunately.

--tune 'BOTTLENECK_LEVEL_INC'

Default 1. How many levels to extend suggestions or automatic drill down on each step.

--tune 'SIB_THRESH = 0.0x'

Default 0.05. If siblings are within this threshold they are considered ambiguous for the bottleneck detection.

--tune 'distribute_uncore = True'

Default False, True with --no-multiplex. Interleave uncore events between all groups instead of clustering them near their native position.

--tune 'metrics_one_group = False'

Default True. Force metrics events into their own group.

-- tune 'LIMIT4_MAX_EVENTS = N'

Default: 3 Maximum number of limited to counter 0-3 events per group. Normally this should be 4, but 3 is safer due to the nmi watchdog or kernel issues. 4 might reduce multiplexing.

Environment variables to override (mainly for testing):

FORCECPU=cpu

Force CPU type (e.g. skl). Also --force-cpu

FORCECOUNTERS=n

Force number of generic counters

FORCEHT=0/1

Force SMT mode

HYPERVISOR=0/1

Force hypervisor mode (also --force-hypervisor)

CPUINFO=file

Read cpu information from file instead of /proc/cpuinfo. Also --force-cpuinfo

TOPOLOGY=file

Read sysfs topology from file. Also --force-topology

PERF=exe

Force perf binary to run

FORCE_NMI_WATCHDOG=1

Force NMI watchdog mode

KERNEL_VERSION=...

Force kernel version (e.g. 5.0)

FORCEMETRICS=1

Force fixed metrics and slots

REDUCED_COUNTERS=n

Reduce generic counters by n. Used for testing the TSX reduced counters mode on SKX.