Xen tracing: Trace IRQ delivery and migration
PATCH 1/1 Xen tracing: Trace IRQ delivery and migration
Short series of patches to add tracing to IRQ setup and teardown.
PATCH 1/1 xen, tracing: Make a new hardware-related trace class
Power management seems a very narrow focus for its own class, of which we have a limited number due to the layout of the trace records. Make a hardware-event trace class, and move power management events into a subclass of those.
xen/include/public/trace.h +7 -8
@@ -38,7 +38,7 @@#define TRC_MEM 0x0010f000/* Xen memory trace */ #define TRC_PV 0x0020f000/* Xen PV traces */ #define TRC_SHADOW 0x0040f000/* Xen shadow tracing */ -#define TRC_PM 0x0080f000/* Xen power management trace */ +#define TRC_HW 0x0080f000/* Xen hardware-related traces */ #define TRC_GUEST 0x0800f000/* Guest-generated traces */ #define TRC_ALL 0x0ffff000#define TRC_HD_TO_EVENT (x) ((x)&0x0fffffff)
@@ -57,6 +57,9 @@#define TRC_SCHED_CLASS 0x00022000/* Scheduler-specific */ #define TRC_SCHED_VERBOSE 0x00028000/* More inclusive scheduling */ +/* Trace classes for Hardware */ +#define TRC_HW_PM 0x00801000/* Power management traces */ +/* Trace events per class */ #define TRC_LOST_RECORDS (TRC_GEN + 1)#define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2)
@@ -165,14 +168,10 @@#define TRC_HVM_IOPORT_WRITE (TRC_HVM_HANDLER + 0x216)#define TRC_HVM_IOMEM_WRITE (TRC_HVM_HANDLER + 0x217) -/* trace subclasses for power management */ -#define TRC_PM_FREQ 0x00801000/* xen cpu freq events */ -#define TRC_PM_IDLE 0x00802000/* xen cpu idle events */ -/* trace events for per class */ -#define TRC_PM_FREQ_CHANGE (TRC_PM_FREQ + 0x01) -#define TRC_PM_IDLE_ENTRY (TRC_PM_IDLE + 0x01) -#define TRC_PM_IDLE_EXIT (TRC_PM_IDLE + 0x02) +#define TRC_PM_FREQ_CHANGE (TRC_HW_PM + 0x01) +#define TRC_PM_IDLE_ENTRY (TRC_HW_PM + 0x02) +#define TRC_PM_IDLE_EXIT (TRC_HW_PM + 0x03)/* This structure represents a single trace buffer record. */ struct t_rec {
PATCH 1/1 xen tracing: Add tracing for IRQ-related events
In reply to George DunlapAdd tracing for various IRQ-related events. Also, move the exiting TRC_TRACE_IRQ from the "generic" class into the new TRC_HW_IRQ sub-class.
xen/arch/x86/io_apic.c +7 -0
@@ -37,6 +37,7 @@#include <mach_apic.h> #include <io_ports.h> #include <public/physdev.h> +#include <xen/trace.h> /* Where if anywhere is the i8259 connect in external int mode */ static struct {int pin, apic; } ioapic_i8259 = {-1 ,-1 };
@@ -439,8 +440,14 @@ fastcall void smp_irq_move_cleanup_inter*/ if (irr & (1 << (vector %32 ))) { genapic->send_IPI_self (IRQ_MOVE_CLEANUP_VECTOR ); +TRACE_3D (TRC_HW_IRQ_MOVE_CLEANUP_DELAY , + irq, vector,smp_processor_id ()); goto unlock; } + +TRACE_3D (TRC_HW_IRQ_MOVE_CLEANUP , + irq, vector,smp_processor_id ()); +__get_cpu_var (vector_irq)[vector] =-1 ; cfg->move_cleanup_count--; unlock:
xen/arch/x86/irq.c +44 -2
88 lines not on this page · raw message
xen/include/public/trace.h +12 -1
@@ -59,12 +59,12 @@/* Trace classes for Hardware */ #define TRC_HW_PM 0x00801000/* Power management traces */ +#define TRC_HW_IRQ 0x00802000/* Traces relating to the handling of IRQs */ /* Trace events per class */ #define TRC_LOST_RECORDS (TRC_GEN + 1)#define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2)#define TRC_TRACE_CPU_CHANGE (TRC_GEN + 3) -#define TRC_TRACE_IRQ (TRC_GEN + 4)#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1)#define TRC_SCHED_CONTINUE_RUNNING (TRC_SCHED_MIN + 2)
@@ -173,6 +173,17 @@#define TRC_PM_IDLE_ENTRY (TRC_HW_PM + 0x02)#define TRC_PM_IDLE_EXIT (TRC_HW_PM + 0x03) +/* Trace events for IRQs */ +#define TRC_HW_IRQ_MOVE_CLEANUP_DELAY (TRC_HW_IRQ + 0x1) +#define TRC_HW_IRQ_MOVE_CLEANUP (TRC_HW_IRQ + 0x2) +#define TRC_HW_IRQ_BIND_VECTOR (TRC_HW_IRQ + 0x3) +#define TRC_HW_IRQ_CLEAR_VECTOR (TRC_HW_IRQ + 0x4) +#define TRC_HW_IRQ_MOVE_FINISH (TRC_HW_IRQ + 0x5) +#define TRC_HW_IRQ_ASSIGN_VECTOR (TRC_HW_IRQ + 0x6) +#define TRC_HW_IRQ_UNMAPPED_VECTOR (TRC_HW_IRQ + 0x7) +#define TRC_HW_IRQ_HANDLED (TRC_HW_IRQ + 0x8) + +/* This structure represents a single trace buffer record. */ struct t_rec {uint32_t event:28 ;
Re: [PATCH 1 of 2] xen, tracing: Make a new hardware-related trace class
In reply to George DunlapNB.
Quoted 53 lines · George Dunlap
Power management seems a very narrow focus for its own class, of which we have a limited number due to the layout of the trace records. Make a hardware-event trace class, and move power management events into a subclass of those.
Signed-off-by George Dunlap <[email protected]>diff -r
33717472f37e-r9744f91e8c0cxen/include/public/trace.hxen/include/public/trace.h Thu Jun 30 10:32:12 2011 +0100 renamed from xen/include/public/trace.h Tue Jun 28 18:15:44 2011 +0100 +7
-8@@ -38,7 +38,7 @@ #define TRC_MEM 0x0010f000 /* Xen memory trace */ #define TRC_PV 0x0020f000 /* Xen PV traces */ #define TRC_SHADOW 0x0040f000 /* Xen shadow tracing */ -#define TRC_PM 0x0080f000 /* Xen power management trace */ +#define TRC_HW 0x0080f000 /* Xen hardware-related traces */ #define TRC_GUEST 0x0800f000 /* Guest-generated traces */ #define TRC_ALL 0x0ffff000 #define TRC_HD_TO_EVENT(x) ((x)&0x0fffffff)@@ -57,6 +57,9 @@ #define TRC_SCHED_CLASS 0x00022000 /* Scheduler-specific */ #define TRC_SCHED_VERBOSE 0x00028000 /* More inclusive scheduling */ +/* Trace classes for Hardware */ +#define TRC_HW_PM 0x00801000 /* Power management traces */ + /* Trace events per class */ #define TRC_LOST_RECORDS (TRC_GEN + 1) #define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2)@@ -165,14 +168,10 @@ #define TRC_HVM_IOPORT_WRITE (TRC_HVM_HANDLER + 0x216) #define TRC_HVM_IOMEM_WRITE (TRC_HVM_HANDLER + 0x217) -/* trace subclasses for power management */ -#define TRC_PM_FREQ 0x00801000 /* xen cpu freq events */ -#define TRC_PM_IDLE 0x00802000 /* xen cpu idle events */ - /* trace events for per class */ -#define TRC_PM_FREQ_CHANGE (TRC_PM_FREQ + 0x01) -#define TRC_PM_IDLE_ENTRY (TRC_PM_IDLE + 0x01) -#define TRC_PM_IDLE_EXIT (TRC_PM_IDLE + 0x02) +#define TRC_PM_FREQ_CHANGE (TRC_HW_PM + 0x01) +#define TRC_PM_IDLE_ENTRY (TRC_HW_PM + 0x02) +#define TRC_PM_IDLE_EXIT (TRC_HW_PM + 0x03) /* This structure represents a single trace buffer record. */ struct t_rec {_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel