Hi,
While fixing the bytes_may_use underflow after reverting c6887cd11149
("Btrfs: don't do nocow check unless we have to"), there is a new tool
to trace such problem.
Now btrfs-profiler has added a new script, space_underflow.py to detect
above problem.
Before trying this tool, there are some prerequisite for it:
- bcc (including python2 binding)
- Extra trace events for update_bytes_(may_use|pinned)
Can be found here:
https://patchwork.kernel.org/patch/10921241/
- Use CONFIG_UNWINDER_FRAME_POINTER as a workaround before v5.2
Due to bug in trace pointer stack, if using ORC unwinder, it will only
provide one single frame of the call stack.
This tool will use update_bytes_(may_use|pinned) trace events to record
all related events and calculate the underflow independently.
Also, if it detects an underflow, it will show the related events from
last good checkpoint (the watched number reach 0), with all its backtrace.
It also support tracing for multiple fs and multiple profiles.
This simple tool can be found in:
https://github.com/adam900710/btrfs-profiler/blob/master/space_underflow.py
Thanks,
Qu
Attachment:
signature.asc
Description: OpenPGP digital signature
