diff --git a/testsuite/module-playground/mod-simple.c b/testsuite/module-playground/mod-simple.c index cb38580..503e4d8 100644 --- a/testsuite/module-playground/mod-simple.c +++ b/testsuite/module-playground/mod-simple.c @@ -1,16 +1,32 @@ +#include #include #include +static struct dentry *debugfs_dir; + +static int test_show(struct seq_file *s, void *data) +{ + seq_puts(s, "test"); + return 0; +} + +DEFINE_SHOW_ATTRIBUTE(test); + static int __init test_module_init(void) { + debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); + debugfs_create_file("test", 0444, debugfs_dir, NULL, &test_fops); + return 0; } static void test_module_exit(void) { + debugfs_remove_recursive(debugfs_dir); } + module_init(test_module_init); module_exit(test_module_exit); MODULE_AUTHOR("Lucas De Marchi "); -MODULE_LICENSE("LGPL"); +MODULE_LICENSE("GPL");