PERF-CONFIG(1)

๐Ÿ’– perf-config(1) ๐Ÿ’– โ€” straight from the perf Manual, bestie edition

โœจ NAME โœจ

perf-config โ€” get and set variables in a configuration file. That's the whole main character job. ๐Ÿ’…

๐ŸŒธ SYNOPSIS ๐ŸŒธ

perf config [<file-option>] [section.name[=value] ...]
or
perf config [<file-option>] -l | --list

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Okay so this command is literally your little remote control for variables in a configuration file. You can manage variables in a configuration file with it. Periodt. ๐ŸŽ€

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -l, --list โ€” show current config variables, name and value, for all sections. It's giving full inventory, no cap. โœจ
  • --user โ€” for writing and reading options: write to the user $HOME/.perfconfig file or read it.
  • --system โ€” for writing and reading options: write to the system-wide $(sysconfdir)/perfconfig or read it.

๐ŸŽ€ CONFIGURATION FILE ๐ŸŽ€

The perf configuration file contains many variables to change various aspects of each of its tools, including output, disk usage, etc. The $HOME/.perfconfig file is used to store a per-user configuration. The file $(sysconfdir)/perfconfig can be used to store a system-wide default configuration.

One can disable reading config files by setting the PERF_CONFIG environment variable to /dev/null, or provide an alternate config file by setting that variable. No cap, that's the escape hatch.

When reading or writing, the values are read from the system and user configuration files by default, and options --system and --user can be used to tell the command to read from or write to only that location. So you can be like "just user" or "just system", periodt.

โœจ Syntax โœจ

The file consist of sections. A section starts with its name surrounded by square brackets and continues till the next section begins. Each variable must be in a section, and have the form name = value, for example:

[section]
        name1 = value1
        name2 = value2

Section names are case sensitive and can contain any characters except newline (double quote " and backslash have to be escaped as \" and \\, respectively). Section headers canโ€™t span multiple lines. Case sensitivity is not playing around, bestie. ๐Ÿ’›

๐ŸŒธ Example ๐ŸŒธ

Given a $HOME/.perfconfig like this:

# # This is the config file, and # a # and ; character indicates a
# comment #

[colors]
        # Color variables
        top = red, default
        medium = green, default
        normal = lightgray, default
        selected = white, lightgray
        jump_arrows = blue, default
        addr = magenta, default
        root = white, blue

[tui]
        # Defaults if linked with libslang
        report = on
        annotate = on
        top = on

[buildid]
        # Default, disable using /dev/null
        dir = ~/.debug

[annotate]
        # Defaults
        hide_src_code = false
        use_offset = true
        jump_arrows = true
        show_nr_jumps = false

[help]
        # Format can be man, info, web or html
        format = man
        autocorrect = 0

[ui]
        show-headers = true

[call-graph]
        # fp (framepointer), dwarf
        record-mode = fp
        print-type = graph
        order = caller
        sort-key = function

[report]
        # Defaults
        sort_order = comm,dso,symbol
        percent-limit = 0
        queue-size = 0
        children = true
        group = true
        skip-empty = true

You can hide source code of annotate feature setting the config to false with

% perf config annotate.hide_src_code=true

If you want to add or modify several config items, you can do like

% perf config ui.show-headers=false kmem.default=slab

To modify the sort order of report functionality in user config file (i.e. ~/.perfconfig), do

% perf config --user report.sort-order=srcline

To change colors of selected line to other foreground and background colors in system config file (i.e. $(sysconf)/perfconfig), do

% perf config --system colors.selected=yellow,green

To query the record mode of call graph, do

% perf config call-graph.record-mode

If you want to know multiple config key/value pairs, you can do like

% perf config report.queue-size call-graph.order report.children

To query the config value of sort order of call graph in user config file (i.e. ~/.perfconfig), do

% perf config --user call-graph.sort-order

To query the config value of buildid directory in system config file (i.e. $(sysconf)/perfconfig), do

% perf config --system buildid.dir

๐Ÿฆ‹ Variables ๐Ÿฆ‹

Bestie, this is the big glossary energy. Every single variable, no skipping. โœจ

colors.*

The variables for customizing the colors used in the output for the report, top and annotate in the TUI. They should specify the foreground and background colors, separated by a comma, for example:

medium = green, lightgray

If you want to use the color configured for you terminal, just leave it as 'default', for example:

medium = default, lightgray

Available colors:

red, yellow, green, cyan, gray, black, blue,
white, default, magenta, lightgray

colors.top

top means a overhead percentage which is more than 5%. And values of this variable specify percentage colors. Basic key values are foreground-color red and background-color default.

colors.medium

medium means a overhead percentage which has more than 0.5%. Default values are green and default.

colors.normal

normal means the rest of overhead percentages except top, medium, selected. Default values are lightgray and default.

colors.selected

This selects the colors for the current entry in a list of entries from sub-commands (top, report, annotate). Default values are black and lightgray.

colors.jump_arrows

Colors for jump arrows on assembly code listings such as jns, jmp, jane, etc. Default values are blue, default.

colors.addr

This selects colors for addresses from annotate. Default values are magenta, default.

colors.root

Colors for headers in the output of a sub-commands (top, report). Default values are white, blue.

core.*, core.proc-map-timeout

Sets a timeout (in milliseconds) for parsing /proc/<pid>/maps files. Can be overridden by the --proc-map-timeout option on supported subcommands. The default timeout is 500ms.

addr2line-disable-warn

When set to true disable all warnings from addr2line output. Default setting is false to show these warnings.

addr2line-timeout

Sets a timeout (in milliseconds) for parsing addr2line output. The default timeout is 5s.

tui., gtk.

Subcommands that can be configured here are top, report and annotate. These values are booleans, for example:

[tui]
        top = true

will make the TUI be the default for the 'top' subcommand. Those will be available if the required libs were detected at tool build time.

buildid.*, buildid.dir

Each executable and shared library in modern distributions comes with a content based identifier that, if available, will be inserted in a perf.data file header to, at analysis time find what is needed to do symbol resolution, code annotation, etc.

The recording tools also stores a hard link or copy in a per-user directory, $HOME/.debug/, of binaries, shared libraries, /proc/kallsyms and /proc/kcore files to be used at analysis time.

The buildid.dir variable can be used to either change this directory cache location, or to disable it altogether. If you want to disable it, set buildid.dir to /dev/null. The default is $HOME/.debug.

buildid-cache.*

buildid-cache.debuginfod=URLs โ€” specify debuginfod URLs to be used when retrieving perf.data binaries, it follows the same syntax as the DEBUGINFOD_URLS variable, like:

buildid-cache.debuginfod=http://192.168.122.174:8002

annotate.*

These are in control of addresses, jump function, source code in lines of assembly code from a specific program.

annotate.disassemblers

Choose the disassembler to use: "objdump", "llvm", "capstone", if not specified it will first try, if available, the "llvm" one, then, if it fails, "capstone", and finally the original "objdump" based one.

Choosing a different one is useful when handling some feature that is known to be best support at some point by one of the options, to compare the output when in doubt about some bug, etc.

This can be a list, in order of preference, the first one that works finishes the process.

annotate.addr2line

addr2line binary to use for file names and line numbers.

annotate.objdump

objdump binary to use for disassembly and annotations, including in the perf test command.

annotate.disassembler_style

Use this to change the default disassembler style to some other value supported by binutils, such as "intel", see the -M option help in the objdump man page.

annotate.hide_src_code

If a program which is analyzed has source code, this option lets annotate print a list of assembly code with the source code. For example, letโ€™s see a part of a program. Thereโ€™re four lines. If this option is true, they can be printed without source code from a program as below.

โ”‚        push   %rbp
โ”‚        mov    %rsp,%rbp
โ”‚        sub    $0x10,%rsp
โ”‚        mov    (%rdi),%rdx

But if this option is 'false', source code of the part can be also printed as below. Default is 'false'.

โ”‚      struct rb_node *rb_next(const struct rb_node *node)
โ”‚      {
โ”‚        push   %rbp
โ”‚        mov    %rsp,%rbp
โ”‚        sub    $0x10,%rsp
โ”‚              struct rb_node *parent;
โ”‚
โ”‚              if (RB_EMPTY_NODE(node))
โ”‚        mov    (%rdi),%rdx
โ”‚              return n;

This option works with tui, stdio2 browsers.

annotate.use_offset

Basing on a first address of a loaded function, offset can be used. Instead of using original addresses of assembly code, addresses subtracted from a base address can be printed. Letโ€™s illustrate an example. If a base address is 0XFFFFFFFF81624d50 as below,

ffffffff81624d50 <load0>

an address on assembly code has a specific absolute address as below

ffffffff816250b8:โ”‚  mov    0x8(%r14),%rdi

but if use_offset is 'true', an address subtracted from a base address is printed. Default is true. This option is only applied to TUI.

368:โ”‚  mov    0x8(%r14),%rdi

Oh and bestie, this one works with tui, stdio2 browsers. ๐Ÿ’…


annotate.jump_arrows ๐Ÿน

Okay so assembly code can have jump instructions, and jump_arrows is a boolean that decides whether we print cute little arrows showing where the instruction jumps into. Like this:

โ”‚     โ”Œโ”€โ”€jmp    1333
โ”‚     โ”‚  xchg   %ax,%ax
โ”‚1330:โ”‚  mov    %r15,%r10
โ”‚1333:โ””โ”€โ†’cmp    %r15,%r14

If jump_arrow is 'false', the arrows aren't printed, like this. Default is 'false'.

โ”‚      โ†“ jmp    1333
โ”‚        xchg   %ax,%ax
โ”‚1330:   mov    %r15,%r10
โ”‚1333:   cmp    %r15,%r14

This option works with tui browser.

annotate.show_linenr ๐Ÿ”ข

When you're showing source code and this option is true, line numbers get printed. Like:

โ”‚1628         if (type & PERF_SAMPLE_IDENTIFIER) {
โ”‚     โ†“ jne    508
โ”‚1628                 data->id = *array;
โ”‚1629                 array++;
โ”‚1630         }

But if this option is 'false', they aren't printed, like this. Default is 'false'.

โ”‚             if (type & PERF_SAMPLE_IDENTIFIER) {
โ”‚     โ†“ jne    508
โ”‚                     data->id = *array;
โ”‚                     array++;
โ”‚             }

This option works with tui, stdio2 browsers.

annotate.show_nr_jumps ๐Ÿ”€

Let's look at a lil piece of assembly code:

โ”‚1382:   movb   $0x1,-0x270(%rbp)

If you use this, the number of branches jumping to that address can be printed, like below. Default is 'false'.

โ”‚1 1382:   movb   $0x1,-0x270(%rbp)

This option works with tui, stdio2 browsers.

annotate.show_total_period โฑ๏ธ

To compare two records on an instruction base, if you provide this option, it displays the total number of samples that belong to a line in assembly code. If this option is true, total periods are printed instead of percent values, like:

302 โ”‚      mov    %eax,%eax

But if this option is 'false', percent values for overhead are printed, i.e. Default is 'false'.

99.93 โ”‚      mov    %eax,%eax

This option works with tui, stdio2, stdio browsers.

annotate.show_nr_samples ๐Ÿงฎ

By default perf annotate shows percentage of samples. This option can be used to print absolute number of samples. Ex, when set as false:

Percentโ”‚
 74.03 โ”‚      mov    %fs:0x28,%rax

When set as true:

Samplesโ”‚
     6 โ”‚      mov    %fs:0x28,%rax

This option works with tui, stdio2, stdio browsers.

annotate.offset_level ๐Ÿ“

Default is 1, meaning just jump targets will have offsets show right beside the instruction. When set to 2, call instructions will also have its offsets shown, 3 or higher will show offsets for all instructions.

This option works with tui, stdio2 browsers.

annotate.demangle โœจ

Demangle symbol names to human readable form. Default is true.

annotate.demangle_kernel ๐Ÿงš

Demangle kernel symbol names to human readable form. Default is true.

hist.*, hist.percentage ๐Ÿ“Š

This option controls the way to calculate overhead of filtered entries โ€” that means the value of this option is effective only if there's a filter (by comm, dso or symbol name). Suppose a following example:

Overhead  Symbols
........  .......
 33.33%     foo
 33.33%     bar
 33.33%     baz

This is an original overhead and we'll filter out the first 'foo' entry. The value of 'relative' would increase the overhead of 'bar' and 'baz' to 50.00% for each, while 'absolute' would show their current overhead (33.33%).

ui.*, ui.show-headers ๐Ÿ—‚๏ธ

This option controls display of column headers (like Overhead and Symbol) in report and top. If this option is false, they are hidden. This option is only applied to TUI.

call-graph.* ๐Ÿ“ž

The following controls the handling of call-graphs (obtained via the -g/--call-graph options).

call-graph.record-mode ๐ŸŽฅ

The mode for user space can be fp (frame pointer), dwarf and lbr. The value dwarf is effective only if libunwind (or a recent version of libdw) is present on the system; the value lbr only works for certain cpus. The method for kernel space is controlled not by this option but by the kernel config (CONFIG_UNWINDER_*).

The 'defer' mode can be used with 'fp' mode to enable deferred user callchains (like 'fp,defer').

call-graph.dump-size ๐Ÿ—ƒ๏ธ

The size of stack to dump in order to do post-unwinding. Default is 8192 (byte). When using dwarf into record-mode, the default size will be used if omitted.

call-graph.print-type ๐Ÿ–จ๏ธ

The print-types can be graph (graph absolute), fractal (graph relative), flat and folded. This option controls a way to show overhead for each callchain entry. Suppose a following example.

Overhead  Symbols
........  .......
  40.00%  foo
          |
          ---foo
             |
             |--50.00%--bar
             |          main
             |
              --50.00%--baz
                        main

This output is a 'fractal' format. The 'foo' came from 'bar' and 'baz' exactly half and half so 'fractal' shows 50.00% for each (meaning that it assumes 100% total overhead of 'foo').

The 'graph' uses absolute overhead value of 'foo' as total so each of 'bar' and 'baz' callchain will have 20.00% of overhead. If 'flat' is used, single column and linear exposure of call chains. 'folded' mean call chains are displayed in a line, separated by semicolons.

call-graph.order ๐Ÿ”„

This option controls print order of callchains. The default is callee which means callee is printed at top and then followed by its caller and so on. The caller prints it in reverse order.

If this option is not set and report.children or top.children is set to true (or the equivalent command line option is given), the default value of this option is changed to 'caller' for the execution of 'perf report' or 'perf top'. Other commands will still default to 'callee'.

call-graph.sort-key ๐Ÿ—๏ธ

The callchains are merged if they contain same information. The sort-key option determines a way to compare the callchains. A value of sort-key can be function or address. The default is function.

call-graph.threshold ๐Ÿšฆ

When there're many callchains it'd print tons of lines. So perf omits small callchains under a certain overhead (threshold) and this option control the threshold. Default is 0.5 (%). The overhead is calculated by value depends on call-graph.print-type.

call-graph.print-limit ๐Ÿ–จ๏ธ

This is a maximum number of lines of callchain printed for a single histogram entry. Default is 0 which means no limitation.

report.*, report.sort_order ๐Ÿ“ˆ

Allows changing the default sort order from "comm,dso,symbol" to some other default, for instance "sym,dso" may be more fitting for kernel developers.

report.percent-limit ๐Ÿ“‰

This one is mostly the same as call-graph.threshold but works for histogram entries. Entries having an overhead lower than this percentage will not be printed. Default is 0. If percent-limit is 10, only entries which have more than 10% of overhead will be printed.

report.queue-size ๐Ÿ“ฆ

This option sets up the maximum allocation size of the internal event queue for ordering events. Default is 0, meaning no limit.

report.children ๐Ÿ‘ถ

Children means functions called from another function. If this option is true, perf report cumulates callchains of children and show (accumulated) total overhead as well as Self overhead. Please refer to the perf report manual. The default is true.

report.group ๐Ÿ‘ฏ

This option is to show event group information together. Example output with this turned on, notice that there is one column per event in the group, ref-cycles and cycles:

# group: {ref-cycles,cycles}
# ========
#
# Samples: 7K of event 'anon group { ref-cycles, cycles }'
# Event count (approx.): 6876107743
#
#         Overhead  Command      Shared Object               Symbol
# ................  .......  .................  ...................
#
    99.84%  99.76%  noploop  noploop            [.] main
     0.07%   0.00%  noploop  ld-2.15.so         [.] strcmp
     0.03%   0.00%  noploop  [kernel.kallsyms]  [k] timerqueue_del

report.skip-empty ๐Ÿšซ

This option can change default stat behavior with empty results. If it's set true, perf report --stat will not show 0 stats.

top.*, top.children ๐Ÿ”

Same as report.children. So if it is enabled, the output of top command will have Children overhead column as well as Self overhead column by default. The default is true.

top.call-graph ๐ŸŽข

This is identical to call-graph.record-mode, except it is applicable only for top subcommand. This option ONLY setup the unwind method. To enable perf top to actually use it, the command line option -g must be specified.

man.*, man.viewer ๐Ÿ“–

This option can assign a tool to view manual pages when help subcommand was invoked. Supported tools are man, woman (with emacs client) and konqueror. Default is man.

New man viewer tool can be also added using 'man.<tool>.cmd' or use different path using 'man.<tool>.path' config option.

pager.*, pager.<subcommand> ๐Ÿ“„

When the subcommand is run on stdio, determine whether it uses pager or not based on this value. Default is unspecified.

kmem.*, kmem.default ๐Ÿง 

This option decides which allocator is to be analyzed if neither --slab nor --page option is used. Default is slab.

record.*, record.build-id ๐Ÿ†”

This option can be cache, no-cache, skip or mmap. cache is to post-process data and save/update the binaries into the build-id cache (in ~/.debug). This is the default. But if this option is no-cache, it will not update the build-id cache. skip skips post-processing and does not update the cache. mmap skips post-processing and reads build-ids from MMAP events.

  • record.call-graph โ€” literally the same thing as call-graph.record-mode, except this one only works for the record subcommand. And heads up bestie: this option ONLY sets up the unwind method. For perf record to actually use it, you still gotta pass the command line option -g. It's giving "setting the vibe but not showing up" ๐Ÿ˜ญ
  • record.aio โ€” use n control blocks in async (Posix AIO) trace writing mode. Default for n is 1, max is 4.
  • record.debuginfod โ€” pick the debuginfod URL used when cacheing perf.data binaries. Same syntax as the DEBUGINFOD_URLS variable, like:
http://192.168.122.174:8002

If the URL is 'system', then the value of the DEBUGINFOD_URLS system environment variable gets used instead. โœจ

  • diff.*, diff.order โ€” sets how many columns to sort the result by. Default is 0, which means sorting by baseline. Set it to 1 and you're sorting by delta (or whichever other compute method you picked).
  • diff.compute โ€” sets the method for computing the diff result. Possible values: delta, delta-abs, ratio, wdiff. Default is delta.
  • trace.*, trace.add_events โ€” lets you add a set of events on top of the ones the user specified, or use it as the default set if none were given. The OG use case is adding augmented_raw_syscalls.o to turn on the perf trace logic that looks for syscall pointer contents after the normal tracepoint payload. ๐Ÿฆ‹
  • trace.args_alignment โ€” number of columns to align the argument list. Default is 70, use 40 for the strace default, and 0 if you want no alignment at all.
  • trace.no_inherit โ€” do not follow children threads. Bye children ๐Ÿ‘‹
  • trace.show_arg_names โ€” should syscall argument names be printed? If not, then trace.show_zeros gets set.
  • trace.show_duration โ€” show syscall duration.
  • trace.show_prefix โ€” set to yes and it shows common string prefixes in tables. Default is to remove the common prefix in things like "MAP_SHARED", showing just "SHARED".
  • trace.show_timestamp โ€” show syscall start timestamp.
  • trace.show_zeros โ€” don't suppress syscall arguments that equal zero.
  • trace.tracepoint_beautifiers โ€” use "libtraceevent" to have that library augment the tracepoint arguments, or "libbeauty" (the default) to use the same argument beautifiers as the strace-like sys_enter+sys_exit lines.
  • ftrace.*, ftrace.tracer โ€” selects the default tracer when neither -G nor -F option is specified. Possible values are function and function_graph.
  • samples.*, samples.context โ€” define how many ns worth of time to show around samples in the perf report sample context browser. โญ
  • scripts.* โ€” any option here defines a script that gets added to the scripts menu in the interactive perf browser, and its output gets displayed. The name of the option is the name, and the value is a script command line. The script gets the same options passed as a full perf script โ€” in particular -i perfdata file, --cpu, --tid.
  • convert.*, convert.queue-size โ€” limits the size of the ordered_events queue so you can control the allocation size of perf data files without proper finished round events.
  • stat.*, stat.big-num โ€” (boolean) changes the default for "--big-num". To make "--no-big-num" the default, set "stat.big-num=false".
  • intel-pt.*, intel-pt.cache-divisor, intel-pt.mispred-all โ€” if set, the Intel PT decoder will set the mispred flag on all branches.
  • intel-pt.max-loops โ€” if set and non-zero, this is the maximum number of unconditional branches decoded without consuming any trace packets. Exceed the maximum and you get a "Never-ending loop" error. Default is 100000. ๐Ÿ’€
  • intel-pt.all-switch-events โ€” if the user has permission to do so, always record all context switch events on all CPUs.
  • auxtrace.*, auxtrace.dumpdir โ€” s390 only, bestie. You can change the directory where the auxiliary trace buffer gets saved with this option. Ex, auxtrace.dumpdir=/tmp. If the directory doesn't exist or has the wrong file type, the current directory is used instead.
  • itrace.*, debug-log-buffer-size โ€” log size in bytes to output when using the option --itrace=d+e. Peep the itrace option of perf-script(1) or perf-report(1). Default is 16384.
  • daemon.*, daemon.base โ€” base path for daemon data. All sessions data are stored under this path. ๐ŸŽ€
  • session-<NAME>.*, session-<NAME>.run โ€” defines a new record session for the daemon. The value is record's command line without the record keyword.

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • perf(1) โ€” the main character herself ๐Ÿซถ

okay that's the whole page, you're officially a perf-config girlie now, no cap ๐Ÿ‘‘

this lil masterpiece is from perf and it's dated 10/31/2026 โ€” go forth and configure, bestie ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from