Results 1 to 4 of 4
I am needing to identify whether a user process was ever preempted somehow, I understand we have hooks in preempt.h and sched.c which allow us to define preempt_notifiers which can ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-14-2012 #1Just Joined!
- Join Date
- Aug 2012
- Posts
- 4
attach preempt_notifier to user process in linux
I am needing to identify whether a user process was ever preempted somehow, I understand we have hooks in preempt.h and sched.c which allow us to define preempt_notifiers which can in turn call sched_in and sched_out functions whenever a process is rescheduled or preempted.
But I still can't find out how can I attach a notifier to a particular process or pid in user space and then somehow log if this particular process was ever pre-empted. I'm assuming I have to write a module to do so, but how would I go about attaching a pid to a particular notifier?
- 08-19-2012 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,148
And why do you need to do this? Is this a critical process that cannot/should not be preempted?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 08-24-2012 #3Just Joined!
- Join Date
- Aug 2012
- Posts
- 4
I am doing this for a Project i am working on right now , I did figure out on how to call this function .
see - stackoverflow.com/questions/11939104/attach-preempt-notifier-to-user-process-in-linux/12115450#12115450]attach preempt_notifier to user process in linux
But I am currently stuck with an issue with system freeze when the function is actually calling the notifier , I believe i am somehow corrupting the scheduler , any ideas on how to debug this ?
- 08-25-2012 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,148
Have you installed the debug kernel and associated sources? Also, there is the kernel debugger kdb which you need to install. Here is a link that may help: KDB - eLinux.org
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
