@@ -12,6 +12,8 @@
#define REF_TRACKER_STACK_ENTRIES 16
#define STACK_BUF_SIZE 1024
+static struct dentry *ref_tracker_debug_dir = (struct dentry *)-ENOENT;
+
struct ref_tracker {
struct list_head head; /* anchor into dir->list or dir->quarantine */
bool dead;
@@ -273,3 +275,17 @@ 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 int __init ref_tracker_debugfs_init(void)
+{
+ ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
+ if (IS_ERR(ref_tracker_debug_dir))
+ pr_warn("ref_tracker: unable to create debugfs ref_tracker directory: %pe\n",
+ ref_tracker_debug_dir);
+ return 0;
+}
+late_initcall(ref_tracker_debugfs_init);
+#endif /* CONFIG_DEBUG_FS */