Find the answer to your Linux question:
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.
  1. #1
    Just 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?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,558
    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!

  3. #3
    Just 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 ?

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,558
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •