diff --git a/kmod/src/btree.c b/kmod/src/btree.c index 006eacd3..1ba1c132 100644 --- a/kmod/src/btree.c +++ b/kmod/src/btree.c @@ -754,6 +754,12 @@ retry: if (le64_to_cpu(bring->next_block) == le64_to_cpu(bring->nr_blocks)) bring->next_block = 0; + trace_scoutfs_btree_dirty_block(sb, blkno, seq, + le64_to_cpu(bring->next_block), le64_to_cpu(bring->next_seq), + bti->cur_dirtied, bti->old_dirtied, + bt ? le64_to_cpu(bt->hdr.blkno) : 0, + bt ? le64_to_cpu(bt->hdr.seq) : 0); + /* force advancing if migration's done and we didn't just wrap */ if (all_roots_migrated(super) && !first_block_in_half(bring) && scoutfs_trigger(sb, BTREE_ADVANCE_RING_HALF)) diff --git a/kmod/src/scoutfs_trace.h b/kmod/src/scoutfs_trace.h index 08d4572b..a9c6cfe3 100644 --- a/kmod/src/scoutfs_trace.h +++ b/kmod/src/scoutfs_trace.h @@ -2258,6 +2258,44 @@ TRACE_EVENT(scoutfs_btree_read_error, __entry->fsid, __entry->blkno, __entry->seq) ); +TRACE_EVENT(scoutfs_btree_dirty_block, + TP_PROTO(struct super_block *sb, u64 blkno, u64 seq, u64 next_block, + u64 next_seq, unsigned long cur_dirtied, + unsigned long old_dirtied, u64 bt_blkno, u64 bt_seq), + + TP_ARGS(sb, blkno, seq, next_block, next_seq, cur_dirtied, old_dirtied, + bt_blkno, bt_seq), + + TP_STRUCT__entry( + __field(__u64, fsid) + __field(__u64, blkno) + __field(__u64, seq) + __field(__u64, next_block) + __field(__u64, next_seq) + __field(unsigned long, cur_dirtied) + __field(unsigned long, old_dirtied) + __field(__u64, bt_blkno) + __field(__u64, bt_seq) + ), + + TP_fast_assign( + __entry->fsid = FSID_ARG(sb); + __entry->blkno = blkno; + __entry->seq = seq; + __entry->next_block = next_block; + __entry->next_seq = next_seq; + __entry->cur_dirtied = cur_dirtied; + __entry->old_dirtied = old_dirtied; + __entry->bt_blkno = bt_blkno; + __entry->bt_seq = bt_seq; + ), + + TP_printk("fsid "FSID_FMT" blkno %llu seq %llu next_block %llu next_seq %llu cur_dirtied %lu old_dirtied %lu bt_blkno %llu bt_seq %llu", + __entry->fsid, __entry->blkno, __entry->seq, + __entry->next_block, __entry->next_seq, __entry->cur_dirtied, + __entry->old_dirtied, __entry->bt_blkno, __entry->bt_seq) +); + DECLARE_EVENT_CLASS(scoutfs_extent_class, TP_PROTO(struct super_block *sb, struct scoutfs_extent *ext),