How to measure time of ISR - Linux

This is a discussion on How to measure time of ISR - Linux ; Greetings, Could anybody, let me know how can I measure the time elapsed for the execution of perticular ISR. I mean I want to calculate Interrupt Response Time. Can I do that? I mean, does it make sense? I am ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: How to measure time of ISR

  1. How to measure time of ISR

    Greetings,

    Could anybody, let me know how can I measure the time elapsed for the
    execution of perticular ISR.

    I mean I want to calculate Interrupt Response Time. Can I do that? I
    mean, does it make sense?

    I am curious.

    Please shed your thoughts. Thanks in anticipation.


    Thanks,

    Mozis.


  2. Re: How to measure time of ISR

    On 7 Sep 2006 15:07:56 -0700, Mozis wrote:

    > Could anybody, let me know how can I measure the time elapsed for the
    > execution of perticular ISR.


    If this is a level-triggered interrupt, you can just put a scope on the
    IRQ line and measure the width of the pulse. That'll be the time from
    when it is asserted to the time when the handler clears it.

    If it is edge triggered, then you can do a similar thing by adding a
    test point to your hardware that goes high on assertion and low on
    clear.


    --
    -| Bob Hauck
    -| A proud member of the unhinged moonbat horde.
    -| http://www.haucks.org/

  3. Re: How to measure time of ISR

    Mozis wrote in part:
    > Could anybody, let me know how can I measure the time
    > elapsed for the execution of perticular ISR.


    Add RDTSC instructions in the ISR, or before after.
    A simple example is my `clockwatcher` pgm which measures
    system overhead:


    #include
    #include
    #include

    main () {
    unsigned long i, c, t ;
    for (i = 0; i < 1000; i++ ) {
    c = t = 0 ;
    rdtscl(t);
    do {
    c = t ;
    rdtscl(t);
    } while ((t-c) < 90) ;
    printf(" %u\n",(t-c+32)&-64);
    }
    }


    -- Robert



+ Reply to Thread