Need help in understanding sysfs
Greg KH
greg at kroah.com
Fri Aug 12 17:35:04 EDT 2011
On Fri, Aug 12, 2011 at 02:25:55PM -0700, Vaibhav Jain wrote:
> Thanks for ther reply!
> But I really need to create an entry in /sys/devices/system.
Why?
> I am working on a project on extending the cpu hotplug
> (/sys/devices/system/cpu) .
What specifically are you doing here? Are you working with the existing
CPU hotplug developers in the kernel? If not, why not?
> I went through the books LDD and LKD and got some understanding of sysfs but
> they are lacking samples. I thought of looking into the code that adds
> the entries inside /sys/devices/system/cpu but I am unable to find
> it.
Where did you look?
> Could you please suggest how should I go about finding the code ?
vim drivers/base/cpu.c
> I searched for it in google but did not hit anything significant.
I suggest you look into using grep or ack or cgvg or ctags or something
more relevant for doing source code searches.
But again, be _VERY_ careful about adding files to that location without
getting buy-in from the developers working in this area, as lots of
people seem to be writing code here and most of it is being rejected by
the maintainers due to it not doing things properly. See the recent
conversations on the linux-kernel mailing list about moving cpus to
"offline" mode for a good example of this.
good luck,
greg k-h
More information about the Kernelnewbies
mailing list