KVM: PPC: BookE: Improve irq inject tracepoint
authorAlexander Graf <agraf@suse.de>
Mon, 10 Nov 2014 23:15:53 +0000 (00:15 +0100)
committerAlexander Graf <agraf@suse.de>
Mon, 15 Dec 2014 12:27:23 +0000 (13:27 +0100)
When injecting an IRQ, we only document which IRQ priority (which translates
to IRQ type) gets injected. However, when reading traces you don't necessarily
have all the numbers in your head to know which IRQ really is meant.

This patch converts the IRQ number field to a symbolic name that is in sync
with the respective define. That way it's a lot easier for readers to figure
out what interrupt gets injected.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/trace_booke.h

index f7537cf26ce70ac5fd17653d47bbbda5fb1e57b8..7ec534d1db9f4ecf1f71a0a3cc4639657ae5a7c0 100644 (file)
@@ -151,6 +151,47 @@ TRACE_EVENT(kvm_booke206_ref_release,
                __entry->pfn, __entry->flags)
 );
 
+#ifdef CONFIG_SPE_POSSIBLE
+#define kvm_trace_symbol_irqprio_spe \
+       {BOOKE_IRQPRIO_SPE_UNAVAIL, "SPE_UNAVAIL"}, \
+       {BOOKE_IRQPRIO_SPE_FP_DATA, "SPE_FP_DATA"}, \
+       {BOOKE_IRQPRIO_SPE_FP_ROUND, "SPE_FP_ROUND"},
+#else
+#define kvm_trace_symbol_irqprio_spe
+#endif
+
+#ifdef CONFIG_PPC_E500MC
+#define kvm_trace_symbol_irqprio_e500mc \
+       {BOOKE_IRQPRIO_ALTIVEC_UNAVAIL, "ALTIVEC_UNAVAIL"}, \
+       {BOOKE_IRQPRIO_ALTIVEC_ASSIST, "ALTIVEC_ASSIST"},
+#else
+#define kvm_trace_symbol_irqprio_e500mc
+#endif
+
+#define kvm_trace_symbol_irqprio \
+       kvm_trace_symbol_irqprio_spe \
+       kvm_trace_symbol_irqprio_e500mc \
+       {BOOKE_IRQPRIO_DATA_STORAGE, "DATA_STORAGE"}, \
+       {BOOKE_IRQPRIO_INST_STORAGE, "INST_STORAGE"}, \
+       {BOOKE_IRQPRIO_ALIGNMENT, "ALIGNMENT"}, \
+       {BOOKE_IRQPRIO_PROGRAM, "PROGRAM"}, \
+       {BOOKE_IRQPRIO_FP_UNAVAIL, "FP_UNAVAIL"}, \
+       {BOOKE_IRQPRIO_SYSCALL, "SYSCALL"}, \
+       {BOOKE_IRQPRIO_AP_UNAVAIL, "AP_UNAVAIL"}, \
+       {BOOKE_IRQPRIO_DTLB_MISS, "DTLB_MISS"}, \
+       {BOOKE_IRQPRIO_ITLB_MISS, "ITLB_MISS"}, \
+       {BOOKE_IRQPRIO_MACHINE_CHECK, "MACHINE_CHECK"}, \
+       {BOOKE_IRQPRIO_DEBUG, "DEBUG"}, \
+       {BOOKE_IRQPRIO_CRITICAL, "CRITICAL"}, \
+       {BOOKE_IRQPRIO_WATCHDOG, "WATCHDOG"}, \
+       {BOOKE_IRQPRIO_EXTERNAL, "EXTERNAL"}, \
+       {BOOKE_IRQPRIO_FIT, "FIT"}, \
+       {BOOKE_IRQPRIO_DECREMENTER, "DECREMENTER"}, \
+       {BOOKE_IRQPRIO_PERFORMANCE_MONITOR, "PERFORMANCE_MONITOR"}, \
+       {BOOKE_IRQPRIO_EXTERNAL_LEVEL, "EXTERNAL_LEVEL"}, \
+       {BOOKE_IRQPRIO_DBELL, "DBELL"}, \
+       {BOOKE_IRQPRIO_DBELL_CRIT, "DBELL_CRIT"} \
+
 TRACE_EVENT(kvm_booke_queue_irqprio,
        TP_PROTO(struct kvm_vcpu *vcpu, unsigned int priority),
        TP_ARGS(vcpu, priority),
@@ -167,8 +208,10 @@ TRACE_EVENT(kvm_booke_queue_irqprio,
                __entry->pending        = vcpu->arch.pending_exceptions;
        ),
 
-       TP_printk("vcpu=%x prio=%x pending=%lx",
-               __entry->cpu_nr, __entry->priority, __entry->pending)
+       TP_printk("vcpu=%x prio=%s pending=%lx",
+               __entry->cpu_nr,
+               __print_symbolic(__entry->priority, kvm_trace_symbol_irqprio),
+               __entry->pending)
 );
 
 #endif