mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-09 12:10:09 +00:00
scoutfs: add coarse lock lifetime tracing
Add tracepoints for allocated lock structs entering the tree and finally being freed. This gives visibility into the lifetime of locks without using much higher frequency per-operation tracing that blow out other events. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -128,6 +128,7 @@ static void put_scoutfs_lock(struct super_block *sb, struct scoutfs_lock *lock)
|
||||
BUG_ON(!lock->refcnt);
|
||||
refs = --lock->refcnt;
|
||||
if (!refs) {
|
||||
trace_scoutfs_lock_free(sb, lock);
|
||||
rb_erase(&lock->node, &linfo->lock_tree);
|
||||
list_del(&lock->lru_entry);
|
||||
spin_unlock(&linfo->lock);
|
||||
@@ -312,6 +313,7 @@ search:
|
||||
new = NULL;
|
||||
found->refcnt = 1; /* Freed by shrinker or on umount */
|
||||
found->sequence = ++linfo->seq_cnt;
|
||||
trace_scoutfs_lock_rb_insert(sb, found);
|
||||
rb_link_node(&found->node, parent, node);
|
||||
rb_insert_color(&found->node, &linfo->lock_tree);
|
||||
scoutfs_inc_counter(sb, lock_alloc);
|
||||
|
||||
@@ -1662,6 +1662,16 @@ DEFINE_EVENT(scoutfs_lock_class, shrink_lock_tree,
|
||||
TP_ARGS(sb, lck)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(scoutfs_lock_class, scoutfs_lock_rb_insert,
|
||||
TP_PROTO(struct super_block *sb, struct scoutfs_lock *lck),
|
||||
TP_ARGS(sb, lck)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(scoutfs_lock_class, scoutfs_lock_free,
|
||||
TP_PROTO(struct super_block *sb, struct scoutfs_lock *lck),
|
||||
TP_ARGS(sb, lck)
|
||||
);
|
||||
|
||||
DECLARE_EVENT_CLASS(scoutfs_seg_class,
|
||||
TP_PROTO(struct scoutfs_segment *seg),
|
||||
TP_ARGS(seg),
|
||||
|
||||
Reference in New Issue
Block a user