@@ -112,6 +112,7 @@ int btrfs_add_ordered_stripe(struct btrfs_io_context *bioc)
}
write_unlock(&fs_info->stripe_update_lock);
+ trace_btrfs_ordered_stripe_add(fs_info, stripe);
return 0;
}
@@ -127,6 +128,7 @@ struct btrfs_ordered_stripe *btrfs_lookup_ordered_stripe(struct btrfs_fs_info *f
if (node) {
stripe = rb_entry(node, struct btrfs_ordered_stripe, rb_node);
refcount_inc(&stripe->ref);
+ trace_btrfs_ordered_stripe_lookup(fs_info, stripe);
}
read_unlock(&fs_info->stripe_update_lock);
@@ -136,7 +138,7 @@ struct btrfs_ordered_stripe *btrfs_lookup_ordered_stripe(struct btrfs_fs_info *f
void btrfs_put_ordered_stripe(struct btrfs_fs_info *fs_info,
struct btrfs_ordered_stripe *stripe)
{
-
+ trace_btrfs_ordered_stripe_put(fs_info, stripe);
if (refcount_dec_and_test(&stripe->ref)) {
struct rb_node *node;
@@ -59,6 +59,7 @@
#include "verity.h"
#include "super.h"
#include "extent-tree.h"
+#include "raid-stripe-tree.h"
#define CREATE_TRACE_POINTS
#include <trace/events/btrfs.h>
@@ -33,6 +33,7 @@ struct btrfs_space_info;
struct btrfs_raid_bio;
struct raid56_bio_trace_info;
struct find_free_extent_ctl;
+struct btrfs_ordered_stripe;
#define show_ref_type(type) \
__print_symbolic(type, \
@@ -2492,6 +2493,55 @@ DEFINE_EVENT(btrfs_raid56_bio, raid56_scrub_read_recover,
TP_ARGS(rbio, bio, trace_info)
);
+DECLARE_EVENT_CLASS(btrfs__ordered_stripe,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_ordered_stripe *stripe),
+
+ TP_ARGS(fs_info, stripe),
+
+ TP_STRUCT__entry_btrfs(
+ __field( u64, logical )
+ __field( u64, num_bytes )
+ __field( int, num_stripes )
+ __field( int, ref )
+ ),
+
+ TP_fast_assign_btrfs(fs_info,
+ __entry->logical = stripe->logical;
+ __entry->num_bytes = stripe->num_bytes;
+ __entry->num_stripes = stripe->num_stripes;
+ __entry->ref = refcount_read(&stripe->ref);
+ ),
+
+ TP_printk_btrfs("logical=%llu, num_bytes=%llu, num_stripes=%d, ref=%d",
+ __entry->logical, __entry->num_bytes,
+ __entry->num_stripes, __entry->ref)
+);
+
+DEFINE_EVENT(btrfs__ordered_stripe, btrfs_ordered_stripe_add,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_ordered_stripe *stripe),
+
+ TP_ARGS(fs_info, stripe)
+);
+
+DEFINE_EVENT(btrfs__ordered_stripe, btrfs_ordered_stripe_lookup,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_ordered_stripe *stripe),
+
+ TP_ARGS(fs_info, stripe)
+);
+
+DEFINE_EVENT(btrfs__ordered_stripe, btrfs_ordered_stripe_put,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_ordered_stripe *stripe),
+
+ TP_ARGS(fs_info, stripe)
+);
#endif /* _TRACE_BTRFS_H */
/* This part must be outside protection */