Skip to contentSkip to conversation

debugfs in the namespace

DISCUSSION Pete Zaitcev 14 participants 26 messages Dec 16, 2004 – Dec 18, 2004

lore
Share & tools
lore
#0 lore raw

Hi Greg,

what is the canonic place to mount debugfs: /debug, /debugfs, or anything else? The reason I'm asking is that USBMon has to find it somewhere and I'd really hate to see it varying from distro to distro.

Thanks,
-- Pete

#1 lore raw
Quoted 5 lines · Pete Zaitcev

Hi Greg,

what is the canonic place to mount debugfs: /debug, /debugfs, or anything else? The reason I'm asking is that USBMon has to find it somewhere and I'd really hate to see it varying from distro to distro.

Hm, in my testing I've been putting it in /dbg, but I don't like vowels :)

Anyway, I don't really know. /dev/debug/ ? /proc/debug ? /debug ?

What do people want? I guess it's time to write up a LSB proposal :(

thanks,

greg k-h

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 3 lines · Pete Zaitcev

what is the canonic place to mount debugfs: /debug, /debugfs, or anything else? The reason I'm asking is that USBMon has to find it somewhere and I'd really hate to see it varying from distro to distro.

Hm, in my testing I've been putting it in /dbg, but I don't like vowels :)

Oh, that's right: usr and creat. How could I forget.

Quoted 3 lines

Anyway, I don't really know. /dev/debug/ ? /proc/debug ? /debug ?

What do people want? I guess it's time to write up a LSB proposal :(

I use /debug but it's not too late to change. Fedora does not ship it yet, so I don't think we have an institutional opinion about it.

Personally, I'm against the doubles to prevent issues with the mounting order on boot, but that's rather weak. The /dev can be specially managed and I'm concerned with people running find(1) on it. The /proc sounds better, but mounting anything under /proc requires a kernel component to create a directory, does it not?

[root@lembas root]# mount -t debugfs any /proc/debug
mount: mount point /proc/debug does not exist
[root@lembas root]# mkdir /proc/debug
mkdir: cannot create directory `/proc/debug': No such file or directory [root@lembas root]#

-- Pete

#3 lore raw
Quoted 15 lines · Pete Zaitcev
Quoted 6 lines · Greg KH
Quoted 3 lines · Pete Zaitcev

what is the canonic place to mount debugfs: /debug, /debugfs, or anything else? The reason I'm asking is that USBMon has to find it somewhere and I'd really hate to see it varying from distro to distro.

Hm, in my testing I've been putting it in /dbg, but I don't like vowels :)

Oh, that's right: usr and creat. How could I forget.

Quoted 3 lines

Anyway, I don't really know. /dev/debug/ ? /proc/debug ? /debug ?

What do people want? I guess it's time to write up a LSB proposal :(

Quoted 8 lines

I use /debug but it's not too late to change. Fedora does not ship it yet, so I don't think we have an institutional opinion about it.

Personally, I'm against the doubles to prevent issues with the mounting order on boot, but that's rather weak. The /dev can be specially managed and I'm concerned with people running find(1) on it. The /proc sounds better, but mounting anything under /proc requires a kernel component to create a directory, does it not?

Yes it does, but debugfs could create the mount point, if people agree that this is a good place to put it (like usbfs does.)

Personally, I don't want to put it there, but that's just because I hate proc stuff :)

So, /debug sounds good to me. Any objections?

thanks,

greg k-h

#4 lore raw

Hi!

Quoted 10 lines
Quoted 2 lines

better, but mounting anything under /proc requires a kernel component to create a directory, does it not?

Yes it does, but debugfs could create the mount point, if people agree that this is a good place to put it (like usbfs does.)

Personally, I don't want to put it there, but that's just because I hate proc stuff :)

So, /debug sounds good to me. Any objections?

Yes... /debug is something users may actually use already... Like having scratch filesystem mount on /debug.

Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#5 lore raw
Quoted 5 lines · Pavel Machek
Quoted 2 lines

So, /debug sounds good to me. Any objections?

Yes... /debug is something users may actually use already... Like having scratch filesystem mount on /debug.

Wouldn't it be possible to parse /proc/mounts and determine the correct mount point that way?

DEBUGFS = grep debugfs /proc/mounts | cut -f2 -d' '

Jörn

Signature · 2 lines
Premature optimization is the root of all evil.
-- Donald Knuth
#6 lore raw
In reply to Pete Zaitcev
Quoted 6 lines
Quoted 2 lines

Anyway, I don't really know. /dev/debug/ ? /proc/debug ? /debug ? What do people want? I guess it's time to write up a LSB proposal :(

The /proc sounds
better, but mounting anything under /proc requires a kernel component to create a directory, does it not?

And in case you debug procfs itself, you usually should not or even can't mount it into /proc, e.g. /proc is currently being initialised, but debugfs values already spit out.

/.debugfs/ as my choice, to not pollute/fill the root directory that much :)

Jan Engelhardt

Signature · 1 line
ENOSPC
#7 lore raw
In reply to Greg KH

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Greg KH
Quoted 5 lines · Pete Zaitcev

Hi Greg,

what is the canonic place to mount debugfs: /debug, /debugfs, or anything else? The reason I'm asking is that USBMon has to find it somewhere and I'd really hate to see it varying from distro to distro.

Quoted 6 lines

Hm, in my testing I've been putting it in /dbg, but I don't like vowels :)

Anyway, I don't really know. /dev/debug/ ? /proc/debug ? /debug ?

What do people want? I guess it's time to write up a LSB proposal :(

I thought debugfs was meant for just debugging. As there is no plans for standardizing its namespace, why are we allowing ourselves to rely on it being mounted at all?

AFAICT, there should be no excuse for userspace to actually rely on any of the data within debugfs. Otherwise we end up with yet another filesystem whose role is: Chaotic hodgepodge of magic files created by drivers that couldn't bother to be well-organized.

Please, let's not make debugfs part of userspace. Keep it for what it is, debugging purposes only.

- --
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The opinions expressed in this email are held by me, and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBwgNWdQs4kOxk3/MRAslqAJwPnra30/EBuZxuXkdpo67SZJXJUQCaAtC1 OeMH0Xiww/8xV9tIfqyzmE4=
=Aa8I
-----END PGP SIGNATURE-----

#8 lore raw
Quoted 11 lines · Mike Waychison

I thought debugfs was meant for just debugging. As there is no plans for standardizing its namespace, why are we allowing ourselves to rely on it being mounted at all?

AFAICT, there should be no excuse for userspace to actually rely on any of the data within debugfs. Otherwise we end up with yet another filesystem whose role is: Chaotic hodgepodge of magic files created by drivers that couldn't bother to be well-organized.

Please, let's not make debugfs part of userspace. Keep it for what it is, debugging purposes only.

I'm not saying we will ever make it "required" at all. It's just that people are going to want to mount the thing, and are already asking me where we should mount it at. If you pick a different place than me, fine, I don't mind. It's the user who is asked to report some info that happens to be in debugfs that is going to want to know where to put it, as they have no idea even what it is. Distros are going to ask what to put in their fstabs for where to mount the thing too.

So, let's pick a place and be done with it.

I like /dbg (3 characters total to get to, which is shorter than /debug which takes at least 4, 3 chars and a tab). Pete likes /debug. Jan Engelhardt want to hide the thing from people at /.debugfs.

Hm, what about /.debug ? That's a compromise that I can live with (even less key strokes to get to...)

Or is their some restriction on putting hidden directories in the root filesystem as specified by the LSB?

So, /.debug sound acceptable?

thanks,

greg k-h

#9 lore raw
Quoted 2 lines · Greg KH

Hm, what about /.debug ? That's a compromise that I can live with (even less key strokes to get to...)

No way, Jan is out of his mind, adding obfuscations like that. Anything but that. I didn't even bother to reply, because it never occurred to me that you'd fall for something so retarded.

Otherwise, /dbg sounds good.

Mike's objections sound philosophically congenial to me. What I'm trying to have here is to support an equivalent of tcpdump, which some may consider a core function rather than a debugging function. Of course, I could easily say "this is for debugging only" and thus deflect Mike, but this is not about winning, and actually I have no investment in any approach. For me the /sys is obviously out because of the "one file one value" doctrine. The /proc sounds attractive, but programming procfs is such a bother. If we had a debugfs style API to procfs, that would be the winner from the standpoint of this application. Failing that, I guess, it's /dbg.

-- Pete

#10 lore raw
Quoted 8 lines · Pete Zaitcev
Quoted 2 lines · Greg KH

Hm, what about /.debug ? That's a compromise that I can live with (even less key strokes to get to...)

No way, Jan is out of his mind, adding obfuscations like that. Anything but that. I didn't even bother to reply, because it never occurred to me that you'd fall for something so retarded.

Bah, fine :)

Quoted 1 line

Otherwise, /dbg sounds good.

Ok, I can live with that.

Quoted 9 lines

Mike's objections sound philosophically congenial to me. What I'm trying to have here is to support an equivalent of tcpdump, which some may consider a core function rather than a debugging function. Of course, I could easily say "this is for debugging only" and thus deflect Mike, but this is not about winning, and actually I have no investment in any approach. For me the /sys is obviously out because of the "one file one value" doctrine. The /proc sounds attractive, but programming procfs is such a bother. If we had a debugfs style API to procfs, that would be the winner from the standpoint of this application. Failing that, I guess, it's /dbg.

Yes, usb data dumping could go in /dbg, it makes sense.

thanks,

greg k-h

#11 lore raw
Quoted 10 lines · Greg KH
Quoted 8 lines · Pete Zaitcev
Quoted 2 lines · Greg KH

Hm, what about /.debug ? That's a compromise that I can live with (even less key strokes to get to...)

No way, Jan is out of his mind, adding obfuscations like that. Anything but that. I didn't even bother to reply, because it never occurred to me that you'd fall for something so retarded.

Quoted 5 lines

Bah, fine :)

Quoted 1 line

Otherwise, /dbg sounds good.

Ok, I can live with that.

I agree that anything like /.* is broken and strange... But this is only my little opinion. :-)

But why creating dir in /proc - like /proc/debug is bad? Its advantages:
- it does not pollute namespace,
- it can be created by kernel at startup even on systems where debugfs will not be used (why not?),
- /proc is mounted in all configurations and often it is the first thing that startscripts do,
- if somebody really needs to debug proc using debugfs he can always mount it as /debug temporaily.

Thanks,

Grzegorz Kulewski

#12 lore raw
Quoted 21 lines · Grzegorz Kulewski
Quoted 10 lines · Greg KH
Quoted 8 lines · Pete Zaitcev
Quoted 2 lines · Greg KH

Hm, what about /.debug ? That's a compromise that I can live with (even less key strokes to get to...)

No way, Jan is out of his mind, adding obfuscations like that. Anything but that. I didn't even bother to reply, because it never occurred to me that you'd fall for something so retarded.

Quoted 5 lines

Bah, fine :)

Quoted 1 line

Otherwise, /dbg sounds good.

Ok, I can live with that.

I agree that anything like /.* is broken and strange... But this is only my little opinion. :-)

Quoted 8 lines

But why creating dir in /proc - like /proc/debug is bad? Its advantages:
- it does not pollute namespace,
- it can be created by kernel at startup even on systems where debugfs will not be used (why not?),
- /proc is mounted in all configurations and often it is the first thing that startscripts do,
- if somebody really needs to debug proc using debugfs he can always mount it as /debug temporaily.

Disadvantage:
- it puts a non-process type thing into /proc which is what I am specifically trying to get away from doing.

Only process related things _should_ be in /proc. Now if I can ever fully achieve that goal in my lifetime is something that is left to be seen...

thanks,

greg k-h

#13 lore raw
Quoted 7 lines · Greg KH

Disadvantage:
- it puts a non-process type thing into /proc which is what I am specifically trying to get away from doing.

Only process related things _should_ be in /proc. Now if I can ever fully achieve that goal in my lifetime is something that is left to be seen...

Ok, probably - but who said this? IIRC there is no standard describing what should be in proc and what should not. I do not think that after so many years of storing everyting in /proc there is any chance that you will remove all not [0-9]* dirs and files from /proc before the sun will stop lighting... :-) Many, really _many_, binary only apps are using proc for 999999 different (often stupid) things - how you will change that? There is way too late for such change, in my opinion.

And polluting / with proc, sys, dev, selinux, debug and who knows what else is at least equally bad.

Thanks,

Grzegorz Kulewski

#14 lore raw
Quoted 10 lines · Grzegorz Kulewski
Quoted 7 lines · Greg KH

Disadvantage:
- it puts a non-process type thing into /proc which is what I am specifically trying to get away from doing.

Only process related things _should_ be in /proc. Now if I can ever fully achieve that goal in my lifetime is something that is left to be seen...

Ok, probably - but who said this?

Well, if you can't find it written down anymore, here, I'll give you a quote:
"/proc should only be for process related things."
- Greg Kroah-Hartman, December 16, 2004

Quoted 2 lines

IIRC there is no standard describing what should be in proc and what should not.

We have one now, see above :)

Quoted 3 lines

I do not think that after so many years of storing everyting in /proc there is any chance that you will remove all not [0-9]* dirs and files from /proc before the sun will stop lighting... :-)

Hey, everyone needs a windmill to chase after to define their life's purpose...

Quoted 2 lines

Many, really _many_, binary only apps are using proc for 999999 different (often stupid) things

Yes, I'm well aware of the /proc/cpu abusing that is done by many binary programs (oracle, jvm, etc.) But it's the other things that definitely don't belong in there (like the /proc/drivers/ tree stuff) that should get moved out over time. What do you think I've been doing over the past 3 years with sysfs...

Quoted 2 lines

- how you will change that? There is way too late for such change, in my opinion.

Slowly, over time, with creating good, standardised things like sysfs (which has order to it), and fun, anarchistic things like debugfs. Between the combination of the two, we'll get closer to an ideal, which is better than what we have today.

Quoted 2 lines

And polluting / with proc, sys, dev, selinux, debug and who knows what else is at least equally bad.

Why? Each location is defined to have one, specific, well defined thing there that people can count on (or not count on in the case of /debug.)

thanks,

greg k-h

#15 lore raw
Quoted 17 lines · Greg KH
Quoted 10 lines · Grzegorz Kulewski
Quoted 7 lines · Greg KH

Disadvantage:
- it puts a non-process type thing into /proc which is what I am specifically trying to get away from doing.

Only process related things _should_ be in /proc. Now if I can ever fully achieve that goal in my lifetime is something that is left to be seen...

Ok, probably - but who said this?

Well, if you can't find it written down anymore, here, I'll give you a quote:
"/proc should only be for process related things."
- Greg Kroah-Hartman, December 16, 2004

Quoted 4 lines
Quoted 2 lines

IIRC there is no standard describing what should be in proc and what should not.

We have one now, see above :)

Thanks, I needed that! :)

Quoted 6 lines
Quoted 3 lines

I do not think that after so many years of storing everyting in /proc there is any chance that you will remove all not [0-9]* dirs and files from /proc before the sun will stop lighting... :-)

Hey, everyone needs a windmill to chase after to define their life's purpose...

Ok, you are kernel and Gentoo developer - you are right by definition. :)

Quoted 5 lines
Quoted 2 lines

And polluting / with proc, sys, dev, selinux, debug and who knows what else is at least equally bad.

Why? Each location is defined to have one, specific, well defined thing there that people can count on (or not count on in the case of /debug.)

Because in short time we will end with / occupying >1 page of console - and it will be bad in my opinion. Besides do we really need that many fses - each for exporting kernel data to userspace? This is at least strange. Why can not /dev, /selinux be merged into /sys (ok, maybe there should be symlinks in /dev to devices in right device directory in /sys). Why debugfs can not live in /sys - for example in /sys/debug? What is wrong with one value per file and debugfs?

And I have also other question: Where can I find some info about using /sys (in kernel) and some small note about its implementation and overhead (cpu and memory)?

Thanks,

Grzegorz Kulewski

#16 lore raw
Quoted 9 lines · Grzegorz Kulewski
Quoted 5 lines
Quoted 2 lines

And polluting / with proc, sys, dev, selinux, debug and who knows what else is at least equally bad.

Why? Each location is defined to have one, specific, well defined thing there that people can count on (or not count on in the case of /debug.)

Because in short time we will end with / occupying >1 page of console - and it will be bad in my opinion. Besides do we really need that many fses - each for exporting kernel data to userspace?

Yes, we do.

Quoted 3 lines

This is at least strange. Why can not /dev, /selinux be merged into /sys (ok, maybe there should be symlinks in /dev to devices in right device directory in /sys).

Because all three of them are radically different things.

Quoted 2 lines

And I have also other question: Where can I find some info about using /sys (in kernel)

Documentation/driver-model/* is a good start. It's a bit out of date, but better than nothing. The lwn.net series of articles is also good to look at.

Quoted 2 lines

and some small note about its implementation and overhead (cpu and memory)?

For that you will have to look at the code itself.

Good luck,

greg k-h

#17 lore raw
In reply to Grzegorz Kulewski
Quoted 1 line

But why creating dir in /proc - like /proc/debug is bad? Its advantages:

Like I said, /proc would need to be mounted first -- which is probably not the case right away when you boot with "-b" or "init=/bin/bash"

Jan Engelhardt

Signature · 1 line
ENOSPC
#18 lore raw
In reply to Pete Zaitcev
Quoted 1 line · In article <[email protected]> you wrote:

No way, Jan is out of his mind, adding obfuscations like that.

...

Quoted 1 line

Otherwise, /dbg sounds good.

I dont think that a root level directory, especially with an unreadable name is a good idea. Why dont we at least try to keep the namespace clean?

Greetings
Bernd

#19 lore raw
Quoted 5 lines · Bernd Eckenfels
Quoted 1 line · In article <[email protected]> you wrote:

Otherwise, /dbg sounds good.

I dont think that a root level directory, especially with an unreadable name is a good idea. Why dont we at least try to keep the namespace clean?

Are you suggesting we should rename "etc", "mnt" etc? :-) I like "/dbg" it follows the gdb, kgdb naming convention and it was the Unix way to name things like this. Though perhaps debugfs should have been named dbgfs in this case...

I don't like "/.debug", hiding it in way this implies that you don't think it should be there (and so you've hidden it). A properly decided upon mount point shouldn't have these connotations? If you're using debugfs I think you should want to have the mount point visible.

Phillip

#20 lore raw
In reply to Greg KH
Quoted 8 lines

So, let's pick a place and be done with it.

I like /dbg (3 characters total to get to, which is shorter than /debug which takes at least 4, 3 chars and a tab). Pete likes /debug. Jan Engelhardt want to hide the thing from people at /.debugfs.

Hm, what about /.debug ? That's a compromise that I can live with (even less key strokes to get to...)

Anything is acceptable at least if my dot is there :)

Quoted 1 line

So, /.debug sound acceptable?

No objections.

Quoted 1 line

Jan Engelhardt

Signature · 1 line
ENOSPC
#21 lore raw

Re: debugfs in the namespace [u]

In reply to Greg KH
Quoted 27 lines · Greg KH
Quoted 11 lines · Mike Waychison

I thought debugfs was meant for just debugging. As there is no plans for standardizing its namespace, why are we allowing ourselves to rely on it being mounted at all?

AFAICT, there should be no excuse for userspace to actually rely on any of the data within debugfs. Otherwise we end up with yet another filesystem whose role is: Chaotic hodgepodge of magic files created by drivers that couldn't bother to be well-organized.

Please, let's not make debugfs part of userspace. Keep it for what it is, debugging purposes only.

I'm not saying we will ever make it "required" at all. It's just that people are going to want to mount the thing, and are already asking me where we should mount it at. If you pick a different place than me, fine, I don't mind. It's the user who is asked to report some info that happens to be in debugfs that is going to want to know where to put it, as they have no idea even what it is. Distros are going to ask what to put in their fstabs for where to mount the thing too.

So, let's pick a place and be done with it.

I like /dbg (3 characters total to get to, which is shorter than /debug which takes at least 4, 3 chars and a tab). Pete likes /debug. Jan Engelhardt want to hide the thing from people at /.debugfs.

Quoted 8 lines

Hm, what about /.debug ? That's a compromise that I can live with (even less key strokes to get to...)

Or is their some restriction on putting hidden directories in the root filesystem as specified by the LSB?

So, /.debug sound acceptable?

Prob silly, but what about /sys/dbg ? Out of sight ...

Signature · 1 line
Martin Schlemmer
#22 lore raw
In reply to Greg KH
Quoted 4 lines · Greg KH
Quoted 2 lines · Pete Zaitcev

Hi Greg,

Quoted 8 lines
Quoted 3 lines

what is the canonic place to mount debugfs: /debug, /debugfs, or anything else? The reason I'm asking is that USBMon has to find it somewhere and I'd really hate to see it varying from distro to distro.

Hm, in my testing I've been putting it in /dbg, but I don't like vowels :)

Anyway, I don't really know. /dev/debug/ ? /proc/debug ? /debug ?

well, since there is already a /sys, /proc... /debug wouldn't be that bad. perhaps the /.debug is better to keep it simple and away from people's eyes.

regards,
pedro venda.

Signature · 9 lines
Pedro João Lopes Venda
email: [email protected]
http://maxwell.rnl.ist.utl.pt

Equipa de Administração de Sistemas
Rede das Novas Licenciaturas (RNL)
Instituto Superior Técnico
http://www.rnl.ist.utl.pt
http://mega.ist.utl.pt
#23 lore raw
In reply to Greg KH
Quoted 7 lines · Greg KH
Quoted 5 lines · Pete Zaitcev

Hi Greg,

what is the canonic place to mount debugfs: /debug, /debugfs, or anything else? The reason I'm asking is that USBMon has to find it somewhere and I'd really hate to see it varying from distro to distro.

Quoted 5 lines

Hm, in my testing I've been putting it in /dbg, but I don't like vowels :)

Anyway, I don't really know. /dev/debug/ ? /proc/debug ? /debug ?

What do people want? I guess it's time to write up a LSB proposal :(

What I'd like is to _not_ have a standard, so that no one is tempted to depend on it being there. No one but developers should mount it by default and no standard tools should depend on it for functionality.

If you put it in a standard place, people will start treating it as ABI and then a year down the road we will have _three_ /proc-style ABI barf-bags rather than just one.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#24 lore raw
In reply to Pete Zaitcev
Followup to:  <[email protected]>
By author:    Pete Zaitcev <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 10 lines

Hi Greg,

what is the canonic place to mount debugfs: /debug, /debugfs, or anything else? The reason I'm asking is that USBMon has to find it somewhere and I'd really hate to see it varying from distro to distro.

Thanks,
-- Pete

/dev is the normal place where stuff related to the user/kernel interface should go, so /dev/debug or /dev/debugfs would be the right answer (and yes, /proc and /sys violate this, but we're stuck with those.)

-hpa

#25 lore raw
Quoted 4 lines · H. Peter Anvin

/dev is the normal place where stuff related to the user/kernel interface should go, so /dev/debug or /dev/debugfs would be the right answer (and yes, /proc and /sys violate this, but we're stuck with those.)

There is also /dev/oprofile/ as recent 2.6 precedent for this.

john