Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754314AbcCRKYc (ORCPT ); Fri, 18 Mar 2016 06:24:32 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38824 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753026AbcCRKYV (ORCPT ); Fri, 18 Mar 2016 06:24:21 -0400 Subject: Re: [PART1 RFC v3 08/12] KVM: x86: Add trace events for AVIC To: Suravee Suthikulpanit , rkrcmar@redhat.com, joro@8bytes.org, bp@alien8.de, gleb@kernel.org, alex.williamson@redhat.com References: <1458281388-14452-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1458281388-14452-9-git-send-email-Suravee.Suthikulpanit@amd.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com From: Paolo Bonzini Message-ID: <56EBD74F.3000907@redhat.com> Date: Fri, 18 Mar 2016 11:24:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1458281388-14452-9-git-send-email-Suravee.Suthikulpanit@amd.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2784 Lines: 97 On 18/03/2016 07:09, Suravee Suthikulpanit wrote: > Introduce trace events for AMD AVIC incomplete IPI vmexit, and > AVIC unaccelerate access vmexit. > > Signed-off-by: Suravee Suthikulpanit > --- > arch/x86/kvm/trace.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > arch/x86/kvm/x86.c | 2 ++ > 2 files changed, 59 insertions(+) > > diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h > index ad9f6a2..3c85a3d 100644 > --- a/arch/x86/kvm/trace.h > +++ b/arch/x86/kvm/trace.h > @@ -1288,6 +1288,63 @@ TRACE_EVENT(kvm_hv_stimer_cleanup, > __entry->vcpu_id, __entry->timer_index) > ); > > +/* > + * Tracepoint for AMD AVIC > + */ > +TRACE_EVENT(kvm_avic_incomplete_ipi, > + TP_PROTO(u32 vcpu, u32 icrh, u32 icrl, u32 id, u32 index), > + TP_ARGS(vcpu, icrh, icrl, id, index), > + > + TP_STRUCT__entry( > + __field(u32, vcpu) > + __field(u32, icrh) > + __field(u32, icrl) > + __field(u32, id) > + __field(u32, index) > + ), > + > + TP_fast_assign( > + __entry->vcpu = vcpu; > + __entry->icrh = icrh; > + __entry->icrl = icrl; > + __entry->id = id; > + __entry->index = index; > + ), > + > + TP_printk("vcpu=%#x, icrh:icrl=%#010x:%08x, id=%u, index=%u\n", vcpus are usually printed with %u. Apart from this, the patch looks good. You can squash it in "svm: Add VMEXIT handlers for AVIC". Paolo > + __entry->vcpu, __entry->icrh, __entry->icrl, > + __entry->id, __entry->index) > +); > + > +TRACE_EVENT(kvm_avic_unaccelerated_access, > + TP_PROTO(u32 vcpu, u32 offset, bool ft, bool rw, u32 vec), > + TP_ARGS(vcpu, offset, ft, rw, vec), > + > + TP_STRUCT__entry( > + __field(u32, vcpu) > + __field(u32, offset) > + __field(bool, ft) > + __field(bool, rw) > + __field(u32, vec) > + ), > + > + TP_fast_assign( > + __entry->vcpu = vcpu; > + __entry->offset = offset; > + __entry->ft = ft; > + __entry->rw = rw; > + __entry->vec = vec; > + ), > + > + TP_printk("vcpu=%#x, offset=%#x(%s), %s, %s, vec=%#x\n", > + __entry->vcpu, > + __entry->offset, > + __print_symbolic(__entry->offset, kvm_trace_symbol_apic), > + __entry->ft ? "trap" : "fault", > + __entry->rw ? "write" : "read", > + __entry->vec) > +); > + > #endif /* _TRACE_KVM_H */ > > #undef TRACE_INCLUDE_PATH > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 4d2961d..775de1c 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -8395,3 +8395,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_write_tsc_offset); > EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_ple_window); > EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pml_full); > EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pi_irte_update); > +EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_unaccelerated_access); > +EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_incomplete_ipi); >