Changes to the kernel module settings (using / sys / module)

I have some questions regarding /sys/module/Linux

  1. Does /sys/moduleall kernel modules contain

  2. Does /sys/module/xxx/parametersall xxxx kernel module parameters contain

  3. Does /sys/module/xxx/parameters/yyyythe yyyy parameter of the xxxx kernel module contain real-time values

  4. 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.

+5
source share
3 answers

1) , /sys/module .

2) , /sys/module/xxx/parameters , , , :

module_param(test, bool, 0600);

, "/sys/module/xxx/parameters/test".

3) , , .

4) .

+6

" ( ), , , , . , , , , , .

- , , , . ". [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

0
source

All Articles