]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: trace: Introduce trace events for sleepable tree lock
authorQu Wenruo <wqu@suse.com>
Mon, 15 Apr 2019 13:15:24 +0000 (21:15 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:43 +0000 (19:02 +0200)
commitb82651b4a4dfe5659a2472e2f6b9646aa23cd8c2
treefa697652fe3dc42fc3e4afceeb047355c8710e5e
parentf503bff4edd846ca375b3ce95aa46888e853c2a7
btrfs: trace: Introduce trace events for sleepable tree lock

There are two tree lock events which can sleep:
- btrfs_tree_read_lock()
- btrfs_tree_lock()

Sometimes we may need to look into the concurrency picture of the fs.
For that case, we need the execution time of above two functions and the
owner of @eb.

Here we introduce a trace events for user space tools like bcc, to get
the execution time of above two functions, and get detailed owner info
where eBPF code can't.

All the overhead is hidden behind the trace events, so if events are not
enabled, there is no overhead.

These trace events also output bytenr and generation, allow them to be
pared with unlock events to pin down deadlock.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/locking.c
include/trace/events/btrfs.h