linux/include/trace
Leo Martins cc970d21c4 btrfs: add tracepoint for search slot restart tracking
Add a btrfs_search_slot_restart tracepoint that fires at each restart
site in btrfs_search_slot(), recording the root, tree level, and
reason for the restart. This enables tracking search slot restarts
which contribute to COW amplification under memory pressure.

The four restart reasons are:
 - write_lock: insufficient write lock level, need to restart with
   higher lock
 - setup_nodes: node setup returned -EAGAIN
 - slot_zero: insertion at slot 0 requires higher write lock level
 - read_block: read_block_for_search returned -EAGAIN (block not
   cached or lock contention)

COW counts are already tracked by the existing trace_btrfs_cow_block()
tracepoint. The per-restart-site tracepoint avoids counter overhead
in the critical path when tracepoints are disabled, and provides
richer per-event information that bpftrace scripts can aggregate into
counts, histograms, and per-root breakdowns.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Leo Martins <loemra.dev@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2026-04-07 18:56:00 +02:00
..
events btrfs: add tracepoint for search slot restart tracking 2026-04-07 18:56:00 +02:00
misc NFSD: Remove NFSERR_EAGAIN 2026-01-02 13:43:41 -05:00
stages tracing: Add bitmask-list option for human-readable bitmask display 2026-01-26 17:00:50 -05:00
bpf_probe.h tracepoint: Have tracepoints created with DECLARE_TRACE() have _tp suffix 2025-05-14 11:19:32 -04:00
define_custom_trace.h
define_trace.h tracepoint: Have tracepoints created with DECLARE_TRACE() have _tp suffix 2025-05-14 11:19:32 -04:00
perf.h tracing: perf: Have perf tracepoint callbacks always disable preemption 2026-01-30 10:43:35 -05:00
syscall.h tracing: Display some syscall arrays as strings 2025-10-28 20:10:58 -04:00
trace_custom_events.h
trace_events.h tracing: Guard __DECLARE_TRACE() use of __DO_TRACE_CALL() with SRCU-fast 2026-01-30 10:44:11 -05:00