diff options
| author | Jeff Layton <[email protected]> | 2025-06-18 14:24:15 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-06-20 00:02:03 +0000 |
| commit | e209f9193a4724c1d4bc0b155c7beb78aa5d2928 (patch) | |
| tree | cf2e43817432169071fd0d3e5488f76d41dd1662 /lib/ref_tracker.c | |
| parent | ref_tracker: don't use %pK in pr_ostream() output (diff) | |
| download | kernel-e209f9193a4724c1d4bc0b155c7beb78aa5d2928.tar.gz kernel-e209f9193a4724c1d4bc0b155c7beb78aa5d2928.zip | |
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 <[email protected]>
Reviewed-by: Krzysztof Karas <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'lib/ref_tracker.c')
| -rw-r--r-- | lib/ref_tracker.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c index de71439e12a3..d374e5273e14 100644 --- a/lib/ref_tracker.c +++ b/lib/ref_tracker.c @@ -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 */ |
