arch, x86, irq: enable tracing of irq_move_cleanup_interrupt vector
Subsystems (2)
PATCH 1/1 arch, x86, irq: enable tracing of irq_move_cleanup_interrupt vector
In commit cf910e83ae23 ("x86, trace: Add irq vector tracepoints"), support for the tracing of IRQ vectors had been introduced.
For no apparent reason, irq_move_cleanup_interrupt had been left out from the list of traceable interrupt vectors, rendering it incomplete.
Introduce support for tracing irq_move_cleanup_interrupt in the same way as done for the other vectors.
Namely,
- define a tracepoint event by means of DEFINE_IRQ_VECTOR_EVENT(),
- add a tracing capable handler smp_trace_irq_move_cleanup_interrupt(),
- introduce tracing versions of the IDT-referenced stubs which call into the tracing version of the handler on both, x86 and x86_64,
- finally, factor out the "real" interrupt handling code into the new __smp_irq_move_cleanup_interrupt().
---
Patch is against tip x86/core.
Fully tested on x86_64, compiled on i386.
I do have analogue patches for the
kvm_posted_intr_ipi
kvm_posted_intr_wakeup_ipi
vectors as well. Due to lack of hardware, I'm unable to test them though. If anybody with (/sys/module/kvm_intel/parameters/enable_apicv='Y') is willing to help out, I'll gladly post them, too.
arch/x86/entry/entry_64.S | 2 +- arch/x86/include/asm/entry_arch.h | 3 +-- arch/x86/include/asm/hw_irq.h | 2 +- arch/x86/include/asm/trace/irq_vectors.h | 6 ++++++ arch/x86/kernel/apic/vector.c | 19 ++++++++++++++++--- 5 files changed, 25 insertions(+), 7 deletions(-)
arch/x86/entry/entry_64.S +1 -1
@@ -771,7 +771,7 @@ trace_apicinterrupt \num \sym .endm #ifdef CONFIG_SMP -apicinterrupt3 IRQ_MOVE_CLEANUP_VECTOR irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt +apicinterrupt IRQ_MOVE_CLEANUP_VECTOR irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt apicinterrupt3 REBOOT_VECTOR reboot_interrupt smp_reboot_interrupt #endif
arch/x86/include/asm/entry_arch.h +1 -2
@@ -13,8 +13,7 @@ BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR) -BUILD_INTERRUPT3 (irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR , - smp_irq_move_cleanup_interrupt) +BUILD_INTERRUPT(irq_move_cleanup_interrupt, IRQ_MOVE_CLEANUP_VECTOR) BUILD_INTERRUPT3(reboot_interrupt, REBOOT_VECTOR, smp_reboot_interrupt)#endif
arch/x86/include/asm/hw_irq.h +1 -1
@@ -58,7 +58,7 @@ extern void trace_threshold_interrupt(void);extern void trace_deferred_error_interrupt (void );extern void trace_call_function_interrupt (void );extern void trace_call_function_single_interrupt (void ); -#define trace_irq_move_cleanup_interrupt irq_move_cleanup_interrupt +extern void trace_irq_move_cleanup_interrupt (void );#define trace_reboot_interrupt reboot_interrupt#define trace_kvm_posted_intr_ipi kvm_posted_intr_ipi#define trace_kvm_posted_intr_wakeup_ipi kvm_posted_intr_wakeup_ipi
arch/x86/include/asm/trace/irq_vectors.h +6 -0
@@ -112,6 +112,12 @@ DEFINE_IRQ_VECTOR_EVENT(deferred_error_apic);*/ DEFINE_IRQ_VECTOR_EVENT (thermal_apic); +/* +* irq_move_cleanup - called when entering/exiting an IRQ move cleanup +* vector handler. +*/ +DEFINE_IRQ_VECTOR_EVENT (irq_move_cleanup); +#undef TRACE_INCLUDE_PATH#define TRACE_INCLUDE_PATH .#define TRACE_INCLUDE_FILE irq_vectors
arch/x86/kernel/apic/vector.c +16 -3
@@ -20,6 +20,7 @@#include <asm/i8259.h> #include <asm/desc.h> #include <asm/irq_remapping.h> +#include <asm/trace/irq_vectors.h> struct apic_chip_data {struct irq_cfg cfg;
@@ -532,12 +533,10 @@ void send_cleanup_vector(struct irq_cfg *cfg)__send_cleanup_vector (data); } -asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) +static void __smp_irq_move_cleanup_interrupt (void ) {unsigned vector, me; -entering_ack_irq (); - me =smp_processor_id ();for (vector =FIRST_EXTERNAL_VECTOR ; vector <NR_VECTORS ; vector++) {int irq;
@@ -587,7 +586,21 @@ asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) unlock:raw_spin_unlock (&desc->lock); } +} + +asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) +{ +entering_ack_irq (); +__smp_irq_move_cleanup_interrupt (); +exiting_irq (); +} +asmlinkage __visible void smp_trace_irq_move_cleanup_interrupt(void) +{ +entering_ack_irq (); +trace_irq_move_cleanup_entry (IRQ_MOVE_CLEANUP_VECTOR ); +__smp_irq_move_cleanup_interrupt (); +trace_irq_move_cleanup_exit (IRQ_MOVE_CLEANUP_VECTOR );exiting_irq (); }
Signature · 1 line
2.7.0
Please ignore this, I messed up the CC.
I will resend. Sorry for the noise!
Quoted 141 lines · Nicolai Stange
In commit
cf910e83ae23("x86, trace: Add irq vector tracepoints"), support for the tracing of IRQ vectors had been introduced.For no apparent reason,
irq_move_cleanup_interrupthad been left out from the list of traceable interrupt vectors, rendering it incomplete.Introduce support for tracing
irq_move_cleanup_interruptin the same way as done for the other vectors.Namely,
- define a tracepoint event by means ofDEFINE_IRQ_VECTOR_EVENT(),
- add a tracing capable handlersmp_trace_irq_move_cleanup_interrupt(),
- introduce tracing versions of the IDT-referenced stubs which call into the tracing version of the handler on both, x86 andx86_64,
- finally, factor out the "real" interrupt handling code into the new__smp_irq_move_cleanup_interrupt().Signed-off-by Nicolai Stange <[email protected]>---
Patch is against tip x86/core.Fully tested on
x86_64, compiled on i386.I do have analogue patches for the
kvm_posted_intr_ipi
kvm_posted_intr_wakeup_ipi
vectors as well. Due to lack of hardware, I'm unable to test them though. If anybody with (/sys/module/kvm_intel/parameters/enable_apicv='Y') is willing to help out, I'll gladly post them, too.arch/x86/entry/entry_64.S | 2 +- arch/x86/include/asm/entry_arch.h | 3 +-- arch/x86/include/asm/hw_irq.h | 2 +- arch/x86/include/asm/trace/irq_vectors.h | 6 ++++++ arch/x86/kernel/apic/vector.c | 19 ++++++++++++++++--- 5 files changed, 25 insertions(+), 7 deletions(-)arch/x86/entry/entry_64.S +1
-1@@ -771,7 +771,7 @@ trace_apicinterrupt \num \sym .endm #ifdef CONFIG_SMP -apicinterrupt3 IRQ_MOVE_CLEANUP_VECTOR irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt +apicinterrupt IRQ_MOVE_CLEANUP_VECTOR irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt apicinterrupt3 REBOOT_VECTOR reboot_interrupt smp_reboot_interrupt #endifarch/x86/include/asm/entry_arch.h +1
-2@@ -13,8 +13,7 @@ BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR) -BUILD_INTERRUPT3 (irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR , - smp_irq_move_cleanup_interrupt) +BUILD_INTERRUPT(irq_move_cleanup_interrupt, IRQ_MOVE_CLEANUP_VECTOR) BUILD_INTERRUPT3(reboot_interrupt, REBOOT_VECTOR, smp_reboot_interrupt)#endif arch/x86/include/asm/hw_irq.h +1
-1@@ -58,7 +58,7 @@ extern void trace_threshold_interrupt(void);extern void trace_deferred_error_interrupt (void );extern void trace_call_function_interrupt (void );extern void trace_call_function_single_interrupt (void ); -#define trace_irq_move_cleanup_interrupt irq_move_cleanup_interrupt +extern void trace_irq_move_cleanup_interrupt (void );#define trace_reboot_interrupt reboot_interrupt#define trace_kvm_posted_intr_ipi kvm_posted_intr_ipi#define trace_kvm_posted_intr_wakeup_ipi kvm_posted_intr_wakeup_ipiarch/x86/include/asm/trace/irq_vectors.h +6
-0@@ -112,6 +112,12 @@ DEFINE_IRQ_VECTOR_EVENT(deferred_error_apic);*/ DEFINE_IRQ_VECTOR_EVENT (thermal_apic); +/* +* irq_move_cleanup - called when entering/exiting an IRQ move cleanup +* vector handler. +*/ +DEFINE_IRQ_VECTOR_EVENT (irq_move_cleanup); +#undef TRACE_INCLUDE_PATH#define TRACE_INCLUDE_PATH .#define TRACE_INCLUDE_FILE irq_vectorsarch/x86/kernel/apic/vector.c +16
-3@@ -20,6 +20,7 @@#include <asm/i8259.h> #include <asm/desc.h> #include <asm/irq_remapping.h> +#include <asm/trace/irq_vectors.h> struct apic_chip_data {struct irq_cfg cfg;@@ -532,12 +533,10 @@ void send_cleanup_vector(struct irq_cfg *cfg)__send_cleanup_vector (data); } -asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) +static void __smp_irq_move_cleanup_interrupt (void ) {unsigned vector, me; -entering_ack_irq (); - me =smp_processor_id ();for (vector =FIRST_EXTERNAL_VECTOR ; vector <NR_VECTORS ; vector++) {int irq;@@ -587,7 +586,21 @@ asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) unlock:raw_spin_unlock (&desc->lock); } +} + +asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) +{ +entering_ack_irq (); +__smp_irq_move_cleanup_interrupt (); +exiting_irq (); +} +asmlinkage __visible void smp_trace_irq_move_cleanup_interrupt(void) +{ +entering_ack_irq (); +trace_irq_move_cleanup_entry (IRQ_MOVE_CLEANUP_VECTOR ); +__smp_irq_move_cleanup_interrupt (); +trace_irq_move_cleanup_exit (IRQ_MOVE_CLEANUP_VECTOR );exiting_irq (); }