Re: procfs question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 6/19/06, Greg KH <greg@xxxxxxxxx> wrote:
On Mon, Jun 19, 2006 at 04:54:57PM +0200, Fernando Apestegu?a wrote:
> On 6/19/06, Greg KH <greg@xxxxxxxxx> wrote:
> >Use debugfs instead.  It's much easier to do this there.  If you really
> >want to, sysfs can be used also, but it depends on what you want to
> >provide in those files.
>
>
> Each file will provide three numbers. So I wouldn't like to duplicate code.
> Just write a single read_proc function and then perform the switch to know
> which three values should I return.

Same thing works for either debugfs or sysfs.

> I know about the existence of sysfs but not about debugfs. I would
> prefer to use procfs for other reasons (legacy code, in fact).

No new procfs files should be added to the kernel, so if you write stuff
for this, it will not be accepted by anyone upstream.

This is not intended to be merged in the kernel, it is only for academic purposes. I saw a chapter called "A single callback for many files" in the procfs guide at old.kernelnewbies.org. Do you strongly recommend sysfs anyway? And another follow up question: is procfs going to be removed or something similar? AFAIK there are several commands and applications that uses it.
But if I'm not wrong, FreeBSD removed procfs and changed applications that used it....

> However, could you point me to a good tutorial about sysfs and
> debugfs?

Have you looked at the in-kernel documentation for debugfs?  It is quite
complete.  And there are loads of in-kernel examples for how to use
sysfs.

Good luck,

greg k-h


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux