LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   kprobe exit point (https://www.linuxquestions.org/questions/programming-9/kprobe-exit-point-715908/)

NeoAnderson 03-31-2009 06:54 PM

kprobe exit point
 
I'm trying to write a small kernel module to monitor page fault events of a certain process. I'm currently using a kprobe to insert the monitoring code into the page fault handler in the kernel. So the entry point of the probe is at the beginning of handle_mm_fault() kernel function. Then I want the probe to exit at the point the fault is handled. However, I'm not sure where the exit point should be, therefore I can't figure the correct exit offset for the probe. I've read the article on IBM DeveloperWorks, it talks about how to calculate the offset, but it doesn't say anything about why that exit point was picked. Any hint on how I should pick the exit point? Thanks.

syg00 03-31-2009 07:27 PM

Is this educational (i.e. you *want* to write a kernel module), or diagnostic ?.
If the latter, maybe have a look at systemtap instead - there's even an example for page faults. Won't help if you're trying to learn module programming tho' ...

NeoAnderson 03-31-2009 09:23 PM

Thanks, syg00. That helps to get a working example. But I'm still curious on how to pick the exit point for kprobe, since I want to learn module programming.


All times are GMT -5. The time now is 06:04 PM.