I made a c program to load a module and create a /proc file that will show the number of seconds since the module has been loaded. (Theoretically, at this point)
I want to test my code to see if it's right, but I don't know when to start counting to time it.
Do I start counting as soon as I 'make' until the time I cat /proc/file or..
Do I start counting as soon as I 'sudo insmod file.ko' until the time I cat /proc/file?
Door number 2 please Bob.
> Do I start counting as soon as I 'sudo insmod file.ko' until the time I cat /proc/file?
Your code is only 'aware' of its existence from the moment the OS calls the init function of your module. It's at that point you record your first instance of 'now' time, so you can calculate a 'since' whenever asked in the future.