* [ltt-dev] [BUG] [PATCH] LTTV - interrupt handler time calculation is wrong in case of nested interrupts
@ 2008-10-10 4:37 Gaurav Singh
2008-10-15 14:03 ` Mathieu Desnoyers
0 siblings, 1 reply; 3+ messages in thread
From: Gaurav Singh @ 2008-10-10 4:37 UTC (permalink / 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ltt-dev] [BUG] [PATCH] LTTV - interrupt handler time calculation is wrong in case of nested interrupts
2008-10-10 4:37 [ltt-dev] [BUG] [PATCH] LTTV - interrupt handler time calculation is wrong in case of nested interrupts Gaurav Singh
@ 2008-10-15 14:03 ` Mathieu Desnoyers
2008-10-15 14:09 ` Mathieu Desnoyers
0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Desnoyers @ 2008-10-15 14:03 UTC (permalink / raw)
Hi Gaurav,
Your fix seems appropriate, I'll merge it.
Thanks !
Mathieu
* Gaurav Singh (gausinghnsit at gmail.com) wrote:
> 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
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ltt-dev] [BUG] [PATCH] LTTV - interrupt handler time calculation is wrong in case of nested interrupts
2008-10-15 14:03 ` Mathieu Desnoyers
@ 2008-10-15 14:09 ` Mathieu Desnoyers
0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2008-10-15 14:09 UTC (permalink / raw)
Integrated in lttv-0.11.2-15102008. Thanks !
Mathieu
* Mathieu Desnoyers (compudj at krystal.dyndns.org) wrote:
> Hi Gaurav,
>
> Your fix seems appropriate, I'll merge it.
>
> Thanks !
>
> Mathieu
>
> * Gaurav Singh (gausinghnsit at gmail.com) wrote:
> > 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
> >
>
> --
> Mathieu Desnoyers
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-15 14:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-10 4:37 [ltt-dev] [BUG] [PATCH] LTTV - interrupt handler time calculation is wrong in case of nested interrupts Gaurav Singh
2008-10-15 14:03 ` Mathieu Desnoyers
2008-10-15 14:09 ` Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox