From 60cfce4c4f6f6741882032ee6f895e835533a16b Mon Sep 17 00:00:00 2001 From: Tianyu Lan Date: Thu, 19 Jul 2018 08:40:12 +0000 Subject: [PATCH] X86/Hyper-V: Add hyperv_nested_flush_guest_mapping ftrace support This patch is to add hyperv_nested_flush_guest_mapping support to trace hvFlushGuestPhysicalAddressSpace hypercall. Signed-off-by: Lan Tianyu Acked-by: K. Y. Srinivasan Signed-off-by: Paolo Bonzini --- arch/x86/hyperv/nested.c | 3 +++ arch/x86/include/asm/trace/hyperv.h | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/arch/x86/hyperv/nested.c b/arch/x86/hyperv/nested.c index 08f914217518..b8e60cc50461 100644 --- a/arch/x86/hyperv/nested.c +++ b/arch/x86/hyperv/nested.c @@ -14,6 +14,8 @@ #include #include +#include + int hyperv_flush_guest_mapping(u64 as) { struct hv_guest_mapping_flush **flush_pcpu; @@ -48,6 +50,7 @@ int hyperv_flush_guest_mapping(u64 as) ret = 0; fault: + trace_hyperv_nested_flush_guest_mapping(as, ret); return ret; } EXPORT_SYMBOL_GPL(hyperv_flush_guest_mapping); diff --git a/arch/x86/include/asm/trace/hyperv.h b/arch/x86/include/asm/trace/hyperv.h index 4253bca99989..e1ffe61de8d6 100644 --- a/arch/x86/include/asm/trace/hyperv.h +++ b/arch/x86/include/asm/trace/hyperv.h @@ -28,6 +28,20 @@ TRACE_EVENT(hyperv_mmu_flush_tlb_others, __entry->addr, __entry->end) ); +TRACE_EVENT(hyperv_nested_flush_guest_mapping, + TP_PROTO(u64 as, int ret), + TP_ARGS(as, ret), + + TP_STRUCT__entry( + __field(u64, as) + __field(int, ret) + ), + TP_fast_assign(__entry->as = as; + __entry->ret = ret; + ), + TP_printk("address space %llx ret %d", __entry->as, __entry->ret) + ); + #endif /* CONFIG_HYPERV */ #undef TRACE_INCLUDE_PATH -- GitLab