
From: Zenghui Yu <yuzenghui@huawei.com> euleros inclusion category: feature bugzilla: 46842 CVE: NA -------------------------------- This is very useful for debuging vgic. Signed-off-by: Zenghui Yu <yuzenghui@huawei.com> Signed-off-by: Xiangyou Xie <xiexiangyou@huawei.com> Reviewed-by: Ying Fang <fangying1@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- virt/kvm/arm/vgic/trace.h | 43 +++++++++++++++++++++++++++++++++++++++ virt/kvm/arm/vgic/vgic.c | 4 ++++ 2 files changed, 47 insertions(+) diff --git a/virt/kvm/arm/vgic/trace.h b/virt/kvm/arm/vgic/trace.h index 55fed77a9f73..f959ffa54156 100644 --- a/virt/kvm/arm/vgic/trace.h +++ b/virt/kvm/arm/vgic/trace.h @@ -27,6 +27,49 @@ TRACE_EVENT(vgic_update_irq_pending, __entry->vcpu_id, __entry->irq, __entry->level) ); +TRACE_EVENT(compute_ap_list_depth, + TP_PROTO(unsigned long vcpu_id, __u32 irq, __u32 hwirq, __u8 source, + __u8 priority, bool level, bool pending_latch, bool active, + bool enabled, bool hw, bool config), + TP_ARGS(vcpu_id, irq, hwirq, source, priority, level, pending_latch, + active, enabled, hw, config), + + TP_STRUCT__entry( + __field(unsigned long, vcpu_id) + __field(__u32, irq) + __field(__u32, hwirq) + __field(__u8, source) + __field(__u8, priority) + __field(bool, level) + __field(bool, pending_latch) + __field(bool, active) + __field(bool, enabled) + __field(bool, hw) + __field(bool, config) + ), + + TP_fast_assign( + __entry->vcpu_id = vcpu_id; + __entry->irq = irq; + __entry->hwirq = hwirq; + __entry->source = source; + __entry->priority = priority; + __entry->level = level; + __entry->pending_latch = pending_latch; + __entry->active = active; + __entry->enabled = enabled; + __entry->hw = hw; + __entry->config = config; + ), + + TP_printk("VCPU: %ld, IRQ %d, HWIRQ: %d, SOURCE: %d, PRIORITY: %d, level: %d, pending_latch: %d, active: %d, enabled: %d, hw: %d, config: %d", + __entry->vcpu_id, __entry->irq, __entry->hwirq, + __entry->source, __entry->priority, __entry->level, + __entry->pending_latch, __entry->active, + __entry->enabled, __entry->hw, __entry->config) +); + + #endif /* _TRACE_VGIC_H */ #undef TRACE_INCLUDE_PATH diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c index c9c062a39a95..38868b09ba94 100644 --- a/virt/kvm/arm/vgic/vgic.c +++ b/virt/kvm/arm/vgic/vgic.c @@ -779,6 +779,10 @@ static int compute_ap_list_depth(struct kvm_vcpu *vcpu, int w; raw_spin_lock(&irq->irq_lock); + trace_compute_ap_list_depth(vcpu->vcpu_id, irq->intid, + irq->hwintid, irq->source, irq->priority, + irq->line_level, irq->pending_latch, irq->active, + irq->enabled, irq->hw, irq->config); /* GICv2 SGIs can count for more than one... */ w = vgic_irq_get_lr_count(irq); raw_spin_unlock(&irq->irq_lock); -- 2.25.1