kernel-hacking-2024-linux-s.../include/trace/events
Qu Wenruo 437490fed3 btrfs: tracepoints: output proper root owner for trace_find_free_extent()
The current trace event always output result like this:

 find_free_extent: root=2(EXTENT_TREE) len=16384 empty_size=0 flags=4(METADATA)
 find_free_extent: root=2(EXTENT_TREE) len=16384 empty_size=0 flags=4(METADATA)
 find_free_extent: root=2(EXTENT_TREE) len=8192 empty_size=0 flags=1(DATA)
 find_free_extent: root=2(EXTENT_TREE) len=8192 empty_size=0 flags=1(DATA)
 find_free_extent: root=2(EXTENT_TREE) len=4096 empty_size=0 flags=1(DATA)
 find_free_extent: root=2(EXTENT_TREE) len=4096 empty_size=0 flags=1(DATA)

T's saying we're allocating data extent for EXTENT tree, which is not
even possible.

It's because we always use EXTENT tree as the owner for
trace_find_free_extent() without using the @root from
btrfs_reserve_extent().

This patch will change the parameter to use proper @root for
trace_find_free_extent():

Now it looks much better:

 find_free_extent: root=5(FS_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
 find_free_extent: root=5(FS_TREE) len=8192 empty_size=0 flags=1(DATA)
 find_free_extent: root=5(FS_TREE) len=16384 empty_size=0 flags=1(DATA)
 find_free_extent: root=5(FS_TREE) len=4096 empty_size=0 flags=1(DATA)
 find_free_extent: root=5(FS_TREE) len=8192 empty_size=0 flags=1(DATA)
 find_free_extent: root=5(FS_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
 find_free_extent: root=7(CSUM_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
 find_free_extent: root=2(EXTENT_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
 find_free_extent: root=1(ROOT_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)

Reported-by: Hans van Kranenburg <hans@knorrie.org>
CC: stable@vger.kernel.org # 5.4+
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-10-07 12:06:49 +02:00
..
9p.h
afs.h afs: Add a tracepoint to track the lifetime of the afs_volume struct 2020-06-04 15:37:57 +01:00
alarmtimer.h
asoc.h
bcache.h
block.h blktrace: Provide event for request merging 2020-06-25 21:06:11 -06:00
bpf_test_run.h
bridge.h
btrfs.h btrfs: tracepoints: output proper root owner for trace_find_free_extent() 2020-10-07 12:06:49 +02:00
cachefiles.h
cgroup.h
clk.h
cma.h
compaction.h mm/page_alloc: integrate classzone_idx and high_zoneidx 2020-06-03 20:09:44 -07:00
context_tracking.h
cpuhp.h
devfreq.h
devlink.h
dma_fence.h
erofs.h
ext4.h ext4: limit the length of per-inode prealloc list 2020-08-19 12:04:36 -04:00
f2fs.h f2fs: support to trace f2fs_fiemap() 2020-07-07 21:51:46 -07:00
fib.h
fib6.h
filelock.h
filemap.h
fs_dax.h
fscache.h
fsi.h
fsi_master_aspeed.h
fsi_master_ast_cf.h
fsi_master_gpio.h
gpio.h
gpu_mem.h
host1x.h
hswadsp.h
huge_memory.h khugepaged: introduce 'max_ptes_shared' tunable 2020-06-03 20:09:46 -07:00
hwmon.h
i2c.h
ib_mad.h
ib_umad.h
initcall.h
intel-sst.h
intel_iommu.h
intel_ish.h
io_uring.h
iocost.h
iommu.h
ipi.h
irq.h
irq_matrix.h
iscsi.h
jbd2.h
kmem.h
kvm.h KVM: arm: Add trace name for ARM_NISV 2020-07-30 14:54:19 +01:00
kyber.h
libata.h
lock.h
mce.h
mdio.h
migrate.h mm/vmstat: add events for THP migration without split 2020-08-12 10:57:57 -07:00
mlxsw.h
mmap.h
mmc.h
mmflags.h Revert "powerpc/64s: Remove PROT_SAO support" 2020-08-24 14:12:53 +10:00
module.h
napi.h
nbd.h
neigh.h
net.h
net_probe_common.h
nilfs2.h
nmi.h
objagg.h
oom.h
page_isolation.h
page_pool.h
page_ref.h
pagemap.h
percpu.h
power.h
power_cpu_migrate.h
preemptirq.h
printk.h
pwc.h
pwm.h
qdisc.h
qla.h
qrtr.h
random.h random32: add a tracepoint for prandom_u32() 2020-08-13 15:11:14 -07:00
rcu.h Merge branches 'doc.2020.06.29a', 'fixes.2020.06.29a', 'kfree_rcu.2020.06.29a', 'rcu-tasks.2020.06.29a', 'scale.2020.06.29a', 'srcu.2020.06.29a' and 'torture.2020.06.29a' into HEAD 2020-06-29 12:03:15 -07:00
rdma.h
rdma_core.h
regulator.h
rpcgss.h SUNRPC: Augment server-side rpcgss tracepoints 2020-07-13 17:28:24 -04:00
rpcrdma.h svcrdma: Display chunk completion ID when posting a rw_ctxt 2020-07-13 17:28:24 -04:00
rpm.h
rseq.h
rtc.h
rxrpc.h rxrpc: Fix loss of RTT samples due to interposed ACK 2020-08-20 17:59:27 +01:00
sched.h trace/events/sched.h: fix duplicated word 2020-07-22 10:22:05 +02:00
scmi.h firmware: arm_scmi: Use signed integer to report transfer status 2020-06-30 14:07:08 +01:00
scsi.h
sctp.h
signal.h
siox.h
skb.h
smbus.h
sock.h
spi.h
spmi.h
sunrpc.h SUNRPC: Refresh the show_rqstp_flags() macro 2020-07-26 16:08:59 -04:00
sunvnet.h
swiotlb.h
syscalls.h
target.h
task.h
tcp.h
tegra_apb_dma.h
thermal.h
thermal_power_allocator.h
thp.h
timer.h
tlb.h
udp.h
ufs.h scsi: ufs: Add trace event for UIC commands 2020-06-15 23:35:06 -04:00
v4l2.h
vb2.h
vmscan.h mm/page_alloc: integrate classzone_idx and high_zoneidx 2020-06-03 20:09:44 -07:00
vsock_virtio_transport_common.h
wbt.h
workqueue.h
writeback.h writeback: Drop I_DIRTY_TIME_EXPIRE 2020-06-15 09:18:46 +02:00
xdp.h bpf: cpumap: Implement XDP_REDIRECT for eBPF programs attached to map entries 2020-07-16 17:00:32 +02:00
xen.h