[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: logging data to a file.
On Fri, Nov 04, 2005 at 11:03:12AM -0800, Tim Bird wrote:
> Greg KH wrote:
> > If relayfs doesn't work for you (and I do agree that it does have some
> > odd attributes at times), then just use debugfs instead of procfs. You
> > can use your same seqfile interface, so it should be a very small change
> > to your code.
>
> Hmmm. I didn't know debugfs had similar APIs.
> I'll check this out pronto. Thanks!
Actually, it's a simpler api than procfs, or at least that was my goal.
You can create a file for simple data types with only one line of code.
It also handles complex stuff like seqfile and custom read/write
functions just as easily.
> > If you have any questions about debugfs, please let me know. It's quite
> > easy to just add a single line to /etc/fstab to always mount the thing,
> > so you can't use that as an excuse :)
>
> Many of the embedded boards I work with aren't set up
> to automatcially process /etc/fstab. But since it's still
> only a single line in some startup script, the point is taken.
> (It's rare that I'm missing 'mount', but it has happened.)
For those that don't know, here's the line you need to do to mount
debugfs in the proper place:
mount -t debugfs none /sys/kernel/debug
and if you want to add it to /etc/fstab, add this line:
none /sys/kernel/debug debugfs defaults 0 0
Both of these must run after sysfs is mounted at /sys, which usually
happens very early in the init process.
thanks,
greg k-h
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/