2015-11-22 18:11:56 +08:00
|
|
|
perf-config(1)
|
|
|
|
==============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
perf-config - Get and set variables in a configuration file.
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
[verse]
|
2016-11-04 14:44:20 +08:00
|
|
|
'perf config' [<file-option>] [section.name[=value] ...]
|
2016-11-04 14:44:17 +08:00
|
|
|
or
|
2016-02-11 01:51:17 +08:00
|
|
|
'perf config' [<file-option>] -l | --list
|
2015-11-22 18:11:56 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
You can manage variables in a configuration file with this command.
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
|
|
|
|
-l::
|
|
|
|
--list::
|
|
|
|
Show current config variables, name and value, for all sections.
|
|
|
|
|
2016-02-11 01:51:17 +08:00
|
|
|
--user::
|
|
|
|
For writing and reading options: write to user
|
|
|
|
'$HOME/.perfconfig' file or read it.
|
|
|
|
|
|
|
|
--system::
|
|
|
|
For writing and reading options: write to system-wide
|
|
|
|
'$(sysconfdir)/perfconfig' or read it.
|
|
|
|
|
2015-11-22 18:11:56 +08:00
|
|
|
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.
|
|
|
|
|
2019-07-30 22:30:37 +08:00
|
|
|
One an disable reading config files by setting the PERF_CONFIG environment
|
|
|
|
variable to /dev/null, or provide an alternate config file by setting that
|
|
|
|
variable.
|
|
|
|
|
2016-02-11 01:51:17 +08:00
|
|
|
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.
|
|
|
|
|
2015-11-22 18:11:56 +08:00
|
|
|
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.
|
|
|
|
|
|
|
|
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
|
2016-01-08 16:16:11 +08:00
|
|
|
jump_arrows = blue, default
|
2015-11-22 18:11:56 +08:00
|
|
|
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
|
|
|
|
|
2016-08-30 21:41:06 +08:00
|
|
|
[report]
|
|
|
|
# Defaults
|
2019-03-16 16:05:44 +08:00
|
|
|
sort_order = comm,dso,symbol
|
2016-08-30 21:41:06 +08:00
|
|
|
percent-limit = 0
|
|
|
|
queue-size = 0
|
|
|
|
children = true
|
|
|
|
group = true
|
|
|
|
|
2019-02-01 21:46:51 +08:00
|
|
|
[llvm]
|
|
|
|
dump-obj = true
|
|
|
|
clang-opt = -g
|
|
|
|
|
2016-11-04 14:44:20 +08:00
|
|
|
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
|
|
|
|
|
2020-12-17 01:13:17 +08:00
|
|
|
% perf config --user report.sort-order=srcline
|
2016-11-04 14:44:20 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-11-04 14:44:17 +08:00
|
|
|
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
|
|
|
|
|
2016-01-08 19:39:31 +08:00
|
|
|
Variables
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
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'.
|
|
|
|
|
2018-12-05 04:34:20 +08:00
|
|
|
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.
|
|
|
|
|
2016-01-08 19:39:32 +08:00
|
|
|
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.
|
|
|
|
|
2016-01-08 19:39:33 +08:00
|
|
|
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
|
|
|
|
|
2016-01-08 19:39:34 +08:00
|
|
|
annotate.*::
|
|
|
|
These are in control of addresses, jump function, source code
|
|
|
|
in lines of assembly code from a specific program.
|
|
|
|
|
perf annotate: Allow configuring the 'disassembler_style' knob via 'perf config'
# perf annotate --stdio2 acpi_processor_ffh_cstate_enter > default
# perf config annotate.disassembler_style=intel
# perf config annotate.disassembler_style
annotate.disassembler_style=intel
# perf annotate --stdio2 acpi_processor_ffh_cstate_enter > intel
# diff -u default intel
--- default 2020-09-04 13:09:26.019205732 -0300
+++ intel 2020-09-04 13:09:52.823795081 -0300
@@ -1,42 +1,42 @@
Samples: 1K of event 'cycles', 4000 Hz, Event count (approx.): 990065316, [percent: local period]
acpi_processor_ffh_cstate_enter() /lib/modules/5.9.0-rc3/build/vmlinux
-Percent → callq __fentry__
- mov cpu_number,%edx
- mov %edx,%edx
- mov cpu_cstate_entry,%rax
- add -0x7dbe9700(,%rdx,8),%rax
- movzbl 0x9(%rdi),%edx
- mov 0x4(%rax,%rdx,8),%edi
- mov (%rax,%rdx,8),%esi
- → jmpq 137ccc6
- 2d: → jmpq 137ccd8
+Percent → call __fentry__
+ mov edx,DWORD PTR gs:[rip+0x7e541d74]
+ mov edx,edx
+ mov rax,QWORD PTR [rip+0x152b8fb]
+ add rax,QWORD PTR [rdx*8-0x7dbe9700]
+ movzx edx,BYTE PTR [rdi+0x9]
+ mov edi,DWORD PTR [rax+rdx*8+0x4]
+ mov esi,DWORD PTR [rax+rdx*8]
+ → jmp 137ccc6
+ 2d: → jmp 137ccd8
mfence
- mov %gs:0x17bc0,%rax
- clflush (%rax)
+ mov rax,QWORD PTR gs:0x17bc0
+ clflush BYTE PTR [rax]
mfence
- xor %edx,%edx
- mov %rdx,%rcx
- mov %gs:0x17bc0,%rax
- 0.00 monitor %rax,%ecx,%edx
- mov (%rax),%rax
- test $0x8,%al
+ xor edx,edx
+ mov rcx,rdx
+ mov rax,QWORD PTR gs:0x17bc0
+ 0.00 monitor
+ mov rax,QWORD PTR [rax]
+ test al,0x8
↓ jne 71
- ↓ jmpq 68
- verw 0x538b08(%rip) # ffffffff82008150 <ds.0>
- 68: mov %rsi,%rax
- mov %rdi,%rcx
-100.00 mwait %eax,%ecx
- 71: mov %gs:0x17bc0,%rax
- lock andb $0xdf,0x2(%rax)
- lock addl $0x0,-0x4(%rsp)
- mov (%rax),%rax
- test $0x8,%al
+ ↓ jmp 68
+ verw WORD PTR [rip+0x538b08] # ffffffff82008150 <ds.0>
+ 68: mov rax,rsi
+ mov rcx,rdi
+100.00 mwait
+ 71: mov rax,QWORD PTR gs:0x17bc0
+ lock and BYTE PTR [rax+0x2],0xdf
+ lock add DWORD PTR [rsp-0x4],0x0
+ mov rax,QWORD PTR [rax]
+ test al,0x8
↓ je 97
- andl $0x7fffffff,__preempt_count
- 97: ← retq
- mov %gs:0x17bc0,%rax
- lock orb $0x20,0x2(%rax)
- mov (%rax),%rax
- test $0x8,%al
+ and DWORD PTR gs:[rip+0x7e548509],0x7fffffff
+ 97: ret
+ mov rax,QWORD PTR gs:0x17bc0
+ lock or BYTE PTR [rax+0x2],0x20
+ mov rax,QWORD PTR [rax]
+ test al,0x8
↑ jne 71
- ↑ jmpq 2d
+ ↑ jmp 2d
#
Requested-by: Matt P. Dziubinski <matdzb@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-09-05 00:10:43 +08:00
|
|
|
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.
|
|
|
|
|
2016-01-08 19:39:34 +08:00
|
|
|
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;
|
|
|
|
|
2020-02-13 14:43:05 +08:00
|
|
|
This option works with tui, stdio2 browsers.
|
|
|
|
|
2016-01-08 19:39:34 +08:00
|
|
|
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
|
|
|
|
|
2020-02-13 14:43:05 +08:00
|
|
|
This option works with tui, stdio2 browsers.
|
|
|
|
|
2016-01-08 19:39:34 +08:00
|
|
|
annotate.jump_arrows::
|
|
|
|
There can be jump instruction among assembly code.
|
|
|
|
Depending on a boolean value of jump_arrows,
|
|
|
|
arrows can be printed or not which represent
|
|
|
|
where do the instruction jump into as below.
|
|
|
|
|
|
|
|
│ ┌──jmp 1333
|
|
|
|
│ │ xchg %ax,%ax
|
|
|
|
│1330:│ mov %r15,%r10
|
|
|
|
│1333:└─→cmp %r15,%r14
|
|
|
|
|
|
|
|
If jump_arrow is 'false', the arrows isn't printed as below.
|
|
|
|
Default is 'false'.
|
|
|
|
|
|
|
|
│ ↓ jmp 1333
|
|
|
|
│ xchg %ax,%ax
|
|
|
|
│1330: mov %r15,%r10
|
|
|
|
│1333: cmp %r15,%r14
|
|
|
|
|
2020-02-13 14:43:05 +08:00
|
|
|
This option works with tui browser.
|
|
|
|
|
2016-01-08 19:39:34 +08:00
|
|
|
annotate.show_linenr::
|
|
|
|
When showing source code if this option is 'true',
|
|
|
|
line numbers are printed as below.
|
|
|
|
|
|
|
|
│1628 if (type & PERF_SAMPLE_IDENTIFIER) {
|
|
|
|
│ ↓ jne 508
|
|
|
|
│1628 data->id = *array;
|
|
|
|
│1629 array++;
|
|
|
|
│1630 }
|
|
|
|
|
|
|
|
However if this option is 'false', they aren't printed as below.
|
|
|
|
Default is 'false'.
|
|
|
|
|
|
|
|
│ if (type & PERF_SAMPLE_IDENTIFIER) {
|
|
|
|
│ ↓ jne 508
|
|
|
|
│ data->id = *array;
|
|
|
|
│ array++;
|
|
|
|
│ }
|
|
|
|
|
2020-02-13 14:43:05 +08:00
|
|
|
This option works with tui, stdio2 browsers.
|
|
|
|
|
2016-01-08 19:39:34 +08:00
|
|
|
annotate.show_nr_jumps::
|
|
|
|
Let's see a part of assembly code.
|
|
|
|
|
|
|
|
│1382: movb $0x1,-0x270(%rbp)
|
|
|
|
|
|
|
|
If use this, the number of branches jumping to that address can be printed as below.
|
|
|
|
Default is 'false'.
|
|
|
|
|
|
|
|
│1 1382: movb $0x1,-0x270(%rbp)
|
|
|
|
|
2020-02-13 14:43:05 +08:00
|
|
|
This option works with tui, stdio2 browsers.
|
|
|
|
|
2016-01-08 19:39:34 +08:00
|
|
|
annotate.show_total_period::
|
|
|
|
To compare two records on an instruction base, with this option
|
|
|
|
provided, display 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 as below.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-02-13 14:43:05 +08:00
|
|
|
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.
|
|
|
|
|
perf annotate: Allow setting the offset level in .perfconfig
The default is 1 (jump_target):
# perf annotate --ignore-vmlinux --stdio2 _raw_spin_lock_irqsave
Samples: 3K of event 'cycles:ppp', 3000 Hz, Event count (approx.): 2766398574
_raw_spin_lock_irqsave() /proc/kcore
0.26 nop
4.61 push %rbx
19.33 pushfq
7.97 pop %rax
0.32 nop
0.06 mov %rax,%rbx
14.63 cli
0.06 nop
xor %eax,%eax
mov $0x1,%edx
49.94 lock cmpxchg %edx,(%rdi)
0.16 test %eax,%eax
↓ jne 2b
2.66 mov %rbx,%rax
pop %rbx
← retq
2b: mov %eax,%esi
→ callq *ffffffffb30eaed0
mov %rbx,%rax
pop %rbx
← retq
#
But one can ask for showing offsets for call instructions by setting
this:
# perf annotate --ignore-vmlinux --stdio2 _raw_spin_lock_irqsave
Samples: 3K of event 'cycles:ppp', 3000 Hz, Event count (approx.): 2766398574
_raw_spin_lock_irqsave() /proc/kcore
0.26 nop
4.61 push %rbx
19.33 pushfq
7.97 pop %rax
0.32 nop
0.06 mov %rax,%rbx
14.63 cli
0.06 nop
xor %eax,%eax
mov $0x1,%edx
49.94 lock cmpxchg %edx,(%rdi)
0.16 test %eax,%eax
↓ jne 2b
2.66 mov %rbx,%rax
pop %rbx
← retq
2b: mov %eax,%esi
2d: → callq *ffffffffb30eaed0
mov %rbx,%rax
pop %rbx
← retq
#
Or using a big value to ask for all offsets to be shown:
# cat ~/.perfconfig
[annotate]
offset_level = 100
hide_src_code = true
# perf annotate --ignore-vmlinux --stdio2 _raw_spin_lock_irqsave
Samples: 3K of event 'cycles:ppp', 3000 Hz, Event count (approx.): 2766398574
_raw_spin_lock_irqsave() /proc/kcore
0.26 0: nop
4.61 5: push %rbx
19.33 6: pushfq
7.97 7: pop %rax
0.32 8: nop
0.06 d: mov %rax,%rbx
14.63 10: cli
0.06 11: nop
17: xor %eax,%eax
19: mov $0x1,%edx
49.94 1e: lock cmpxchg %edx,(%rdi)
0.16 22: test %eax,%eax
24: ↓ jne 2b
2.66 26: mov %rbx,%rax
29: pop %rbx
2a: ← retq
2b: mov %eax,%esi
2d: → callq *ffffffffb30eaed0
32: mov %rbx,%rax
35: pop %rbx
36: ← retq
#
This also affects the TUI, i.e. the default 'perf annotate' and 'perf
top/report' -> A hotkey -> annotate interfaces, when slang-devel is present
in the build, i.e.:
# perf version --build-options | grep slang
libslang: [ on ] # HAVE_SLANG_SUPPORT
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Martin Liška <mliska@suse.cz>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-venm6x5zrt40eu8hxdsmqxz6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-04-13 02:23:02 +08:00
|
|
|
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.
|
|
|
|
|
2020-02-13 14:43:05 +08:00
|
|
|
This option works with tui, stdio2 browsers.
|
|
|
|
|
2016-01-08 19:39:36 +08:00
|
|
|
hist.*::
|
|
|
|
hist.percentage::
|
|
|
|
This option control 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%).
|
|
|
|
|
2016-02-04 17:25:06 +08:00
|
|
|
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.
|
|
|
|
|
2016-02-04 17:25:07 +08:00
|
|
|
call-graph.*::
|
2020-03-26 00:40:53 +08:00
|
|
|
The following controls the handling of call-graphs (obtained via the
|
|
|
|
-g/--call-graph options).
|
2016-02-04 17:25:07 +08:00
|
|
|
|
|
|
|
call-graph.record-mode::
|
2020-03-26 00:40:53 +08:00
|
|
|
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_*).
|
2016-02-04 17:25:07 +08:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2016-02-04 17:25:08 +08:00
|
|
|
report.*::
|
2016-08-13 07:41:01 +08:00
|
|
|
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.
|
2016-02-04 17:25:08 +08:00
|
|
|
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
|
|
|
|
|
2016-02-04 17:25:09 +08:00
|
|
|
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'.
|
|
|
|
|
2020-02-13 14:43:06 +08:00
|
|
|
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.
|
|
|
|
|
2016-02-04 17:25:10 +08:00
|
|
|
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.
|
|
|
|
|
2016-02-04 17:25:11 +08:00
|
|
|
pager.*::
|
|
|
|
pager.<subcommand>::
|
|
|
|
When the subcommand is run on stdio, determine whether it uses
|
|
|
|
pager or not based on this value. Default is 'unspecified'.
|
|
|
|
|
2016-02-04 17:25:12 +08:00
|
|
|
kmem.*::
|
|
|
|
kmem.default::
|
|
|
|
This option decides which allocator is to be analyzed if neither
|
|
|
|
'--slab' nor '--page' option is used. Default is 'slab'.
|
|
|
|
|
2016-02-04 17:25:13 +08:00
|
|
|
record.*::
|
|
|
|
record.build-id::
|
|
|
|
This option can be 'cache', 'no-cache' or 'skip'.
|
|
|
|
'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.
|
|
|
|
|
2020-02-13 14:43:06 +08:00
|
|
|
record.call-graph::
|
|
|
|
This is identical to 'call-graph.record-mode', except it is
|
|
|
|
applicable only for 'record' subcommand. This option ONLY setup
|
|
|
|
the unwind method. To enable 'perf record' to actually use it,
|
|
|
|
the command line option -g must be specified.
|
|
|
|
|
|
|
|
record.aio::
|
|
|
|
Use 'n' control blocks in asynchronous (Posix AIO) trace writing
|
|
|
|
mode ('n' default: 1, max: 4).
|
|
|
|
|
2017-02-10 15:36:12 +08:00
|
|
|
diff.*::
|
|
|
|
diff.order::
|
|
|
|
This option sets the number of columns to sort the result.
|
|
|
|
The default is 0, which means sorting by baseline.
|
|
|
|
Setting it to 1 will sort the result by delta (or other
|
|
|
|
compute method selected).
|
|
|
|
|
2017-02-10 15:36:13 +08:00
|
|
|
diff.compute::
|
|
|
|
This options sets the method for computing the diff result.
|
|
|
|
Possible values are 'delta', 'delta-abs', 'ratio' and
|
|
|
|
'wdiff'. Default is 'delta'.
|
|
|
|
|
perf trace: Allow specifying a set of events to add in perfconfig
To add augmented_raw_syscalls to the events speficied by the user, or be
the only one if no events were specified by the user, one can add this
to perfconfig:
# cat ~/.perfconfig
[trace]
add_events = /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
#
I.e. pre-compile the augmented_raw_syscalls.c BPF program and make it
always load, this way:
# perf trace -e open* cat /etc/passwd > /dev/null
0.000 ( 0.013 ms): cat/31557 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC) = 3
0.035 ( 0.007 ms): cat/31557 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC) = 3
0.353 ( 0.009 ms): cat/31557 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: CLOEXEC) = 3
0.424 ( 0.006 ms): cat/31557 openat(dfd: CWD, filename: /etc/passwd) = 3
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-0lgj7vh64hg3ce44gsmvj7ud@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-12-14 04:30:20 +08:00
|
|
|
trace.*::
|
|
|
|
trace.add_events::
|
|
|
|
Allows adding a set of events to add to the ones specified
|
|
|
|
by the user, or use as a default one if none was specified.
|
|
|
|
The initial use case is to add augmented_raw_syscalls.o to
|
|
|
|
activate the 'perf trace' logic that looks for syscall
|
|
|
|
pointer contents after the normal tracepoint payload.
|
2018-12-14 21:22:18 +08:00
|
|
|
|
perf trace: Make the alignment of the syscall args be configurable
Since the start 'perf trace' aligns the parens enclosing the list of
syscall args to align the syscall results, allow this to be
configurable, keeping the default of 70. Using:
# perf config
llvm.dump-obj=true
trace.add_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
trace.show_zeros=yes
trace.show_duration=no
trace.no_inherit=yes
trace.show_timestamp=no
trace.show_arg_names=no
trace.args_alignment=0
# trace -e open*,close,*sleep sleep 1
openat(CWD, /etc/ld.so.cache, CLOEXEC) = 3
close(3) = 0
openat(CWD, /lib64/libc.so.6, CLOEXEC) = 3
close(3) = 0
openat(CWD, /usr/lib/locale/locale-archive, CLOEXEC) = 3
close(3) = 0
nanosleep(0x7ffc00de66f0, 0) = 0
close(1) = 0
close(2) = 0
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-r8cbhoz1lr5npq9tutpvoigr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-12-15 00:40:49 +08:00
|
|
|
trace.args_alignment::
|
|
|
|
Number of columns to align the argument list, default is 70,
|
|
|
|
use 40 for the strace default, zero to no alignment.
|
|
|
|
|
perf trace: Allow configuring default for perf_event_attr.inherit
I.f. if children should inherit the parent perf_event configuration,
i.e. if we should trace children as well or just the parent.
The default is to follow children, to disable this and have a behaviour
similar to strace, set this config option or use the --no_inherit 'perf
trace' option.
E.g.:
Default:
# perf config trace.no_inherit
# trace -e clone,*sleep time sleep 1
0.000 time/21107 clone(clone_flags: CHILD_CLEARTID|CHILD_SETTID|0x11, newsp: 0, child_tidptr: 0x7f7b8f9ae810) = 21108 (time)
? time/21108 ... [continued]: clone()
0.691 sleep/21108 nanosleep(rqtp: 0x7ffed01d0540, rmtp: 0 ) = 0
0.00user 0.00system 0:01.00elapsed 0%CPU (0avgtext+0avgdata 1988maxresident)k
0inputs+0outputs (0major+76minor)pagefaults 0swaps
#
Disable it:
# trace -e clone,*sleep time sleep 1
0.000 clone(clone_flags: CHILD_CLEARTID|CHILD_SETTID|0x11, newsp: 0, child_tidptr: 0x7ff41e100810) = 21414 (time)
0.00user 0.00system 0:01.00elapsed 0%CPU (0avgtext+0avgdata 1964maxresident)k
0inputs+0outputs (0major+76minor)pagefaults 0swaps
#
Notice that since there is just one thread, the "comm/TID" column is
suppressed.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-thd8s16pagyza71ufi5vjlan@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-12-14 22:06:16 +08:00
|
|
|
trace.no_inherit::
|
|
|
|
Do not follow children threads.
|
|
|
|
|
perf trace: Allow suppressing the syscall argument names
To show just the values:
Default:
# trace -e open*,close,*sleep sleep 1
openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3
close(fd: 3 ) = 0
openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC ) = 3
close(fd: 3 ) = 0
openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: CLOEXEC) = 3
close(fd: 3 ) = 0
nanosleep(rqtp: 0x7ffc0c4ea0d0, rmtp: 0 ) = 0
close(fd: 1 ) = 0
close(fd: 2 ) = 0
#
Remove it:
# perf config trace.show_arg_names=no
# trace -e open*,close,*sleep sleep 1
openat(CWD, /etc/ld.so.cache, CLOEXEC ) = 3
close(3 ) = 0
openat(CWD, /lib64/libc.so.6, CLOEXEC ) = 3
close(3 ) = 0
openat(CWD, /usr/lib/locale/locale-archive, CLOEXEC ) = 3
close(3 ) = 0
nanosleep(0x7ffced3a8c40, 0 ) = 0
close(1 ) = 0
close(2 ) = 0
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-ta9tbdwgodpw719sr2bjm8eb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-12-14 22:32:02 +08:00
|
|
|
trace.show_arg_names::
|
|
|
|
Should syscall argument names be printed? If not then trace.show_zeros
|
|
|
|
will be set.
|
|
|
|
|
2018-12-14 21:22:18 +08:00
|
|
|
trace.show_duration::
|
|
|
|
Show syscall duration.
|
|
|
|
|
perf trace: Allow asking for not suppressing common string prefixes
So far we've been suppressing common stuff such as "MAP_" in the mmap
flags, showing "SHARED" instead of "MAP_SHARED", allow for those
prefixes (and a few suffixes) to be shown:
# trace -e *map,open*,*seek sleep 1
openat("/etc/ld.so.cache", CLOEXEC) = 3
mmap(0, 109093, READ, PRIVATE, 3, 0) = 0x7ff61c695000
openat("/lib64/libc.so.6", CLOEXEC) = 3
lseek(3, 792, SET) = 792
mmap(0, 8192, READ|WRITE, PRIVATE|ANONYMOUS) = 0x7ff61c693000
lseek(3, 792, SET) = 792
lseek(3, 864, SET) = 864
mmap(0, 1857568, READ, PRIVATE|DENYWRITE, 3, 0) = 0x7ff61c4cd000
mmap(0x7ff61c4ef000, 1363968, EXEC|READ, PRIVATE|FIXED|DENYWRITE, 3, 139264) = 0x7ff61c4ef000
mmap(0x7ff61c63c000, 311296, READ, PRIVATE|FIXED|DENYWRITE, 3, 1503232) = 0x7ff61c63c000
mmap(0x7ff61c689000, 24576, READ|WRITE, PRIVATE|FIXED|DENYWRITE, 3, 1814528) = 0x7ff61c689000
mmap(0x7ff61c68f000, 14368, READ|WRITE, PRIVATE|FIXED|ANONYMOUS) = 0x7ff61c68f000
munmap(0x7ff61c695000, 109093) = 0
openat("/usr/lib/locale/locale-archive", CLOEXEC) = 3
mmap(0, 217749968, READ, PRIVATE, 3, 0) = 0x7ff60f523000
#
# vim ~/.perfconfig
#
# perf config
llvm.dump-obj=true
trace.add_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
trace.show_zeros=yes
trace.show_duration=no
trace.no_inherit=yes
trace.show_timestamp=no
trace.show_arg_names=no
trace.args_alignment=0
trace.string_quote="
trace.show_prefix=yes
#
#
# trace -e *map,open*,*seek sleep 1
openat(AT_FDCWD, "/etc/ld.so.cache", O_CLOEXEC) = 3
mmap(0, 109093, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7ebbe59000
openat(AT_FDCWD, "/lib64/libc.so.6", O_CLOEXEC) = 3
lseek(3, 792, SEEK_SET) = 792
mmap(0, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS) = 0x7f7ebbe57000
lseek(3, 792, SEEK_SET) = 792
lseek(3, 864, SEEK_SET) = 864
mmap(0, 1857568, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7ebbc91000
mmap(0x7f7ebbcb3000, 1363968, PROT_EXEC|PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 139264) = 0x7f7ebbcb3000
mmap(0x7f7ebbe00000, 311296, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 1503232) = 0x7f7ebbe00000
mmap(0x7f7ebbe4d000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 1814528) = 0x7f7ebbe4d000
mmap(0x7f7ebbe53000, 14368, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS) = 0x7f7ebbe53000
munmap(0x7f7ebbe59000, 109093) = 0
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_CLOEXEC) = 3
mmap(0, 217749968, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7eaece7000
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-mtn1i4rjowjl72trtnbmvjd4@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-12-15 04:06:47 +08:00
|
|
|
trace.show_prefix::
|
|
|
|
If set to 'yes' will show common string prefixes in tables. The default
|
|
|
|
is to remove the common prefix in things like "MAP_SHARED", showing just "SHARED".
|
|
|
|
|
perf trace: Allow configuring if the syscall start timestamp should be printed
# trace -e open*,close,*sleep sleep 1
0.000 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3
0.016 close(fd: 3 ) = 0
0.024 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC ) = 3
0.074 close(fd: 3 ) = 0
0.235 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: CLOEXEC) = 3
0.251 close(fd: 3 ) = 0
0.285 nanosleep(rqtp: 0x7ffd68e6d620, rmtp: 0 ) = 0
1000.386 close(fd: 1 ) = 0
1000.395 close(fd: 2 ) = 0
#
# perf config trace.show_timestamp=no
# trace -e open*,close,*sleep sleep 1
openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3
close(fd: 3 ) = 0
openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC ) = 3
close(fd: 3 ) = 0
openat(dfd: CWD, filename: , flags: CLOEXEC ) = 3
close(fd: 3 ) = 0
nanosleep(rqtp: 0x7fffa79c38e0, rmtp: 0 ) = 0
close(fd: 1 ) = 0
close(fd: 2 ) = 0
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-mjjnicy48367jah6ls4k0nk8@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-12-14 22:17:19 +08:00
|
|
|
trace.show_timestamp::
|
|
|
|
Show syscall start timestamp.
|
|
|
|
|
2018-12-14 21:12:09 +08:00
|
|
|
trace.show_zeros::
|
|
|
|
Do not suppress syscall arguments that are equal to zero.
|
perf trace: Allow specifying a set of events to add in perfconfig
To add augmented_raw_syscalls to the events speficied by the user, or be
the only one if no events were specified by the user, one can add this
to perfconfig:
# cat ~/.perfconfig
[trace]
add_events = /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
#
I.e. pre-compile the augmented_raw_syscalls.c BPF program and make it
always load, this way:
# perf trace -e open* cat /etc/passwd > /dev/null
0.000 ( 0.013 ms): cat/31557 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC) = 3
0.035 ( 0.007 ms): cat/31557 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC) = 3
0.353 ( 0.009 ms): cat/31557 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: CLOEXEC) = 3
0.424 ( 0.006 ms): cat/31557 openat(dfd: CWD, filename: /etc/passwd) = 3
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-0lgj7vh64hg3ce44gsmvj7ud@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-12-14 04:30:20 +08:00
|
|
|
|
perf trace: Allow choosing how to augment the tracepoint arguments
So far we used the libtraceevent printing routines when showing
tracepoint arguments, but since 'perf trace' has a lot of beautifiers
for syscall arguments, and since some of those can be used to augment
tracepoint arguments, add a routine to make use of those beautifiers
and allow the user to choose which one to use.
The default now is to use the same beautifiers used for the strace-like
sys_enter+sys_exit lines, but the user can choose the libtraceevent ones
by either using the:
perf trace --libtraceevent_print
command line option, or by setting:
# cat ~/.perfconfig
[trace]
tracepoint_beautifiers = libtraceevent
For instance, here are some examples:
# perf trace -e sched:*switch,*sleep,sched:*wakeup,exit*,sched:*exit sleep 1
0.000 sched:sched_wakeup(comm: "perf", pid: 5273 (perf), prio: 120, success: 1, target_cpu: 6)
0.621 nanosleep(rqtp: 0x7ffdd06d1140, rmtp: NULL) ...
0.628 sched:sched_switch(prev_comm: "sleep", prev_pid: 5273 (sleep), prev_prio: 120, prev_state: 1, next_comm: "swapper/6", next_pid: 0, next_prio: 120)
1000.879 sched:sched_wakeup(comm: "sleep", pid: 5273 (sleep), prio: 120, success: 1, target_cpu: 6)
0.621 ... [continued]: nanosleep()) = 0
1001.026 exit_group(error_code: 0) = ?
1001.216 sched:sched_process_exit(comm: "sleep", pid: 5273 (sleep), prio: 120)
#
And then using libtraceevent, as before:
# perf trace --libtraceevent_print -e sched:*switch,*sleep,sched:*wakeup,exit*,sched:*exit sleep 1
0.000 sched:sched_wakeup(comm=perf pid=5288 prio=120 target_cpu=001)
0.739 nanosleep(rqtp: 0x7ffeba6c2f40, rmtp: NULL) ...
0.747 sched:sched_switch(prev_comm=sleep prev_pid=5288 prev_prio=120 prev_state=S ==> next_comm=swapper/1 next_pid=0 next_prio=120)
1000.902 sched:sched_wakeup(comm=sleep pid=5288 prio=120 target_cpu=001)
0.739 ... [continued]: nanosleep()) = 0
1001.012 exit_group(error_code: 0) = ?
#
The new default allocates an array of 'struct syscall_arg_fmt' for the
tracepoint arguments and, just like with syscall arguments, tries to
find suitable syscall_arg__scnprintf_NAME() routines to augment those
tracepoint arguments based on their type (as in the tracefs "format"
file), or even in their name + type, for instance arguntents with names
ending in "fd" with type "int" get the fd scnprintf beautifier attached,
etc.
Soon this will take advantage of the kernel BTF information to augment
enumerations based on the tracefs "format" type info.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-o8qdluotkcb3b1x2gjqrejcl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-10-05 02:28:13 +08:00
|
|
|
trace.tracepoint_beautifiers::
|
|
|
|
Use "libtraceevent" to use that library to augment the tracepoint arguments,
|
|
|
|
"libbeauty", the default, to use the same argument beautifiers used in the
|
|
|
|
strace-like sys_enter+sys_exit lines.
|
|
|
|
|
2020-02-13 14:43:06 +08:00
|
|
|
ftrace.*::
|
|
|
|
ftrace.tracer::
|
2020-08-08 10:31:24 +08:00
|
|
|
Can be used to select the default tracer when neither -G nor
|
|
|
|
-F option is not specified. Possible values are 'function' and
|
|
|
|
'function_graph'.
|
2020-02-13 14:43:06 +08:00
|
|
|
|
2019-02-01 21:46:51 +08:00
|
|
|
llvm.*::
|
|
|
|
llvm.clang-path::
|
|
|
|
Path to clang. If omit, search it from $PATH.
|
|
|
|
|
|
|
|
llvm.clang-bpf-cmd-template::
|
|
|
|
Cmdline template. Below lines show its default value. Environment
|
|
|
|
variable is used to pass options.
|
2019-06-07 22:35:08 +08:00
|
|
|
"$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\
|
|
|
|
"-DLINUX_VERSION_CODE=$LINUX_VERSION_CODE " \
|
|
|
|
"$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \
|
|
|
|
"-Wno-unused-value -Wno-pointer-sign " \
|
|
|
|
"-working-directory $WORKING_DIR " \
|
|
|
|
"-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE"
|
2019-02-01 21:46:51 +08:00
|
|
|
|
|
|
|
llvm.clang-opt::
|
|
|
|
Options passed to clang.
|
|
|
|
|
|
|
|
llvm.kbuild-dir::
|
|
|
|
kbuild directory. If not set, use /lib/modules/`uname -r`/build.
|
|
|
|
If set to "" deliberately, skip kernel header auto-detector.
|
|
|
|
|
|
|
|
llvm.kbuild-opts::
|
|
|
|
Options passed to 'make' when detecting kernel header options.
|
|
|
|
|
|
|
|
llvm.dump-obj::
|
|
|
|
Enable perf dump BPF object files compiled by LLVM.
|
|
|
|
|
|
|
|
llvm.opts::
|
|
|
|
Options passed to llc.
|
|
|
|
|
2019-03-11 22:44:58 +08:00
|
|
|
samples.*::
|
|
|
|
|
|
|
|
samples.context::
|
|
|
|
Define how many ns worth of time to show
|
|
|
|
around samples in perf report sample context browser.
|
|
|
|
|
2019-03-11 22:45:00 +08:00
|
|
|
scripts.*::
|
|
|
|
|
|
|
|
Any option defines a script that is added to the scripts menu
|
|
|
|
in the interactive perf browser and whose output is displayed.
|
|
|
|
The name of the option is the name, 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
|
|
|
|
|
2020-02-13 14:43:06 +08:00
|
|
|
convert.*::
|
|
|
|
|
|
|
|
convert.queue-size::
|
|
|
|
Limit the size of ordered_events queue, so we could control
|
|
|
|
allocation size of perf data files without proper finished
|
|
|
|
round events.
|
2020-05-21 00:23:35 +08:00
|
|
|
stat.*::
|
|
|
|
|
|
|
|
stat.big-num::
|
|
|
|
(boolean) Change the default for "--big-num". To make
|
|
|
|
"--no-big-num" the default, set "stat.big-num=false".
|
2020-02-13 14:43:06 +08:00
|
|
|
|
|
|
|
intel-pt.*::
|
|
|
|
|
|
|
|
intel-pt.cache-divisor::
|
|
|
|
|
|
|
|
intel-pt.mispred-all::
|
|
|
|
If set, Intel PT decoder will set the mispred flag on all
|
|
|
|
branches.
|
|
|
|
|
|
|
|
auxtrace.*::
|
|
|
|
|
|
|
|
auxtrace.dumpdir::
|
|
|
|
s390 only. The directory to save the auxiliary trace buffer
|
|
|
|
can be changed using this option. Ex, auxtrace.dumpdir=/tmp.
|
|
|
|
If the directory does not exist or has the wrong file type,
|
|
|
|
the current directory is used.
|
|
|
|
|
2015-11-22 18:11:56 +08:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
linkperf:perf[1]
|