I have some questions regarding /sys/module/Linux
/sys/module/
Does /sys/moduleall kernel modules contain
/sys/module
Does /sys/module/xxx/parametersall xxxx kernel module parameters contain
/sys/module/xxx/parameters
Does /sys/module/xxx/parameters/yyyythe yyyy parameter of the xxxx kernel module contain real-time values
/sys/module/xxx/parameters/yyyy
if the parameter changes in this kernel module, how to detect this change in RealTime? I want to develop a C application (user space) or a shell script that detects a change in a kernel module parameter in real time.
- , . .
, /proc/sys. . : http://tournasdimitrios1.wordpress.com/2011/02/07/passing-parameters-to-the-kernel-at-run-time-time-on-linux/
1) , /sys/module .
2) , /sys/module/xxx/parameters , , , :
module_param(test, bool, 0600);
, "/sys/module/xxx/parameters/test".
3) , , .
4) .
" ( ), , , , . , , , , , .
- , , , . ". [1]
Basically, you will need a mechanism for constantly polling for changes, or you should simply develop an IOCtl approach and register your device as a char device at the same time that you register it, since (Linux is psychotic in this respect).
Brian Wilkatt "Linux is free if you don't value your time." - unknown
[1] https://www.linux.com/learn/linux-training/28065-the-kernel-newbie-corner-everything-you-wanted-to-know-about-module-parameters