I am new to linux kernel programming.
Currently, I use debugfs to output the value of a kernel variable (say myKernelVariable) to a file, say, debugfs/myFile
What I want to do is this: I want to use a user-level program (prefer C, but python also works for me) that when the value of myKernelVariable in debugfs/myFile is changed, my user-level program will be notified.
A very inefficient way is that I can set up a timer in my user-level program and repeatedly check if the value in debugfs/myFile is changed.
Are there any trigger/notify - based lightweight methods to do this?
Thanks very much.