LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-31-2009, 06:54 PM   #1
NeoAnderson
Member
 
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
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,130

Rep: Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986
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
NeoAnderson
Member
 
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.
 
  


Reply

Tags
kernel


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:52 PM.

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