diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2018-01-05 22:51:16 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-26 16:09:38 +0300 |
commit | 393da91819e35af538ef97c7c6a04899e2fbfe0e (patch) | |
tree | 9a81e6d1a4aa4fb32a876098f0121f38bf726987 /include/trace | |
parent | 5d23515be66904fa3b1b5d6bd72d2199cd2447ab (diff) | |
download | linux-393da91819e35af538ef97c7c6a04899e2fbfe0e.tar.xz |
Btrfs: add tracepoint for em's EEXIST case
This is adding a tracepoint 'btrfs_handle_em_exist' to help debug the
subtle bugs around merge_extent_mapping.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/btrfs.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index c3ac5ec86519..486771e3f4cb 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -248,6 +248,41 @@ TRACE_EVENT_CONDITION(btrfs_get_extent, __entry->refs, __entry->compress_type) ); +TRACE_EVENT(btrfs_handle_em_exist, + + TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len), + + TP_ARGS(existing, map, start, len), + + TP_STRUCT__entry( + __field( u64, e_start ) + __field( u64, e_len ) + __field( u64, map_start ) + __field( u64, map_len ) + __field( u64, start ) + __field( u64, len ) + ), + + TP_fast_assign( + __entry->e_start = existing->start; + __entry->e_len = existing->len; + __entry->map_start = map->start; + __entry->map_len = map->len; + __entry->start = start; + __entry->len = len; + ), + + TP_printk("start=%llu len=%llu " + "existing(start=%llu len=%llu) " + "em(start=%llu len=%llu)", + (unsigned long long)__entry->start, + (unsigned long long)__entry->len, + (unsigned long long)__entry->e_start, + (unsigned long long)__entry->e_len, + (unsigned long long)__entry->map_start, + (unsigned long long)__entry->map_len) +); + /* file extent item */ DECLARE_EVENT_CLASS(btrfs__file_extent_item_regular, |