Re: [PATCH v3 5/7] KVM: trace kvm_ple_window grow/shrink
From: Sabrina Dubroca
Date: Mon Aug 25 2014 - 09:54:18 EST
Hello,
2014-08-21, 18:08:09 +0200, Radim KrÄmÃÅ wrote:
> Tracepoint for dynamic PLE window, fired on every potential change.
>
> Signed-off-by: Radim KrÄmÃÅ <rkrcmar@xxxxxxxxxx>
> ---
> 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(-)
>
> 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))
> );
>
> +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 = grow;
> + __entry->vcpu_id = vcpu_id;
> + __entry->new = new;
> + __entry->old = 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: â__tracepoint_kvm_ple_windowâ undeclared here (not in a function)
EXPORT_SYMBOL_GPL(__tracepoint_##name)
^
include/linux/export.h:57:16: note: in definition of macro â__EXPORT_SYMBOLâ
extern typeof(sym) sym; \
^
include/linux/tracepoint.h:214:2: note: in expansion of macro âEXPORT_SYMBOL_GPLâ
EXPORT_SYMBOL_GPL(__tracepoint_##name)
^
arch/x86/kvm/x86.c:7676:1: note: in expansion of macro âEXPORT_TRACEPOINT_SYMBOL_GPLâ
EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_ple_window);
^
and if I comment out the EXPORT_TRACEPOINT_SYMBOL_GPL:
arch/x86/kvm/vmx.c: In function âgrow_ple_windowâ:
arch/x86/kvm/vmx.c:5742:2: error: implicit declaration of function âtrace_kvm_ple_window_growâ [-Werror=implicit-function-declaration]
trace_kvm_ple_window_grow(vcpu->vcpu_id, vmx->ple_window, old);
^
arch/x86/kvm/vmx.c: In function âshrink_ple_windowâ:
arch/x86/kvm/vmx.c:5756:2: error: implicit declaration of function âtrace_kvm_ple_window_shrinkâ [-Werror=implicit-function-declaration]
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,
--
Sabrina
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/