• Qu Wenruo's avatar
    btrfs: trace: Introduce trace events for sleepable tree lock · 34e73cc9
    Qu Wenruo authored
    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: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    34e73cc9
locking.c 9.52 KB