Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Search this Thread
Old 03-31-2009, 06:54 PM   #1
Registered: May 2002
Location: Providence, RI
Distribution: Ubuntu
Posts: 78

Rep: Reputation: 15
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.
Old 03-31-2009, 07:27 PM   #2
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,927

Rep: Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199Reputation: 1199
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' ...
Old 03-31-2009, 09:23 PM   #3
Registered: May 2002
Location: Providence, RI
Distribution: Ubuntu
Posts: 78

Original Poster
Rep: Reputation: 15
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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kprobe hnshashi Linux - Software 2 11-19-2008 11:29 PM
kprobe - What is probed instruction hnshashi Linux - Newbie 0 11-18-2008 01:13 AM
Warning: at kernel/exit.c:814 do exit() (Tainted: P ) <- nVidia video problem? Hitboxx Fedora 2 10-06-2007 09:47 PM
Kprobe Equivalent nukeu666 Linux - Software 0 10-29-2005 11:45 PM
Kprobe and Dprobe Igor007 Programming 0 09-22-2005 10:25 AM

All times are GMT -5. The time now is 08:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration