scoutfs: add btree walk trace point

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-05-27 10:37:02 -07:00
committed by Zach Brown
parent 2980edac53
commit 69e5f5ae5f
2 changed files with 40 additions and 0 deletions

View File

@@ -1252,6 +1252,9 @@ restart:
ref = &root->ref;
while(level-- > 0) {
trace_scoutfs_btree_walk(sb, root, key, flags, level, ref);
ret = get_ref_block(sb, alloc, wri, flags, ref, &bl);
if (ret)
break;

View File

@@ -1675,6 +1675,43 @@ TRACE_EVENT(scoutfs_btree_dirty_block,
__entry->bt_blkno, __entry->bt_seq)
);
TRACE_EVENT(scoutfs_btree_walk,
TP_PROTO(struct super_block *sb, struct scoutfs_btree_root *root,
struct scoutfs_key *key, int flags, int level,
struct scoutfs_btree_ref *ref),
TP_ARGS(sb, root, key, flags, level, ref),
TP_STRUCT__entry(
SCSB_TRACE_FIELDS
__field(__u64, root_blkno)
__field(__u64, root_seq)
__field(__u8, root_height)
sk_trace_define(key)
__field(int, flags)
__field(int, level)
__field(__u64, ref_blkno)
__field(__u64, ref_seq)
),
TP_fast_assign(
SCSB_TRACE_ASSIGN(sb);
__entry->root_blkno = le64_to_cpu(root->ref.blkno);
__entry->root_seq = le64_to_cpu(root->ref.seq);
__entry->root_height = root->height;
sk_trace_assign(key, key);
__entry->flags = flags;
__entry->level = level;
__entry->ref_blkno = le64_to_cpu(ref->blkno);
__entry->ref_seq = le64_to_cpu(ref->seq);
),
TP_printk(SCSBF" root blkno %llu seq %llu height %u key "SK_FMT" flags 0x%x level %d ref blkno %llu seq %llu",
SCSB_TRACE_ARGS, __entry->root_blkno, __entry->root_seq,
__entry->root_height, sk_trace_args(key), __entry->flags,
__entry->level, __entry->ref_blkno, __entry->ref_seq)
);
TRACE_EVENT(scoutfs_online_offline_blocks,
TP_PROTO(struct inode *inode, s64 on_delta, s64 off_delta,
u64 on_now, u64 off_now),