History log of /linux-master/tools/perf/Documentation/perf-config.txt
Revision Date Author Comments
# ffa96259 13-Nov-2023 James Clark <james.clark@arm.com>

perf test: Use existing config value for objdump path

There is already an existing config value for changing the objdump path,
so instead of having two values that do the same thing, make 'perf test'
use annotate.objdump as well.

Signed-off-by: James Clark <james.clark@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Fangrui Song <maskray@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/ZU5Cx4LTrB5q0sIG@kernel.org
Link: https://lore.kernel.org/r/20231113102327.695386-1-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 6aad765d 06-Nov-2023 James Clark <james.clark@arm.com>

perf test: Add support for setting objdump binary via perf config

Add a 'perf config' variable that does the same thing as "perf test
--objdump <x>".

Also update the man page.

Committer testing:

# perf config test.objdump
# perf test "object code reading"
26: Object code reading : Ok
# perf config test.objdump=blah
# perf config test.objdump
test.objdump=blah
# perf test "object code reading"
26: Object code reading : FAILED!
# perf test -v "object code reading"
26: Object code reading :
--- start ---
test child forked, pid 600599
Looking at the vmlinux_path (8 entries long)
Using /proc/kcore for kernel data
Using /proc/kallsyms for symbols
Parsing event 'cycles'
Using CPUID AuthenticAMD-25-21-0
mmap size 528384B
Reading object code for memory address: 0x4d9a02
File is: /home/acme/bin/perf
On file address is: 0xd9a02
Objdump command is: blah -z -d --start-address=0x4d9a02 --stop-address=0x4d9a82 /home/acme/bin/perf
objdump read too few bytes: 128
Bytes read differ from those read by objdump
buf1 (dso):
0x48 0x85 0xff 0x74 0x29 0xe8 0x94 0xdf 0x07 0x00 0x8b 0x73 0x1c 0x48 0x8b 0x43
0x08 0xeb 0xa5 0x0f 0x1f 0x00 0x48 0x8b 0x45 0xe8 0x64 0x48 0x2b 0x04 0x25 0x28
0x00 0x00 0x00 0x75 0x0f 0x48 0x8b 0x5d 0xf8 0xc9 0xc3 0x0f 0x1f 0x00 0x48 0x8b
0x43 0x08 0xeb 0x84 0xe8 0xc5 0x3e 0xf3 0xff 0x0f 0x1f 0x44 0x00 0x00 0x55 0x48
0x89 0xe5 0x41 0x56 0x41 0x55 0x49 0x89 0xd5 0x41 0x54 0x49 0x89 0xfc 0x53 0x48
0x89 0xf3 0x48 0x83 0xec 0x30 0x48 0x8b 0x7e 0x20 0x64 0x48 0x8b 0x04 0x25 0x28
0x00 0x00 0x00 0x48 0x89 0x45 0xd8 0x31 0xc0 0x48 0x89 0x75 0xb0 0x48 0xc7 0x45
0xb8 0x00 0x00 0x00 0x00 0x48 0xc7 0x45 0xc0 0x00 0x00 0x00 0x00 0xe8 0xad 0xfa

buf2 (objdump):
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

test child finished with -1
---- end ----
Object code reading: FAILED!
# perf config test.objdump=/usr/bin/objdump
# perf config test.objdump
test.objdump=/usr/bin/objdump
# perf test "object code reading"
26: Object code reading : Ok
#

Signed-off-by: James Clark <james.clark@arm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Fangrui Song <maskray@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Tom Rix <trix@redhat.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: llvm@lists.linux.dev
Link: https://lore.kernel.org/r/20231106151051.129440-3-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 3d6dfae8 11-Aug-2023 Ian Rogers <irogers@google.com>

perf parse-events: Remove BPF event support

New features like the BPF --filter support in perf record have made the
BPF event functionality somewhat redundant. As shown by commit
fcb027c1a4f6 ("perf tools: Revert enable indices setting syntax for BPF
map") and commit 14e4b9f4289a ("perf trace: Raw augmented syscalls fix
libbpf 1.0+ compatibility") the BPF event support hasn't been well
maintained and it adds considerable complexity in areas like event
parsing, not least as '/' is a separator for event modifiers as well as
in paths.

This patch removes support in the event parser for BPF events and then
the associated functions are removed. This leads to the removal of whole
source files like bpf-loader.c. Removing support means that augmented
syscalls in perf trace is broken, this will be fixed in a later commit
adding support using BPF skeletons.

The removal of BPF events causes an unused label warning from flex
generated code, so update build to ignore it:

```
util/parse-events-flex.c:2704:1: error: label ‘find_rule’ defined but not used [-Werror=unused-label]
2704 | find_rule: /* we branch to this label when backing up */
```

Committer notes:

Extracted from a larger patch that was also removing the support for
linking with libllvm and libclang, that were an alternative to using an
external clang execution to compile the .c event source code into BPF
bytecode.

Testing it:

# perf trace -e /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.c
event syntax error: '/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.c'
\___ Bad event or PMU

Unabled to find PMU or event on a PMU of 'home'

Initial error:
event syntax error: '/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.c'
\___ Cannot find PMU `home'. Missing kernel support?
Run 'perf list' for a list of valid events

Usage: perf trace [<options>] [<command>]
or: perf trace [<options>] -- <command> [<options>]
or: perf trace record [<options>] [<command>]
or: perf trace record [<options>] -- <command> [<options>]

-e, --event <event> event/syscall selector. use 'perf list' to list available events
#

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Carsten Haitzler <carsten.haitzler@arm.com>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Fangrui Song <maskray@google.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Tom Rix <trix@redhat.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Wang ShaoBo <bobo.shaobowang@huawei.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: YueHaibing <yuehaibing@huawei.com>
Cc: bpf@vger.kernel.org
Cc: llvm@lists.linux.dev
Link: https://lore.kernel.org/r/20230810184853.2860737-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 78987bb0 23-Jun-2023 Fangrui Song <maskray@google.com>

perf: Replace deprecated -target with --target= for Clang

-target has been deprecated since Clang 3.4 in 2013. Use the preferred
--target=bpf form instead. This matches how we use --target= in
scripts/Makefile.clang.

Signed-off-by: Fangrui Song <maskray@google.com>
Acked-by: Yonghong Song <yhs@fb.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: llvm@lists.linux.dev
Cc: Ingo Molnar <mingo@redhat.com>
Cc: bpf@vger.kernel.org
Link: https://github.com/llvm/llvm-project/commit/274b6f0c87a6a1798de0a68135afc7f95def6277
Link: https://lore.kernel.org/r/20230624002708.1907962-1-maskray@google.com
[ resolved a conflict with GEN_VMLINUX_H changes ]
Signed-off-by: Namhyung Kim <namhyung@kernel.org>


# 57594454 28-Mar-2023 Ian Rogers <irogers@google.com>

perf symbol: Add command line support for addr2line path

Allow addr2line to be set either on the command line or via the
perfconfig file. This doesn't currently work with llvm-addr2line as
the addr2line code emits two things:
1) the address to decode,
2) a bogus ',' value.
The expectation is the bogus value will generate:
??
??:0
that terminates the addr2line reading. However, the output from
llvm-addr2line is a single line with just the input ',' locking up the
addr2line reading that is expecting a second line.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Tom Rix <trix@redhat.com>
Cc: llvm@lists.linux.dev
Link: https://lore.kernel.org/r/20230328235543.1082207-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 0b02b47e 28-Mar-2023 Ian Rogers <irogers@google.com>

perf annotate: Allow objdump to be set in perfconfig

Allow the setting of the objdump command in the perfconfig. Update man
page for this new option.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Tom Rix <trix@redhat.com>
Cc: llvm@lists.linux.dev
Link: https://lore.kernel.org/r/20230328235543.1082207-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# a7fdd30a 05-Sep-2022 Adrian Hunter <adrian.hunter@intel.com>

perf auxtrace: Add itrace option flag d+e to log on error

Add flag +e to the itrace d (decoder debug log) option to get output only
on decoding errors.

The log can be very big so reducing the output to where there are decoding
errors can be useful for analyzing errors.

By default, the log size in that case is 16384 bytes, but can be altered by
perf config e.g. perf config itrace.debug-log-buffer-size=30000

Reviewed-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20220905073424.3971-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 9bce13ea 09-Dec-2021 Jiri Olsa <jolsa@redhat.com>

perf record: Disable debuginfod by default

Fedora 35 sets DEBUGINFOD_URLS by default, which might lead to
unexpected stalls in perf record exit path, when we try to cache
profiled binaries.

# DEBUGINFOD_PROGRESS=1 ./perf record -a
^C[ perf record: Woken up 1 times to write data ]
Downloading from https://debuginfod.fedoraproject.org/ 447069
Downloading from https://debuginfod.fedoraproject.org/ 1502175
Downloading \^Z

Disabling DEBUGINFOD_URLS by default in perf record and adding
debuginfod option and .perfconfig variable support to enable id.

Default without debuginfo processing:
# perf record -a

Using system debuginfod setup:
# perf record -a --debuginfod

Using custom debuginfd url:
# perf record -a --debuginfod='https://evenbetterdebuginfodserver.krava'

Adding single perf_debuginfod_setup function and using
it also in perf buildid-cache command.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20211209200425.303561-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# b4b046ff 01-Jul-2021 Adrian Hunter <adrian.hunter@intel.com>

perf intel-pt: Add a config for max loops without consuming a packet

The Intel PT decoder limits the number of unconditional branches (e.g.
jmps) decoded without consuming any trace packets. Generally, a loop
needs a conditional branch which generates a TNT packet, whereas a "ret"
instruction will generate a TIP or TNT packet. So exceeding the limit is
assumed to be a never-ending loop, which can happen if there has been a
decoding error putting the decoder at the wrong place in the code.

Up until now, the limit of 10000 has been enough but some analytic
purposes have been reported to exceed that.

Increase the limit to 100000, and make it configurable via perf config
intel-pt.max-loops. Also amend the "Never-ending loop" message to
mention the configuration entry.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20210701175132.3977-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 8f08cf33 26-Apr-2021 Namhyung Kim <namhyung@kernel.org>

perf report: Make --skip-empty as default

so that the compact output is shown by default. Also add 'report.skip-empty'
config option to override the default. Users can also use --no-skip-empty
command line option to change the behavior anytime.

Committer testing:

$ perf report --stat

Aggregated stats:
TOTAL events: 19
COMM events: 2
EXIT events: 1
SAMPLE events: 8
MMAP2 events: 4
FINISHED_ROUND events: 1
THREAD_MAP events: 1
CPU_MAP events: 1
TIME_CONV events: 1
cycles:u stats:
SAMPLE events: 8
$ perf config report.skip-empty=false
$ perf report --stat

Aggregated stats:
TOTAL events: 19
MMAP events: 0
LOST events: 0
COMM events: 2
EXIT events: 1
THROTTLE events: 0
UNTHROTTLE events: 0
FORK events: 0
READ events: 0
SAMPLE events: 8
MMAP2 events: 4
AUX events: 0
ITRACE_START events: 0
LOST_SAMPLES events: 0
SWITCH events: 0
SWITCH_CPU_WIDE events: 0
NAMESPACES events: 0
KSYMBOL events: 0
BPF_EVENT events: 0
CGROUP events: 0
TEXT_POKE events: 0
ATTR events: 0
EVENT_TYPE events: 0
TRACING_DATA events: 0
BUILD_ID events: 0
FINISHED_ROUND events: 1
ID_INDEX events: 0
AUXTRACE_INFO events: 0
AUXTRACE events: 0
AUXTRACE_ERROR events: 0
THREAD_MAP events: 1
CPU_MAP events: 1
STAT_CONFIG events: 0
STAT events: 0
STAT_ROUND events: 0
EVENT_UPDATE events: 0
TIME_CONV events: 1
FEATURE events: 0
COMPRESSED events: 0
cycles:u stats:
SAMPLE events: 8
$ perf config report.skip-empty
report.skip-empty=false
$

Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210427013717.1651674-6-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 44e17650 26-Feb-2021 Martin Liska <mliska@suse.cz>

perf config: Add annotate.demangle{,_kernel}

Committer notes:

This allows setting this in from the command line:

$ perf config annotate.demangle
$ perf config annotate.demangle=yes
$ perf config annotate.demangle
annotate.demangle=yes
$ cat ~/.perfconfig
# this file is auto-generated.
[report]
sort-order = srcline
[annotate]
demangle = yes
$
$
$ perf config annotate.demangle_kernel
$ perf config annotate.demangle_kernel=yes
$ perf config annotate.demangle_kernel
annotate.demangle_kernel=yes
$ cat ~/.perfconfig
# this file is auto-generated.
[report]
sort-order = srcline
[annotate]
demangle = yes
demangle_kernel = yes
$

Signed-off-by: Martin Liška <mliska@suse.cz>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/c96aabe7-791f-9503-295f-3147a9d19b60@suse.cz
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# c0666261 08-Feb-2021 Jiri Olsa <jolsa@kernel.org>

perf daemon: Add config file support

Adding support to configure daemon with config file.

Each client or server invocation of perf daemon needs to know the
base directory, where all sessions data is stored.

The base is defined with:

daemon.base
Base path for daemon data. All sessions data are stored under
this path.

The daemon allows to create record sessions. Each session is a
record command spawned and monitored by perf daemon.

The session is defined with:

session-<NAME>.run
Defines new record session for daemon. The value is record's
command line without the 'record' keyword.

Example:

# cat ~/.perfconfig
[daemon]
base=/opt/perfdata

[session-cycles]
run = -m 10M -e cycles --overwrite --switch-output -a

[session-sched]
run = -m 20M -e sched:* --overwrite --switch-output -a

The example above defines '/opt/perfdata' as the base directory and 2
record sessions.

# perf daemon start
[2021-01-28 19:47:33.454413] daemon started (pid 16015)
[2021-01-28 19:47:33.455910] reconfig: ruining session [cycles:16016]: -m 10M -e cycles --overwrite --switch-output -a
[2021-01-28 19:47:33.456599] reconfig: ruining session [sched:16017]: -m 20M -e sched:* --overwrite --switch-output -a

# ps -ef | grep perf
... perf daemon start
... /home/jolsa/.../perf record -m 20M -e cycles --overwrite --switch-output -a
... /home/jolsa/.../perf record -m 20M -e sched:* --overwrite --switch-output -a

The base directory is populated with:

# find /opt/perfdata/
/opt/perfdata/
/opt/perfdata/control <- control socket
/opt/perfdata/session-cycles <- data for session 'cycles':
/opt/perfdata/session-cycles/output <- perf record output
/opt/perfdata/session-cycles/perf.data <- perf data
/opt/perfdata/session-sched <- ditto for session 'sched'
/opt/perfdata/session-sched/output
/opt/perfdata/session-sched/perf.data

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Budankov <abudankov@huawei.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: https://lore.kernel.org/r/20210208200908.1019149-7-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# e8a2061f 14-Dec-2020 Jiri Olsa <jolsa@kernel.org>

perf buildid-cache: Add --debuginfod option to specify a server to fetch debug files

Add the --debuginfod option to specify debuginfod URL and support to do
that through config file as well.

Use the following in ~/.perfconfig file:

[buildid-cache]
debuginfod=http://192.168.122.174:8002

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Budankov <abudankov@huawei.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20201214105457.543111-14-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# e29386c8 14-Dec-2020 Jiri Olsa <jolsa@kernel.org>

perf record: Add --buildid-mmap option to enable PERF_RECORD_MMAP2's build id

Add --buildid-mmap option to enable build id in PERF_RECORD_MMAP2 events.

It will only work if there's kernel support for that and it disables
build id cache (implies --no-buildid).

It's also possible to enable it permanently via config option in
~/.perfconfig file:

[record]
build-id=mmap

Also added build_id bit in the verbose output for perf_event_attr:

# perf record --buildid-mmap -vv
...
perf_event_attr:
type 1
size 120
...
build_id 1

Adding also missing text_poke bit.

Committer testing:

$ perf record -h build

Usage: perf record [<options>] [<command>]
or: perf record [<options>] -- <command> [<options>]

-B, --no-buildid do not collect buildids in perf.data
-N, --no-buildid-cache
do not update the buildid cache
--buildid-all Record build-id of all DSOs regardless of hits
--buildid-mmap Record build-id in map events

$

$ perf record --buildid-mmap sleep 1
Failed: no support to record build id in mmap events, update your kernel.
$

After adding the needed kernel bits in a test kernel:

$ perf record -vv --buildid-mmap sleep 1 |& grep -m1 build
Enabling build id in mmap2 events.
$ perf evlist -v
cycles:u: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|PERIOD, read_format: ID, disabled: 1, inherit: 1, exclude_kernel: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1, build_id: 1
$

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Budankov <abudankov@huawei.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20201214105457.543111-16-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 526671bf 15-Dec-2020 Nick Thompson <nathompson7@protonmail.com>

perf config: Fix example command in manpage to conform to syntax specified in the SYNOPSIS section.

Committer testing:

With the previously documented example:

$ perf config --user report sort-order=srcline
The config variable does not contain a section name: report
$

With the fixed example line:

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

Signed-off-by: Nick Thompson <nathompson7@protonmail.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>
Link: https://lore.kernel.org/linux-perf-users/20201217142619.GA14524@redhat.com/
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# bbe54468 04-Sep-2020 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# eb6d31ae 07-Aug-2020 Changbin Du <changbin.du@intel.com>

perf ftrace: Select function/function_graph tracer automatically

The '-g/-G' options have already implied function_graph tracer should be
used instead of function tracer. So we don't need extra option
'--tracer' in this case.

This patch changes the behavior as below:

- If '-g' or '-G' option is on, then function_graph tracer is used.
- If '-T' or '-N' option is on, then function tracer is used.
- The function_graph has priority over function tracer.
- The option '--tracer' only take effect if neither -g/-G nor -T/-N
is specified.

Here are some examples.

This will start tracing all functions using default tracer:

$ sudo perf ftrace

This will trace all functions using function graph tracer:

$ sudo perf ftrace -G '*'

This will trace function vfs_read using function graph tracer:

$ sudo perf ftrace -G vfs_read

This will trace function vfs_read using function tracer:

$ sudo perf ftrace -T vfs_read

Committer notes:

Using '-h -G' will tell what that option is about, so to further clarify
the above examples:

# perf ftrace -h -G

-G, --graph-funcs <func> Set graph filter on given functions

# perf ftrace -h -g

-g, --nograph-funcs <func> Set nograph filter on given functions

# perf ftrace -h -T

-T, --trace-funcs <func> trace given functions only

# perf ftrace -h -N

-N, --notrace-funcs <func> do not trace given functions

#

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: http://lore.kernel.org/lkml/20200808023141.14227-2-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# d778a778 20-May-2020 Paul A. Clarke <pc@us.ibm.com>

perf config: Add stat.big-num support

Add support for new "stat.big-num" boolean option.

This allows a user to set a default for "--no-big-num" for "perf stat"
commands.

--
$ perf config stat.big-num
$ perf stat --event cycles /bin/true

Performance counter stats for '/bin/true':

778,849 cycles
[...]
$ perf config stat.big-num=false
$ perf config stat.big-num
stat.big-num=false
$ perf stat --event cycles /bin/true

Performance counter stats for '/bin/true':

769622 cycles
[...]
--

There is an interaction with "--field-separator" that must be
accommodated, such that specifying "--big-num --field-separator={x}"
still reports an invalid combination of options.

Documentation for perf-config and perf-stat updated.

Signed-off-by: Paul Clarke <pc@us.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lore.kernel.org/lkml/1589991815-17951-1-git-send-email-pc@us.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# eadcaa3d 25-Mar-2020 Tony Jones <tonyj@suse.de>

perf callchain: Update docs regarding kernel/user space unwinding

The method of unwinding for kernel space is defined by the kernel
config, not by the value of --call-graph. Improve the documentation to
reflect this.

Signed-off-by: Tony Jones <tonyj@suse.de>
Link: http://lore.kernel.org/lkml/20200325164053.10177-1-tonyj@suse.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# b0aaf4c8 12-Feb-2020 Ravi Bangoria <ravi.bangoria@linux.ibm.com>

perf config: Document missing config options

While documenting annotate.show_nr_samples config option, I found many
other config options missing in perf-config documentation. Add them.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Changbin Du <changbin.du@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Yisheng Xie <xieyisheng1@huawei.com>
Link: http://lore.kernel.org/lkml/20200213064306.160480-9-ravi.bangoria@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# cd0a9c51 12-Feb-2020 Ravi Bangoria <ravi.bangoria@linux.ibm.com>

perf annotate: Fix perf config option description

perf config annotate options says it works only with TUI, which is wrong.
Most of the TUI options are applicable to stdio2 as well. So remove that
generic line and add individual line with each option stating which
browsers supports that option. Also, annotate.show_nr_samples config is
missing in Documentation. Describe it.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Changbin Du <changbin.du@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Yisheng Xie <xieyisheng1@huawei.com>
Link: http://lore.kernel.org/lkml/20200213064306.160480-8-ravi.bangoria@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# f11b2803 04-Oct-2019 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# 5de9e5fd 30-Jul-2019 Arnaldo Carvalho de Melo <acme@redhat.com>

perf config: Document the PERF_CONFIG environment variable

There was a provision for setting this variable, but not the
getenv("PERF_CONFIG") call to set it, as this was fixed in the previous
cset, document that it can be used to ask for using an alternative
.perfconfig file or to disable reading whatever file exists in the
system or home directory, i.e. using:

export PERF_CONFIG=/dev/null

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: Taeung Song <treeze.taeung@gmail.com>
Link: https://lkml.kernel.org/n/tip-0u4o967hsk7j0o50zp9ctn89@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 87407fa5 07-Jun-2019 Leo Yan <leo.yan@linaro.org>

perf config: Update default value for llvm.clang-bpf-cmd-template

The clang bpf cmdline template has defined default value in the file
tools/perf/util/llvm-utils.c, which has been changed for several times.

This patch updates the documentation to reflect the latest default value
for the configuration llvm.clang-bpf-cmd-template.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Drayton <mbd@fb.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org
Fixes: d35b168c3dcd ("perf bpf: Give precedence to bpf header dir")
Fixes: cb76371441d0 ("perf llvm: Allow passing options to llc in addition to clang")
Fixes: 1b16fffa389d ("perf llvm-utils: Add bpf include path to clang command line")
Link: http://lkml.kernel.org/r/20190607143508.18141-1-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 9b40dff7 16-Mar-2019 Changbin Du <changbin.du@intel.com>

perf config: Fix an error in the config template documentation

The option 'sort-order' should be 'sort_order'.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Fixes: 893c5c798be9 ("perf config: Show default report configuration in example and docs")
Link: http://lkml.kernel.org/r/20190316080556.3075-5-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# e3b74de5 11-Mar-2019 Andi Kleen <ak@linux.intel.com>

perf tools report: Add custom scripts to script menu

Add a way to define custom scripts through ~/.perfconfig, which are then
added to the scripts menu. The scripts get the same arguments as 'perf
script', in particular -i, --cpu, --tid.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20190311144502.15423-10-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 4968ac8f 11-Mar-2019 Andi Kleen <ak@linux.intel.com>

perf report: Implement browsing of individual samples

Now 'perf report' can show whole time periods with 'perf script', but
the user still has to find individual samples of interest manually.

It would be expensive and complicated to search for the right samples in
the whole perf file. Typically users only need to look at a small number
of samples for useful analysis.

Also the full scripts tend to show samples of all CPUs and all threads
mixed up, which can be very confusing on larger systems.

Add a new --samples option to save a small random number of samples per
hist entry.

Use a reservoir sample technique to select a representatve number of
samples.

Then allow browsing the samples using 'perf script' as part of the hist
entry context menu. This automatically adds the right filters, so only
the thread or cpu of the sample is displayed. Then we use less' search
functionality to directly jump the to the time stamp of the selected
sample.

It uses different menus for assembler and source display. Assembler
needs xed installed and source needs debuginfo.

Currently it only supports as many samples as fit on the screen due to
some limitations in the slang ui code.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20190311174605.GA29294@tassilo.jf.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 55fa8b8c 01-Feb-2019 Changbin Du <changbin.du@intel.com>

perf tools: Add documentation for BPF event selection

Add documentation for how to pass a BPF program as a perf event.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190201134651.12373-1-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# c65c83ff 14-Dec-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# 9ed45d59 14-Dec-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# 9d6dc178 14-Dec-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# b036146f 14-Dec-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# d32de87e 14-Dec-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# 42e4a52d 14-Dec-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

perf trace: Allow configuring if the syscall duration should be printed

# perf config trace.show_duration=no
# perf config -l | grep trace
trace.default_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
trace.show_zeros=true
trace.show_duration=no
# trace -e *sleep sleep 1
0.000 sleep/8729 nanosleep(rqtp: 0x7ffcb0b4c940, rmtp: 0) = 0
# perf config trace.show_duration=yes
# trace -e *sleep sleep 1
0.000 (1000.212 ms): sleep/8735 nanosleep(rqtp: 0x7ffca15fa770, rmtp: 0) = 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-2c7h1m8fhzb9puxtj9nlevi8@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# e7c634fc 14-Dec-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

perf trace: Allow configuring if zeroed syscall args should be printed

The default so far, since we show argument names followed by its values,
was to make the output more compact by suppressing most zeroed args.

Make this configurable so that users can choose what best suit their
needs.

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-q0gxws02ygodh94o0hzim5xd@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# ac96287c 13-Dec-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# 3fcb10e4 04-Dec-2018 Mark Drayton <mbd@fb.com>

perf tools: Allow specifying proc-map-timeout in config file

The default timeout of 500ms for parsing /proc/<pid>/maps files is too
short for profiling many of our services.

This can be overridden by passing --proc-map-timeout to the relevant
command but it'd be nice to globally increase our default value.

This patch permits setting a different default with the
core.proc-map-timeout config file parameter.

Signed-off-by: Mark Drayton <mbd@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20181204203420.1683114-1-mbd@fb.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 43c40231 12-Apr-2018 Arnaldo Carvalho de Melo <acme@redhat.com>

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>


# 4b35994a 10-Feb-2017 Namhyung Kim <namhyung@kernel.org>

perf diff: Add diff.compute config option

The diff.compute config variable is to set the default compute method of
perf diff command (-c option). Possible values 'delta' (default),
'delta-abs', 'ratio' and 'wdiff'.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Taeung Song <treeze.taeung@gmail.com>
Link: http://lkml.kernel.org/r/20170210073614.24584-4-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# d49dd15d 10-Feb-2017 Namhyung Kim <namhyung@kernel.org>

perf diff: Add diff.order config option

In many cases, I need to look at differences between two data so I often
used the -o option to sort the result base on the difference first.
It'd be nice to have a config option to set it by default.

The diff.order config option is to set the default value of -o/--order
option.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Taeung Song <treeze.taeung@gmail.com>
Link: http://lkml.kernel.org/r/20170210073614.24584-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# c6fc018a 04-Nov-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Add support setting variables in a config file

Add setting feature that can add config variables with their values to a
config file (i.e. user or system config file) or modify config key-value
pairs in a config file. For the syntax examples:

perf config [<file-option>] [section.name[=value] ...]

e.g. You can set the ui.show-headers to false with

# perf config ui.show-headers=false

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

# perf config annotate.show_nr_jumps=false kmem.default=slab

Committer notes:

Testing it:

$ perf config -l
top.children=true
report.children=false
$
$ perf config top.children=false
$ perf config -l
top.children=false
report.children=false
$
$ perf config kmem.default=slab
$ perf config -l
top.children=false
report.children=false
kmem.default=slab
$

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Nambong Ha <over3025@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Wookje Kwon <aweee0@gmail.com>
Link: http://lkml.kernel.org/r/1478241862-31230-5-git-send-email-treeze.taeung@gmail.com
[ Combined patch with docs update with this one ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 90923608 04-Nov-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Add support for getting config key-value pairs

Add a functionality getting specific config key-value pairs.
For the syntax examples,

perf config [<file-option>] [section.name ...]

e.g. To query config items 'report.queue-size' and 'report.children', do

# perf config report.queue-size report.children

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Nambong Ha <over3025@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Wookje Kwon <aweee0@gmail.com>
Link: http://lkml.kernel.org/r/1478241862-31230-2-git-send-email-treeze.taeung@gmail.com
[ Combined patch with docs update with this one ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 893c5c79 30-Aug-2016 Milian Wolff <milian.wolff@kdab.com>

perf config: Show default report configuration in example and docs

Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
LPU-Reference: 20160830134106.21240-2-milian.wolff@kdab.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# fa1f4565 12-Aug-2016 Arnaldo Carvalho de Melo <acme@redhat.com>

perf report: Allow configuring the default sort order in ~/.perfconfig

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.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-pm1h5puxua8nsxksd68fjm8r@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# c7ac2417 10-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Add '--system' and '--user' options to select which config file is used

The '--system' option means $(sysconfdir)/perfconfig and '--user' means
$HOME/.perfconfig. If none is used, both system and user config file are
read. E.g.:

# perf config [<file-option>] [options]

With an specific config file:

# perf config --user | --system

or both user and system config file:

# perf config

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1455126685-32367-2-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# a9edec3c 04-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document 'record.build-id' variable in man page

Explain 'record.build-id' variable.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454577913-16401-9-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 57f0dafe 04-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document 'kmem.default' variable in man page

Explain 'kmem.default' variable.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454577913-16401-8-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# ab2e08e8 04-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document 'pager.<subcommand>' variables in man page

Explain 'pager.<subcommand>' variables.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454577913-16401-7-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 08b75b40 04-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document 'man.viewer' variable in man page

Explain 'man.viewer' variable and how to add new man viewer tools.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454577913-16401-6-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 0b04c840 04-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document 'top.children' variable in man page

Explain 'top.children' variable.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454577913-16401-5-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 806cb95b 04-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document variables for 'report' section in man page

Explain 'report' section's variables:

'percent-limit', 'queue-size' and 'children'.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454577913-16401-4-git-send-email-treeze.taeung@gmail.com
[ Fix some grammar issues, add some more info ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 56c94dc5 04-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document variables for 'call-graph' section in man page

Explain 'call-graph' section and its variables:

'record-mode', 'dump-size', 'print-type', 'order', 'sort-key',
'threshold' and 'print-limit'.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454577913-16401-3-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 67f43c00 04-Feb-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document 'ui.show-headers' variable in man page

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.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454577913-16401-2-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 485311d9 08-Jan-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document 'hist.percentage' variable in man page

Explain 'hist.percentage' variable.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452253193-30502-7-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 3b97629d 08-Jan-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document variables for 'annotate' section in man page

Explain 'annotate' section and its variables.

'hide_src_code', 'use_offset', 'jump_arrows',
'show_linenr', 'show_nr_jump' and 'show_total_period'.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452253193-30502-5-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 2733525b 08-Jan-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document 'buildid.dir' variable in man page

Explain 'buildid.dir' variable.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452253193-30502-4-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 3fa9f407 08-Jan-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document variables for 'tui' and 'gtk' sections in man page

Explain 'tui' and 'gtk' sections and these variables.

'top', 'report' and 'annotate'

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452253193-30502-3-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 89debf17 08-Jan-2016 Taeung Song <treeze.taeung@gmail.com>

perf config: Document variables for 'colors' section in man page

Explain 'colors' section and its variables, used for The variables for
customizing the colors used in the output for the 'report', 'top' and
'annotate' in the TUI, those are:

'top', 'medium', 'normal', 'selected',
'jump_arrows', 'addr' and 'root'.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452253193-30502-2-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 78ce08df 08-Jan-2016 Taeung Song <treeze.taeung@gmail.com>

perf annotate: Rename 'colors.code' to 'colors.jump_arrows'

USe 'jump_arrows' config name instead of 'code' on 'colors' section.
'colors.code' config is only for jump arrows on assembly code listings
i.e.

│ ┌──jmp 1333
│ │ xchg %ax,%ax
│ │ mov %r15,%r10
│ └─→cmp %r15,%r14

But this config name seems unfit.

'jump_arrows' is more descriptive than 'code'.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452240971-25418-1-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>


# 7d685243 22-Nov-2015 Taeung Song <treeze.taeung@gmail.com>

perf config: Add initial man page

Add perf-config document to describe the perf configuration and a
'list’ subcommand.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/63AD9B57-7B8C-46F8-8F18-0FFEB9A6A1BC@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>