From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sabrina Dubroca Subject: Re: [PATCH v3 5/7] KVM: trace kvm_ple_window grow/shrink Date: Mon, 25 Aug 2014 15:53:41 +0200 Message-ID: <20140825135341.GA20218@kria> References: <1408637291-18533-1-git-send-email-rkrcmar@redhat.com> <1408637291-18533-6-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Gleb Natapov , Raghavendra KT , Vinod Chegu , Hui-Zhi Zhao , Christian Borntraeger , Lisa Mitchell To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Content-Disposition: inline In-Reply-To: <1408637291-18533-6-git-send-email-rkrcmar@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Hello, 2014-08-21, 18:08:09 +0200, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > Tracepoint for dynamic PLE window, fired on every potential change. >=20 > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > --- > arch/x86/kvm/trace.h | 30 ++++++++++++++++++++++++++++++ > arch/x86/kvm/vmx.c | 10 ++++++++-- > arch/x86/kvm/x86.c | 1 + > 3 files changed, 39 insertions(+), 2 deletions(-) >=20 > diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h > index e850a7d..1742dfb 100644 > --- a/arch/x86/kvm/trace.h > +++ b/arch/x86/kvm/trace.h > @@ -848,6 +848,36 @@ TRACE_EVENT(kvm_track_tsc, > __print_symbolic(__entry->host_clock, host_clocks)) > ); > =20 > +TRACE_EVENT(kvm_ple_window, > + TP_PROTO(bool grow, unsigned int vcpu_id, int new, int old), > + TP_ARGS(grow, vcpu_id, new, old), > + > + TP_STRUCT__entry( > + __field( bool, grow ) > + __field( unsigned int, vcpu_id ) > + __field( int, new ) > + __field( int, old ) > + ), > + > + TP_fast_assign( > + __entry->grow =3D grow; > + __entry->vcpu_id =3D vcpu_id; > + __entry->new =3D new; > + __entry->old =3D old; > + ), > + > + TP_printk("vcpu %u: ple_window %d (%s %d)", > + __entry->vcpu_id, > + __entry->new, > + __entry->grow ? "grow" : "shrink", > + __entry->old) > +); > + > +#define trace_kvm_ple_window_grow(vcpu_id, new, old) \ > + trace_kvm_ple_window(true, vcpu_id, new, old) > +#define trace_kvm_ple_window_shrink(vcpu_id, new, old) \ > + trace_kvm_ple_window(false, vcpu_id, new, old) > + > #endif /* CONFIG_X86_64 */ Looks like these are needed on 32-bit as well. Today's linux-next doesn't build: CC [M] arch/x86/kvm/x86.o In file included from include/linux/linkage.h:6:0, from include/linux/preempt.h:9, from include/linux/preempt_mask.h:4, from include/linux/hardirq.h:4, from include/linux/kvm_host.h:10, from arch/x86/kvm/x86.c:22: include/linux/tracepoint.h:214:20: error: =E2=80=98__tracepoint_kvm_ple= _window=E2=80=99 undeclared here (not in a function) EXPORT_SYMBOL_GPL(__tracepoint_##name) ^ include/linux/export.h:57:16: note: in definition of macro =E2=80=98__E= XPORT_SYMBOL=E2=80=99 extern typeof(sym) sym; \ ^ include/linux/tracepoint.h:214:2: note: in expansion of macro =E2=80=98= EXPORT_SYMBOL_GPL=E2=80=99 EXPORT_SYMBOL_GPL(__tracepoint_##name) ^ arch/x86/kvm/x86.c:7676:1: note: in expansion of macro =E2=80=98EXPORT_= TRACEPOINT_SYMBOL_GPL=E2=80=99 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_ple_window); ^ and if I comment out the EXPORT_TRACEPOINT_SYMBOL_GPL: arch/x86/kvm/vmx.c: In function =E2=80=98grow_ple_window=E2=80=99: arch/x86/kvm/vmx.c:5742:2: error: implicit declaration of function =E2=80= =98trace_kvm_ple_window_grow=E2=80=99 [-Werror=3Dimplicit-function-decl= aration] trace_kvm_ple_window_grow(vcpu->vcpu_id, vmx->ple_window, old); ^ arch/x86/kvm/vmx.c: In function =E2=80=98shrink_ple_window=E2=80=99: arch/x86/kvm/vmx.c:5756:2: error: implicit declaration of function =E2=80= =98trace_kvm_ple_window_shrink=E2=80=99 [-Werror=3Dimplicit-function-de= claration] trace_kvm_ple_window_shrink(vcpu->vcpu_id, vmx->ple_window, old); ^ cc1: some warnings being treated as errors make[2]: *** [arch/x86/kvm/vmx.o] Error 1 I moved the line #endif /* CONFIG_X86_64 */ above TRACE_EVENT(kvm_ple_window, and it builds. Thanks, --=20 Sabrina