Re: My vision of usbmon

From: Greg KH
Date: Wed Dec 22 2004 - 01:45:56 EST

On Wed, Dec 22, 2004 at 12:34:06AM -0500, Jeff Garzik wrote:
> Greg KH wrote:
> >On Wed, Dec 22, 2004 at 12:38:54PM +1100, Nick Piggin wrote:
> >>Is there any reason why these debug filesystems are going under the
> >>root directory? Why not /sys/debug or /sys/kernel/debug or something?
> >
> >
> >See the previous thread as to where to mount debugfs. In short, I don't
> >really care :)
> Well, somebody should pick a single location, and try to use that
> consistently. Sure the sysadmin can change it, but a "preferred
> default" is always nice.

Bah, fine, make me make a policy decision, damm I tried hard to resist :)

Anyway, here's a patch I just applied that creates the /sys/kernel/debug
directory (you need a small patch that exports the proper subsys for
this to work, if anyone wants that too, I'll send it.) Now, if you
want, you can mount debugfs at this location.

Now either this is going to make people happy, or make them mad I didn't
pick their proposed location. Either way, I'm going on vacation in 2
days, so I will not be around to hear the screams...


greg k-h

debugfs: add /sys/kernel/debug mount point for people to mount debugfs on.

Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>

diff -Nru a/fs/debugfs/inode.c b/fs/debugfs/inode.c
--- a/fs/debugfs/inode.c 2004-12-21 22:40:00 -08:00
+++ b/fs/debugfs/inode.c 2004-12-21 22:40:00 -08:00
@@ -298,15 +298,28 @@

+static decl_subsys(debug, NULL, NULL);
static int __init debugfs_init(void)
- return register_filesystem(&debug_fs_type);
+ int retval;
+ kset_set_kset_s(&debug_subsys, kernel_subsys);
+ retval = subsystem_register(&debug_subsys);
+ if (retval)
+ return retval;
+ retval = register_filesystem(&debug_fs_type);
+ if (retval)
+ subsystem_unregister(&debug_subsys);
+ return retval;

static void __exit debugfs_exit(void)
simple_release_fs(&debugfs_mount, &debugfs_mount_count);
+ subsystem_unregister(&debug_subsys);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at