From: gausinghnsit@gmail.com (Gaurav Singh)
Subject: [ltt-dev] [BUG] [PATCH] LTTV - interrupt handler time calculation is wrong in case of nested interrupts
Date: Fri, 10 Oct 2008 10:07:23 +0530 [thread overview]
Message-ID: <3cc7a0df0810092137m3bebb6e0r97b29a7e5d685075@mail.gmail.com> (raw)
Hi all,
I was using the interrupt handler plugin and noticed that sometimes
the timer interrupt handler was taking a lot of time. Specifically
the max time indicated by the plugin was wrong. This was because the
time calculated by the plugin in case of nested interrupts is wrong.
Nested interrupt:
Interrupt 1 (entry) .... 1
Interrupt 2(entry).....2
Interrupt 2 (exit) ..... 3
Interrupt 3 (exit) ..... 4
The plugin did the following calculation:
Time for 1st interrupt = timeat (3) - timeat (1)
Time for 2nd interrupt = timeat (4) - timeat (2)
The following patch corrects this anamoly. Basically it takes the up
the most recent interrupt and pairs the irq_exit with it. Please check
if this works for you.
diff -uprN lttv-0.10.0-pre11-10032008/lttv/modules/gui/interrupts/interrupts.c
../lttv-0.10.0-pre11-10032008/lttv/modules/gui/interrupts/interrupts.c
--- lttv-0.10.0-pre11-10032008/lttv/modules/gui/interrupts/interrupts.c
2007-10-16 06:44:40.000000000 +0530
+++ ../lttv-0.10.0-pre11-10032008/lttv/modules/gui/interrupts/interrupts.c
2008-09-29 15:13:02.000000000 +0530
@@ -583,7 +583,7 @@ static void CalculateData(LttTime time_e
LttTime duration;
GArray *FirstRequestIrqExit = event_data->FirstRequestIrqExit;
GArray *FirstRequestIrqEntry = event_data->FirstRequestIrqEntry;
- for(i = 0; i < FirstRequestIrqEntry->len; i++)
+ for(i = FirstRequestIrqEntry->len-1; i >=0; i--)
{
element = &g_array_index(FirstRequestIrqEntry,irq_entry,i);
if(element->cpu_id == cpu_id)
Regards,
Gaurav
next reply other threads:[~2008-10-10 4:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-10 4:37 Gaurav Singh [this message]
2008-10-15 14:03 ` Mathieu Desnoyers
2008-10-15 14:09 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3cc7a0df0810092137m3bebb6e0r97b29a7e5d685075@mail.gmail.com \
--to=gausinghnsit@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox