1
0

ref_tracker: add a top level debugfs directory for ref_tracker

Add a new "ref_tracker" directory in debugfs. Each individual refcount
tracker can register files under there to display info about
currently-held references.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-2-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jeff Layton
2025-06-18 10:24:15 -04:00
committed by Jakub Kicinski
parent 7d02ba9663
commit e209f9193a

View File

@@ -273,3 +273,16 @@ int ref_tracker_free(struct ref_tracker_dir *dir,
return 0;
}
EXPORT_SYMBOL_GPL(ref_tracker_free);
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
static struct dentry *ref_tracker_debug_dir = (struct dentry *)-ENOENT;
static int __init ref_tracker_debugfs_init(void)
{
ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
return 0;
}
late_initcall(ref_tracker_debugfs_init);
#endif /* CONFIG_DEBUG_FS */