linux/tools/perf/util
Namhyung Kim 6235ce7774 perf record: Cache build-ID of hit DSOs only
It post-processes samples to find which DSO has samples.  Based on that
info, it can save used DSOs in the build-ID cache directory.  But for
some reason, it saves all DSOs without checking the hit mark.  Skipping
unused DSOs can give some speedup especially with --buildid-mmap being
default.

On my idle machine, `time perf record -a sleep 1` goes down from 3 sec
to 1.5 sec with this change.

Fixes: e29386c8f7 ("perf record: Add --buildid-mmap option to enable PERF_RECORD_MMAP2's build id")
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/20250731070330.57116-1-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2025-07-31 10:46:46 -07:00
..
arm-spe-decoder perf arm-spe: Add support for SPE Data Source packet on HiSilicon HIP12 2025-05-27 17:57:58 -03:00
bpf_skel perf ftrace latency: Add -e option to measure time between two events 2025-07-14 22:51:58 -07:00
cs-etm-decoder
hisi-ptt-decoder
include tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2025-06-16 14:05:11 -03:00
intel-pt-decoder
libunwind
perf-regs-arch
scripting-engines perf build-id: Change sprintf functions to snprintf 2025-07-25 10:37:13 -07:00
addr_location.c
addr_location.h
affinity.c perf test: Expand user space event reading (rdpmc) tests 2025-06-20 13:14:07 -07:00
affinity.h perf test: Expand user space event reading (rdpmc) tests 2025-06-20 13:14:07 -07:00
amd-sample-raw.c perf evlist: Change env variable to session 2025-07-25 10:37:56 -07:00
annotate-data.c
annotate-data.h
annotate.c perf annotate: Fix source code annotate with objdump 2025-06-26 15:15:48 -07:00
annotate.h perf annotate: Fix source code annotate with objdump 2025-06-26 15:15:48 -07:00
archinsn.h
arm-spe.c perf evlist: Change env variable to session 2025-07-25 10:37:56 -07:00
arm-spe.h
arm64-frame-pointer-unwind-support.c
arm64-frame-pointer-unwind-support.h
auxtrace.c perf auxtrace: Pass perf_env from session through to mmap read 2025-07-25 10:37:58 -07:00
auxtrace.h perf auxtrace: Pass perf_env from session through to mmap read 2025-07-25 10:37:58 -07:00
block-info.c
block-info.h
block-range.c
block-range.h
bpf-event.c perf env: Remove global perf_env 2025-07-25 10:37:58 -07:00
bpf-event.h perf record: collect BPF metadata from new programs 2025-06-20 14:48:49 -07:00
bpf-filter.c perf target: Remove uid from target 2025-06-09 11:18:18 -07:00
bpf-filter.h perf bpf-filter: Improve error messages 2025-06-09 11:18:17 -07:00
bpf-filter.l
bpf-filter.y
bpf-trace-summary.c perf trace: Support --summary-mode=cgroup 2025-05-13 18:20:46 -03:00
bpf-utils.c
bpf-utils.h
bpf_counter.c
bpf_counter.h
bpf_counter_cgroup.c
bpf_ftrace.c perf ftrace latency: Add -e option to measure time between two events 2025-07-14 22:51:58 -07:00
bpf_kwork.c
bpf_kwork_top.c
bpf_lock_contention.c perf lock contention: Add -J/--inject-delay option 2025-05-09 14:32:15 -03:00
bpf_map.c
bpf_map.h
bpf_off_cpu.c perf record --off-cpu: Add --off-cpu-thresh option 2025-05-05 21:51:54 -03:00
bpf_trace_augment.c perf trace: Split BPF skel code to util/bpf_trace_augment.c 2025-06-26 10:31:05 -07:00
branch.c perf session: Add accessor for session->header.env 2025-07-25 10:37:56 -07:00
branch.h
btf.c
btf.h
Build perf tp_pmu: Factor existing tracepoint logic to new file 2025-07-26 16:31:43 -07:00
build-id.c perf record: Cache build-ID of hit DSOs only 2025-07-31 10:46:46 -07:00
build-id.h perf build-id: Change sprintf functions to snprintf 2025-07-25 10:37:13 -07:00
cache.h
cacheline.c
cacheline.h
call-path.c
call-path.h
callchain.c
callchain.h
cap.c perf bpf-filter: Improve error messages 2025-06-09 11:18:17 -07:00
cap.h perf bpf-filter: Improve error messages 2025-06-09 11:18:17 -07:00
cgroup.c perf stat: Move metric list from config to evlist 2025-07-11 12:36:40 -07:00
cgroup.h perf stat: Move metric list from config to evlist 2025-07-11 12:36:40 -07:00
clockid.c
clockid.h
cloexec.c
cloexec.h
color.c
color.h
color_config.c
comm.c perf thread: Ensure comm_lock held for comm_list 2025-06-11 13:40:31 -07:00
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 perf session: Add accessor for session->header.env 2025-07-25 10:37:56 -07:00
data-convert-json.c perf session: Add accessor for session->header.env 2025-07-25 10:37:56 -07:00
data-convert.h
data.c
data.h
db-export.c perf script: perf script tests fails with segfault 2025-06-09 21:38:08 -07:00
db-export.h
debug.c perf machine: Explicitly pass in host perf_env 2025-07-25 10:37:57 -07:00
debug.h perf debug: Add function symbols to dump_stack 2025-06-25 10:59:19 -07:00
debuginfo.c perf build-id: Ensure struct build_id is empty before use 2025-07-25 10:37:55 -07:00
debuginfo.h
demangle-cxx.cpp
demangle-cxx.h perf symbol: Move demangling code out of symbol-elf.c 2025-05-28 19:02:58 -03:00
demangle-java.c
demangle-java.h
demangle-ocaml.c
demangle-ocaml.h
demangle-rust-v0.c perf demangle-rust: Add rustc-demangle C demangler 2025-05-09 17:00:05 -03:00
demangle-rust-v0.h perf demangle-rust: Add rustc-demangle C demangler 2025-05-09 17:00:05 -03:00
disasm.c perf build-id: Change sprintf functions to snprintf 2025-07-25 10:37:13 -07:00
disasm.h
disasm_bpf.c
disasm_bpf.h
dlfilter.c perf sample: Remove arch notion of sample parsing 2025-07-25 10:37:58 -07:00
dlfilter.h
drm_pmu.c perf drm_pmu: Fix spelling mistake "bufers" -> "buffers" 2025-06-30 09:10:50 -07:00
drm_pmu.h perf drm_pmu: Add a tool like PMU to expose DRM information 2025-06-25 11:12:35 -07:00
dso.c perf dso: Move build_id to dso_id 2025-07-25 10:37:56 -07:00
dso.h perf dso: Move build_id to dso_id 2025-07-25 10:37:56 -07:00
dsos.c perf dso: Move build_id to dso_id 2025-07-25 10:37:56 -07:00
dsos.h
dump-insn.c
dump-insn.h
dwarf-aux.c
dwarf-aux.h
dwarf-regs-csky.c
dwarf-regs-powerpc.c
dwarf-regs-x86.c
dwarf-regs.c
env.c perf env: Remove global perf_env 2025-07-25 10:37:58 -07:00
env.h perf env: Remove global perf_env 2025-07-25 10:37:58 -07:00
event.c perf build-id: Change sprintf functions to snprintf 2025-07-25 10:37:13 -07:00
event.h perf sort: Use perf_env to set arch sort keys and header 2025-07-25 10:37:58 -07:00
events_stats.h
evlist.c perf parse-events: Warn if a cpu term is unsupported by a CPU 2025-07-24 13:41:34 -07:00
evlist.h perf evlist: Change env variable to session 2025-07-25 10:37:56 -07:00
evsel.c perf tp_pmu: Factor existing tracepoint logic to new file 2025-07-26 16:31:43 -07:00
evsel.h perf evlist: Change env variable to session 2025-07-25 10:37:56 -07:00
evsel_config.h perf parse-events: Add "cpu" term to set the CPU an event is recorded on 2025-05-12 14:23:19 -03:00
evsel_fprintf.c
evsel_fprintf.h
evswitch.c
evswitch.h
expr.c perf tool_pmu: Allow num_cpus(_online) to be specific to a cpumask 2025-07-24 13:41:35 -07:00
expr.h
expr.l
expr.y
find-map.c
fncache.c perf fncache: Switch to using hashmap 2025-05-13 16:36:22 -03:00
fncache.h perf fncache: Switch to using hashmap 2025-05-13 16:36:22 -03:00
ftrace.h perf: ftrace: add graph tracer options args/retval/retval-hex/retaddr 2025-07-22 17:47:22 -07:00
genelf.c perf genelf: Fix NO_LIBDW=1 build 2025-07-02 19:01:54 -07:00
genelf.h
genelf_debug.c
generate-cmdlist.sh
get_current_dir_name.c
get_current_dir_name.h
hashmap.c
hashmap.h
header.c perf header: Clean up use of perf_env 2025-07-25 10:37:57 -07:00
header.h perf header: Allow tracing of attr events 2025-06-25 12:37:29 -07:00
help-unknown-cmd.c
help-unknown-cmd.h
hisi-ptt.c
hisi-ptt.h
hist.c perf sample: Remove arch notion of sample parsing 2025-07-25 10:37:58 -07:00
hist.h perf sample: Remove arch notion of sample parsing 2025-07-25 10:37:58 -07:00
hwmon_pmu.c perf hwmon_pmu: Avoid shortening hwmon PMU name 2025-07-11 12:36:39 -07:00
hwmon_pmu.h perf hwmon_pmu: Hold path rather than fd 2025-07-02 19:05:26 -07:00
intel-bts.c
intel-bts.h
intel-pt.c perf intel-pt: Fix PEBS-via-PT data_src 2025-05-12 14:18:09 -03:00
intel-pt.h
intel-tpebs.c perf sample: Remove arch notion of sample parsing 2025-07-25 10:37:58 -07:00
intel-tpebs.h perf stat: Add mean, min, max and last --tpebs-mode options 2025-04-25 12:31:36 -03:00
intlist.c
intlist.h
iostat.c
iostat.h
jit.h
jitdump.c perf jitdump: Directly mark the jitdump DSO 2025-07-25 10:37:56 -07:00
jitdump.h
kvm-stat.c
kvm-stat.h
kwork.h
levenshtein.c
levenshtein.h
llvm-c-helpers.cpp
llvm-c-helpers.h
lock-contention.c
lock-contention.h perf lock contention: Add -J/--inject-delay option 2025-05-09 14:32:15 -03:00
lzma.c
machine.c perf machine: Explicitly pass in host perf_env 2025-07-25 10:37:57 -07:00
machine.h perf machine: Explicitly pass in host perf_env 2025-07-25 10:37:57 -07:00
map.c perf dso: Move build_id to dso_id 2025-07-25 10:37:56 -07:00
map.h perf dso: Move build_id to dso_id 2025-07-25 10:37:56 -07:00
map_symbol.c
map_symbol.h
maps.c perf record: Fix a asan runtime error in util/maps.c 2025-05-16 17:31:40 -03:00
maps.h
mem-events.c perf mem: Count L2 HITM for c2c statistic 2025-05-27 18:05:28 -03:00
mem-events.h perf mem: Add 'dtlb' output field 2025-05-02 15:36:14 -03:00
mem-info.c
mem-info.h
mem2node.c
mem2node.h
memswap.c
memswap.h
metricgroup.c perf metricgroups: Add NO_THRESHOLD_AND_NMI constraint 2025-07-24 13:41:36 -07:00
metricgroup.h perf stat: Move metric list from config to evlist 2025-07-11 12:36:40 -07:00
mmap.c
mmap.h
mutex.c
mutex.h perf rwsem: Add clang's -Wthread-safety annotations 2025-05-21 15:07:13 -03:00
namespaces.c
namespaces.h
off_cpu.h perf record --off-cpu: Add --off-cpu-thresh option 2025-05-05 21:51:54 -03:00
ordered-events.c
ordered-events.h
parse-branch-options.c
parse-branch-options.h
parse-events.c perf tp_pmu: Factor existing tracepoint logic to new file 2025-07-26 16:31:43 -07:00
parse-events.h perf parse-events: Remove non-json software events 2025-07-26 16:31:43 -07:00
parse-events.l perf parse-events: Remove non-json software events 2025-07-26 16:31:43 -07:00
parse-events.y perf parse-events: Remove non-json software events 2025-07-26 16:31:43 -07:00
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 perf list: Skip ABI PMUs when printing pmu values 2025-07-26 16:31:43 -07:00
pfm.h
pmu.c perf tp_pmu: Add event APIs 2025-07-26 16:31:43 -07:00
pmu.h perf tools: move perf_pmus__find_core_pmu() prototype to pmus.h 2025-06-26 10:51:31 -07:00
pmu.l
pmu.y
pmus.c perf list: Skip ABI PMUs when printing pmu values 2025-07-26 16:31:43 -07:00
pmus.h perf pmus: Factor perf_pmus__find_by_attr out of evsel__find_pmu 2025-07-24 13:41:35 -07:00
print-events.c perf list: Skip ABI PMUs when printing pmu values 2025-07-26 16:31:43 -07:00
print-events.h perf list: Skip ABI PMUs when printing pmu values 2025-07-26 16:31:43 -07:00
print_binary.c
print_binary.h
print_insn.c
print_insn.h
probe-event.c perf machine: Explicitly pass in host perf_env 2025-07-25 10:37:57 -07:00
probe-event.h
probe-file.c perf build-id: Change sprintf functions to snprintf 2025-07-25 10:37:13 -07:00
probe-file.h
probe-finder.c perf build-id: Ensure struct build_id is empty before use 2025-07-25 10:37:55 -07:00
probe-finder.h
pstack.c
pstack.h
python.c perf python: Stop using deprecated PyUnicode_AsString() 2025-07-30 10:15:17 -07:00
rblist.c
rblist.h
record.c
record.h perf record --off-cpu: Add --off-cpu-thresh option 2025-05-05 21:51:54 -03:00
rlimit.c
rlimit.h
rwsem.c perf rwsem: Add clang's -Wthread-safety annotations 2025-05-21 15:07:13 -03:00
rwsem.h perf rwsem: Add clang's -Wthread-safety annotations 2025-05-21 15:07:13 -03:00
s390-cpumcf-kernel.h
s390-cpumsf-kernel.h
s390-cpumsf.c perf evlist: Change env variable to session 2025-07-25 10:37:56 -07:00
s390-cpumsf.h
s390-sample-raw.c
sample-raw.c perf evlist: Change env variable to session 2025-07-25 10:37:56 -07:00
sample-raw.h perf evlist: Change env variable to session 2025-07-25 10:37:56 -07:00
sample.c
sample.h perf sample: Remove arch notion of sample parsing 2025-07-25 10:37:58 -07:00
session.c perf sample: Remove arch notion of sample parsing 2025-07-25 10:37:58 -07:00
session.h perf session: Add host_env argument to perf_session__new 2025-07-25 10:37:57 -07:00
setns.c
setup.py
sha1.c perf util: add a basic SHA-1 implementation 2025-06-26 10:51:40 -07:00
sha1.h perf util: add a basic SHA-1 implementation 2025-06-26 10:51:40 -07:00
sharded_mutex.c
sharded_mutex.h
sideband_evlist.c
smt.c
smt.h
sort.c perf sort: Use perf_env to set arch sort keys and header 2025-07-25 10:37:58 -07:00
sort.h perf sort: Use perf_env to set arch sort keys and header 2025-07-25 10:37:58 -07:00
spark.c perf spark: Fix includes and add SPDX 2025-07-11 12:36:40 -07:00
spark.h perf spark: Fix includes and add SPDX 2025-07-11 12:36:40 -07:00
srccode.c perf fncache: Switch to using hashmap 2025-05-13 16:36:22 -03:00
srccode.h
srcline.c perf srcline: Lower verbosity on addr2line debug messages 2025-06-24 10:27:49 -07:00
srcline.h
stat-display.c perf stat: Move metric list from config to evlist 2025-07-11 12:36:40 -07:00
stat-shadow.c perf stat: Remove duplicated include in stat-shadow.c 2025-07-23 10:48:29 -07:00
stat.c perf parse-events: Support user CPUs mixed with threads/processes 2025-07-24 13:41:35 -07:00
stat.h perf stat: Move metric list from config to evlist 2025-07-11 12:36:40 -07:00
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 RISC-V Patches for the 6.16 Merge Window, Part 1 2025-06-06 18:05:18 -07:00
symbol-minimal.c perf build-id: Ensure struct build_id is empty before use 2025-07-25 10:37:55 -07:00
symbol.c perf build-id: Ensure struct build_id is empty before use 2025-07-25 10:37:55 -07:00
symbol.h
symbol_conf.h perf record: Make --buildid-mmap the default 2025-07-25 10:37:56 -07:00
symbol_fprintf.c
symsrc.h
synthetic-events.c perf sample: Remove arch notion of sample parsing 2025-07-25 10:37:58 -07:00
synthetic-events.h perf record: collect BPF metadata from new programs 2025-06-20 14:48:49 -07:00
syscalltbl.c
syscalltbl.h
target.c perf target: Remove uid from target 2025-06-09 11:18:18 -07:00
target.h perf target: Remove uid from target 2025-06-09 11:18:18 -07:00
term.c
term.h
thread-stack.c
thread-stack.h
thread.c perf thread: Ensure comm_lock held for comm_list 2025-06-11 13:40:31 -07:00
thread.h perf thread: Ensure comm_lock held for comm_list 2025-06-11 13:40:31 -07:00
thread_map.c perf thread_map: Remove uid options 2025-06-09 11:18:18 -07:00
thread_map.h perf thread_map: Remove uid options 2025-06-09 11:18:18 -07:00
threads.c
threads.h
time-utils.c
time-utils.h
tool.c perf session: Add accessor for session->header.env 2025-07-25 10:37:56 -07:00
tool.h perf tools: display the new PERF_RECORD_BPF_METADATA event 2025-06-20 14:48:56 -07:00
tool_pmu.c libperf evsel: Rename own_cpus to pmu_cpus 2025-07-24 13:41:35 -07:00
tool_pmu.h perf tool_pmu: Allow num_cpus(_online) to be specific to a cpumask 2025-07-24 13:41:35 -07:00
top.c perf top: Switch user option to use BPF filter 2025-06-09 11:18:18 -07:00
top.h perf top: Switch user option to use BPF filter 2025-06-09 11:18:18 -07:00
topdown.c
topdown.h
tp_pmu.c perf tp_pmu: Add event APIs 2025-07-26 16:31:43 -07:00
tp_pmu.h perf tp_pmu: Add event APIs 2025-07-26 16:31:43 -07:00
trace-event-info.c
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c
trace-event.c
trace-event.h
trace.h perf trace: Support --summary-mode=cgroup 2025-05-13 18:20:46 -03:00
trace_augment.h perf trace: Split BPF skel code to util/bpf_trace_augment.c 2025-06-26 10:31:05 -07:00
tracepoint.c
tracepoint.h
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c perf unwind-libdw: skip non-regular files 2025-06-24 10:27:50 -07:00
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