Hi,
I'm trying to hack the linux kernel code to insert a function to help me analyze the running kernel. My problem is this: I have a function (prototype is
which dumps the necessary information as the kernel is running, but I don't know of a 'safe' place to put it - that is, somewhere where it will be called, but also where it won't be called to regularly (which would cause a lot of latency).
I'm fairly new at kernel hacking, and initially thought to insert the function in the scheduler - this way, I could be sure it would run, and would be fairly easy to impliment. However, on thinking this through, I realized this would be a bad idea due to latency issues (it would be always called, and would cause my computer to run really slowly).
I did some research on how the kernel is built, but I'm not sure of where a good place to put this is - please note I'm in physics, not software engineering, so I apologize in advance for any silly mistakes or questions.
To be very concise, I'm looking for the exact file (and maybe line number) where I could put this code in. Ideally, the file should be among the first called, but not so often that it would cause unbearable latency.
I would also appreciate any resources on this matter; I've looked at the kernel hacking guide, but, to be completely upfront, I haven't read it thoroughly enough to determine where I can best place my function, so I'm looking for some advice on how I should go about doing it.
Thank you and warm Regards,
Vmt1