mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 09:13:20 -05:00
f085df1be6
We need to better polish building with BPF skels, so revert back to
making it an experimental feature that has to be explicitely enabled
using BUILD_BPF_SKEL=1.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-----BEGIN PGP SIGNATURE-----
iHUEABYKAB0WIQR2GiIUctdOfX2qHhGyPKLppCJ+JwUCZFbCXwAKCRCyPKLppCJ+
J7cHAP97erKY4hBXArjpfzcvpFmboh/oqhbTLntyIpS6TEnOyQEAyervAPGIjQYC
DCo4foyXmOWn3dhNtK9M+YiRl3o2SgQ=
=7G78
-----END PGP SIGNATURE-----
Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tool updates from Arnaldo Carvalho de Melo:
"Third version of perf tool updates, with the build problems with with
using a 'vmlinux.h' generated from the main build fixed, and the bpf
skeleton build disabled by default.
Build:
- Require libtraceevent to build, one can disable it using
NO_LIBTRACEEVENT=1.
It is required for tools like 'perf sched', 'perf kvm', 'perf
trace', etc.
libtraceevent is available in most distros so installing
'libtraceevent-devel' should be a one-time event to continue
building perf as usual.
Using NO_LIBTRACEEVENT=1 produces tooling that is functional and
sufficient for lots of users not interested in those libtraceevent
dependent features.
- Allow Python support in 'perf script' when libtraceevent isn't
linked, as not all features requires it, for instance Intel PT does
not use tracepoints.
- Error if the python interpreter needed for jevents to work isn't
available and NO_JEVENTS=1 isn't set, preventing a build without
support for JSON vendor events, which is a rare but possible
condition. The two check error messages:
$(error ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.)
$(error ERROR: Python interpreter needed for jevents generation too old (older than 3.6). Install a newer python or build with NO_JEVENTS=1.)
- Make libbpf 1.0 the minimum required when building with out of
tree, distro provided libbpf.
- Use libsdtc++'s and LLVM's libcxx's __cxa_demangle, a portable C++
demangler, add 'perf test' entry for it.
- Make binutils libraries opt in, as distros disable building with it
due to licensing, they were used for C++ demangling, for instance.
- Switch libpfm4 to opt-out rather than opt-in, if libpfm-devel (or
equivalent) isn't installed, we'll just have a build warning:
Makefile.config:1144: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev
- Add a feature test for scandirat(), that is not implemented so far
in musl and uclibc, disabling features that need it, such as
scanning for tracepoints in /sys/kernel/tracing/events.
perf BPF filters:
- New feature where BPF can be used to filter samples, for instance:
$ sudo ./perf record -e cycles --filter 'period > 1000' true
$ sudo ./perf script
perf-exec 2273949 546850.708501: 5029 cycles: ffffffff826f9e25 finish_wait+0x5 ([kernel.kallsyms])
perf-exec 2273949 546850.708508: 32409 cycles: ffffffff826f9e25 finish_wait+0x5 ([kernel.kallsyms])
perf-exec 2273949 546850.708526: 143369 cycles: ffffffff82b4cdbf xas_start+0x5f ([kernel.kallsyms])
perf-exec 2273949 546850.708600: 372650 cycles: ffffffff8286b8f7 __pagevec_lru_add+0x117 ([kernel.kallsyms])
perf-exec 2273949 546850.708791: 482953 cycles: ffffffff829190de __mod_memcg_lruvec_state+0x4e ([kernel.kallsyms])
true 2273949 546850.709036: 501985 cycles: ffffffff828add7c tlb_gather_mmu+0x4c ([kernel.kallsyms])
true 2273949 546850.709292: 503065 cycles: 7f2446d97c03 _dl_map_object_deps+0x973 (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
- In addition to 'period' (PERF_SAMPLE_PERIOD), the other
PERF_SAMPLE_ can be used for filtering, and also some other sample
accessible values, from tools/perf/Documentation/perf-record.txt:
Essentially the BPF filter expression is:
<term> <operator> <value> (("," | "||") <term> <operator> <value>)*
The <term> can be one of:
ip, id, tid, pid, cpu, time, addr, period, txn, weight, phys_addr,
code_pgsz, data_pgsz, weight1, weight2, weight3, ins_lat, retire_lat,
p_stage_cyc, mem_op, mem_lvl, mem_snoop, mem_remote, mem_lock,
mem_dtlb, mem_blk, mem_hops
The <operator> can be one of:
==, !=, >, >=, <, <=, &
The <value> can be one of:
<number> (for any term)
na, load, store, pfetch, exec (for mem_op)
l1, l2, l3, l4, cxl, io, any_cache, lfb, ram, pmem (for mem_lvl)
na, none, hit, miss, hitm, fwd, peer (for mem_snoop)
remote (for mem_remote)
na, locked (for mem_locked)
na, l1_hit, l1_miss, l2_hit, l2_miss, any_hit, any_miss, walk, fault (for mem_dtlb)
na, by_data, by_addr (for mem_blk)
hops0, hops1, hops2, hops3 (for mem_hops)
perf lock contention:
- Show lock type with address.
- Track and show mmap_lock, siglock and per-cpu rq_lock with address.
This is done for mmap_lock by following the current->mm pointer:
$ sudo ./perf lock con -abl -- sleep 10
contended total wait max wait avg wait address symbol
...
16344 312.30 ms 2.22 ms 19.11 us ffff8cc702595640
17686 310.08 ms 1.49 ms 17.53 us ffff8cc7025952c0
3 84.14 ms 45.79 ms 28.05 ms ffff8cc78114c478 mmap_lock
3557 76.80 ms 68.75 us 21.59 us ffff8cc77ca3af58
1 68.27 ms 68.27 ms 68.27 ms ffff8cda745dfd70
9 54.53 ms 7.96 ms 6.06 ms ffff8cc7642a48b8 mmap_lock
14629 44.01 ms 60.00 us 3.01 us ffff8cc7625f9ca0
3481 42.63 ms 140.71 us 12.24 us ffffffff937906ac vmap_area_lock
16194 38.73 ms 42.15 us 2.39 us ffff8cd397cbc560
11 38.44 ms 10.39 ms 3.49 ms ffff8ccd6d12fbb8 mmap_lock
1 5.43 ms 5.43 ms 5.43 ms ffff8cd70018f0d8
1674 5.38 ms 422.93 us 3.21 us ffffffff92e06080 tasklist_lock
581 4.51 ms 130.68 us 7.75 us ffff8cc9b1259058
5 3.52 ms 1.27 ms 703.23 us ffff8cc754510070
112 3.47 ms 56.47 us 31.02 us ffff8ccee38b3120
381 3.31 ms 73.44 us 8.69 us ffffffff93790690 purge_vmap_area_lock
255 3.19 ms 36.35 us 12.49 us ffff8d053ce30c80
- Update default map size to 16384.
- Allocate single letter option -M for --map-nr-entries, as it is
proving being frequently used.
- Fix struct rq lock access for older kernels with BPF's CO-RE
(Compile once, run everywhere).
- Fix problems found with MSAn.
perf report/top:
- Add inline information when using --call-graph=fp or lbr, as was
already done to the --call-graph=dwarf callchain mode.
- Improve the 'srcfile' sort key performance by really using an
optimization introduced in 6.2 for the 'srcline' sort key that
avoids calling addr2line for comparision with each sample.
perf sched:
- Make 'perf sched latency/map/replay' to use "sched:sched_waking"
instead of "sched:sched_waking", consistent with 'perf record'
since
|
||
---|---|---|
.. | ||
arm-spe-decoder | ||
bpf_skel | ||
c++ | ||
cs-etm-decoder | ||
hisi-ptt-decoder | ||
include | ||
intel-pt-decoder | ||
libunwind | ||
scripting-engines | ||
affinity.c | ||
affinity.h | ||
amd-sample-raw.c | ||
annotate.c | ||
annotate.h | ||
archinsn.h | ||
arm-spe.c | ||
arm-spe.h | ||
arm64-frame-pointer-unwind-support.c | ||
arm64-frame-pointer-unwind-support.h | ||
auxtrace.c | ||
auxtrace.h | ||
block-info.c | ||
block-info.h | ||
block-range.c | ||
block-range.h | ||
bpf-event.c | ||
bpf-event.h | ||
bpf-filter.c | ||
bpf-filter.h | ||
bpf-filter.l | ||
bpf-filter.y | ||
bpf-loader.c | ||
bpf-loader.h | ||
bpf-prologue.c | ||
bpf-prologue.h | ||
bpf-utils.c | ||
bpf-utils.h | ||
bpf_counter.c | ||
bpf_counter.h | ||
bpf_counter_cgroup.c | ||
bpf_ftrace.c | ||
bpf_kwork.c | ||
bpf_lock_contention.c | ||
bpf_map.c | ||
bpf_map.h | ||
bpf_off_cpu.c | ||
branch.c | ||
branch.h | ||
Build | ||
build-id.c | ||
build-id.h | ||
cache.h | ||
cacheline.c | ||
cacheline.h | ||
call-path.c | ||
call-path.h | ||
callchain.c | ||
callchain.h | ||
cap.c | ||
cap.h | ||
cgroup.c | ||
cgroup.h | ||
clockid.c | ||
clockid.h | ||
cloexec.c | ||
cloexec.h | ||
color.c | ||
color.h | ||
color_config.c | ||
comm.c | ||
comm.h | ||
compress.h | ||
config.c | ||
config.h | ||
copyfile.c | ||
copyfile.h | ||
counts.c | ||
counts.h | ||
cpu-set-sched.h | ||
cpumap.c | ||
cpumap.h | ||
cputopo.c | ||
cputopo.h | ||
cs-etm-base.c | ||
cs-etm.c | ||
cs-etm.h | ||
data-convert-bt.c | ||
data-convert-json.c | ||
data-convert.h | ||
data.c | ||
data.h | ||
db-export.c | ||
db-export.h | ||
debug.c | ||
debug.h | ||
demangle-cxx.cpp | ||
demangle-cxx.h | ||
demangle-java.c | ||
demangle-java.h | ||
demangle-ocaml.c | ||
demangle-ocaml.h | ||
demangle-rust.c | ||
demangle-rust.h | ||
dlfilter.c | ||
dlfilter.h | ||
dso.c | ||
dso.h | ||
dsos.c | ||
dsos.h | ||
dump-insn.c | ||
dump-insn.h | ||
dwarf-aux.c | ||
dwarf-aux.h | ||
dwarf-regs.c | ||
env.c | ||
env.h | ||
event.c | ||
event.h | ||
events_stats.h | ||
evlist-hybrid.c | ||
evlist-hybrid.h | ||
evlist.c | ||
evlist.h | ||
evsel.c | ||
evsel.h | ||
evsel_config.h | ||
evsel_fprintf.c | ||
evsel_fprintf.h | ||
evswitch.c | ||
evswitch.h | ||
expr.c | ||
expr.h | ||
expr.l | ||
expr.y | ||
find-map.c | ||
fncache.c | ||
fncache.h | ||
ftrace.h | ||
genelf.c | ||
genelf.h | ||
genelf_debug.c | ||
generate-cmdlist.sh | ||
get_current_dir_name.c | ||
get_current_dir_name.h | ||
hashmap.c | ||
hashmap.h | ||
header.c | ||
header.h | ||
help-unknown-cmd.c | ||
help-unknown-cmd.h | ||
hisi-ptt.c | ||
hisi-ptt.h | ||
hist.c | ||
hist.h | ||
intel-bts.c | ||
intel-bts.h | ||
intel-pt.c | ||
intel-pt.h | ||
intlist.c | ||
intlist.h | ||
iostat.c | ||
iostat.h | ||
jit.h | ||
jitdump.c | ||
jitdump.h | ||
kvm-stat.h | ||
kwork.h | ||
levenshtein.c | ||
levenshtein.h | ||
llvm-utils.c | ||
llvm-utils.h | ||
lock-contention.h | ||
lzma.c | ||
machine.c | ||
machine.h | ||
map.c | ||
map.h | ||
map_symbol.h | ||
maps.c | ||
maps.h | ||
mem-events.c | ||
mem-events.h | ||
mem2node.c | ||
mem2node.h | ||
memswap.c | ||
memswap.h | ||
metricgroup.c | ||
metricgroup.h | ||
mmap.c | ||
mmap.h | ||
mutex.c | ||
mutex.h | ||
namespaces.c | ||
namespaces.h | ||
off_cpu.h | ||
ordered-events.c | ||
ordered-events.h | ||
parse-branch-options.c | ||
parse-branch-options.h | ||
parse-events-hybrid.c | ||
parse-events-hybrid.h | ||
parse-events.c | ||
parse-events.h | ||
parse-events.l | ||
parse-events.y | ||
parse-regs-options.c | ||
parse-regs-options.h | ||
parse-sublevel-options.c | ||
parse-sublevel-options.h | ||
path.c | ||
path.h | ||
perf-hooks-list.h | ||
perf-hooks.c | ||
perf-hooks.h | ||
PERF-VERSION-GEN | ||
perf_api_probe.c | ||
perf_api_probe.h | ||
perf_event_attr_fprintf.c | ||
perf_regs.c | ||
perf_regs.h | ||
pfm.c | ||
pfm.h | ||
pmu-hybrid.c | ||
pmu-hybrid.h | ||
pmu.c | ||
pmu.h | ||
pmu.l | ||
pmu.y | ||
pmus.c | ||
pmus.h | ||
print-events.c | ||
print-events.h | ||
print_binary.c | ||
print_binary.h | ||
probe-event.c | ||
probe-event.h | ||
probe-file.c | ||
probe-file.h | ||
probe-finder.c | ||
probe-finder.h | ||
pstack.c | ||
pstack.h | ||
python-ext-sources | ||
python.c | ||
rb_resort.h | ||
rblist.c | ||
rblist.h | ||
record.c | ||
record.h | ||
rlimit.c | ||
rlimit.h | ||
rwsem.c | ||
rwsem.h | ||
s390-cpumcf-kernel.h | ||
s390-cpumsf-kernel.h | ||
s390-cpumsf.c | ||
s390-cpumsf.h | ||
s390-sample-raw.c | ||
sample-raw.c | ||
sample-raw.h | ||
sample.h | ||
session.c | ||
session.h | ||
setns.c | ||
setup.py | ||
sideband_evlist.c | ||
smt.c | ||
smt.h | ||
sort.c | ||
sort.h | ||
spark.c | ||
spark.h | ||
srccode.c | ||
srccode.h | ||
srcline.c | ||
srcline.h | ||
stat-display.c | ||
stat-shadow.c | ||
stat.c | ||
stat.h | ||
strbuf.c | ||
strbuf.h | ||
stream.c | ||
stream.h | ||
strfilter.c | ||
strfilter.h | ||
string.c | ||
string2.h | ||
strlist.c | ||
strlist.h | ||
svghelper.c | ||
svghelper.h | ||
symbol-elf.c | ||
symbol-minimal.c | ||
symbol.c | ||
symbol.h | ||
symbol_conf.h | ||
symbol_fprintf.c | ||
symsrc.h | ||
synthetic-events.c | ||
synthetic-events.h | ||
syscalltbl.c | ||
syscalltbl.h | ||
target.c | ||
target.h | ||
term.c | ||
term.h | ||
thread-stack.c | ||
thread-stack.h | ||
thread.c | ||
thread.h | ||
thread_map.c | ||
thread_map.h | ||
time-utils.c | ||
time-utils.h | ||
tool.h | ||
top.c | ||
top.h | ||
topdown.c | ||
topdown.h | ||
trace-event-info.c | ||
trace-event-parse.c | ||
trace-event-read.c | ||
trace-event-scripting.c | ||
trace-event.c | ||
trace-event.h | ||
tracepoint.c | ||
tracepoint.h | ||
trigger.h | ||
tsc.c | ||
tsc.h | ||
units.c | ||
units.h | ||
unwind-libdw.c | ||
unwind-libdw.h | ||
unwind-libunwind-local.c | ||
unwind-libunwind.c | ||
unwind.h | ||
usage.c | ||
util.c | ||
util.h | ||
values.c | ||
values.h | ||
vdso.c | ||
vdso.h | ||
zlib.c | ||
zstd.c |