]> 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)
commit0fc2fe5683798fdc09681e411bfe00acf7464b6d
treefa697652fe3dc42fc3e4afceeb047355c8710e5e
parent820be138d90b9b245b9c53d6a497435cb53b28c7
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