Imagine for a moment, the quandary faced by you, a driver developer, on Linux: you want to implement an easy yet elegant way to provide debug "hooks" from your driver to the user space. For example, the user simply performing a cat(1)Â on a (pseudo) file should result in your driver's "debug callback" function being invoked. It will then proceed to dump some status information (perhaps a "driver context" structure) to the user mode process, which will faithfully dump it to stdout.
Okay, no problem: in the days before the 2.6 release, we could (as you learned in the Interfacing via the proc filesystem (procfs)Â section) happily use the procfs layer to interface our driver with the user space. Then, from 2.6 Linux onward, the kernel community vetoed this approach. We were told to strictly stop using procfs and instead use the sysfs layer as the means to interface our drivers with the user space. However...