RE: [PATCH v4] trace,x86: add x86 irq vector tracepoints

From: Seiji Aguchi
Date: Thu Sep 27 2012 - 18:34:05 EST


Hi,

> ... except the cost can be reduced to zero *AND* be made into a more general mechanism by simply hooking the IDT.

Thank you for giving me the comment.
In my understanding, we can introduce a more general mechanism by sandwiching an existing handler between tracepoints.
The pseudo code is like this:

@@ -17,7 +18,7 @@ static void default_threshold_interrupt(void)

void (*mce_threshold_vector)(void) = default_threshold_interrupt;

-asmlinkage void smp_threshold_interrupt(void)
+static void do_smp_threshold_interrupt(void)
{
irq_enter();
exit_idle();
@@ -27,3 +28,10 @@ asmlinkage void smp_threshold_interrupt(void)
/* Ack only at the end to avoid potential reentry */
ack_APIC_irq();
}
+
+asmlinkage void smp_threshold_interrupt(void) {
+ trace_arch_irq_vector_entry(THRESHOLD_APIC_VECTOR);
+ do_smp_threshold_interrupt();
+ trace_arch_irq_vector_exit(THRESHOLD_APIC_VECTOR);
+}

If I misunderstand something, please let me know.

Seiji
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—