A kernel module I created is constantly generating information that I would like to store within the kernel and be readable from root. I was thinking of storing the information in some sort of log file with specific permissions, but I read that writing to files within the kernel space code is not good.
What is a good way to store information in the kernel that is fast and accessible by root?
~Thanks
If it’s constantly generating new information, I would write it out with
printk(). This way it will be seen bydmesgas well be written out to/var/log/kern.log.Although, this is not for sensitive information, since
dmesgcould be used by any user.Depending on the type of information, you can also provide it via
/procor/sysfiles,netlink,relayfs,/dev ioctl.