Re: How to hook a context switch??

From: Gromer (osIndgy_at_gmail.com)
Date: 10/23/05

  • Next message: Dirk Craeynest: "FINAL CFP, Reliable Software Technologies, Ada-Europe 2006"
    Date: 23 Oct 2005 03:51:50 -0700
    
    

    Sorry the actual post was snipped off... below is pasted the actual
    one..

    Hi,

    I have one issue and would like to get some expert advise from the
    group. The below shown code snippet gives some idea about the scenario.
    I have basically one function (func_1) which does a wake_up after
    processing some information. Once the wake_up is executed the system
    crashes.

    So to debug this, i've put printks after the add_wait_queue() and
    schedule function to capture the functions that gets executed with a
    wake_up... but for no help.. Im unable to find the thread which gets
    executed after the wake_up.

    I'm wondering how to capture or debug which thread/function gets the
    CPU when this wake_up has been executed... Any pointer would be highly
    appreciable.

    How is such a situation usually debugged?? Can such a context switching
    be hooked..

    /* Wait on here when we're waiting device to be ready */
    wait_queue_head_t waitDev;

    void func_1( struct func_arg*)
    {

     /*..Do some useful work */

            wake_up(&waitDev); /* crash occurs here */

    }

    int sec_func (struct func_arg2 *)
    {

         /* some processing work done here */
                ....
                 ..
            set_current_state(TASK_UNINTERRUPTIBLE);
            add_wait_queue(&waitDev, &wait);
            spin_unlock(mutex);
            schedule();
            remove_wait_queue(&waitDev, &wait);
            spin_lock(chip->mutex);

          /* some more work is being done here */

    }

    Brendan wrote:
    > Hi,
    >
    > "Gromer" <osIndgy@gmail.com> wrote in message
    > news:1130052479.202415.126070@o13g2000cwo.googlegroups.com...
    > > Hi,
    > > Since i have'nt got any response for linux groups.. i'm posting it in
    > > this group.. Hopefully someone in this group can throw some light :)
    >
    > Considering that I'm reading this in alt.os.development, the first
    > thing I'd suggest is rewriting the entire OS to your liking. Starting
    > with a "hello world" kernel booted from GRUB seems to be a
    > popular way to begin. :-)
    >
    > On a more serious note, was there meant to be an attachment or
    > something? It's a little hard for anyone to debug code without
    > seeing it...
    >
    >
    > Cheers,
    >
    > Brendan


  • Next message: Dirk Craeynest: "FINAL CFP, Reliable Software Technologies, Ada-Europe 2006"

    Relevant Pages

    • Re: How to hook a context switch??
      ... The below shown code snippet gives some idea about the scenario. ... I'm wondering how to capture or debug which thread/function gets the ... Brendan wrote: ...
      (comp.os.linux.development.system)
    • Re: Help with If...
      ... > I'm trying to debug a program someone else wrote. ... This snippet doesn't ... My code in this post is copyright 2003, Chris F.A. Johnson ...
      (comp.unix.shell)
    • Re: Problem changing the size property in the Resize event
      ... The problem might be because you reset Size, ... you'll have to debug it to see. ... The following snippet should work as you expected: ... Prev by Date: ...
      (microsoft.public.dotnet.framework.windowsforms)
    • Help with If...
      ... I'm trying to debug a program someone else wrote. ... This snippet doesn't ... I always land in the else. ... but I wanted a second opinion since I'm ...
      (comp.unix.shell)