Browse Source

x86/hyper-v: Trace PV IPI send

Trace Hyper-V PV IPIs the same way we do PV TLB flush.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: devel@linuxdriverproject.org
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>
Cc: "Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>
Link: https://lkml.kernel.org/r/20180622170625.30688-5-vkuznets@redhat.com
Vitaly Kuznetsov 7 years ago
parent
commit
58ec5e9c90
2 changed files with 19 additions and 0 deletions
  1. 4 0
      arch/x86/hyperv/hv_apic.c
  2. 15 0
      arch/x86/include/asm/trace/hyperv.h

+ 4 - 0
arch/x86/hyperv/hv_apic.c

@@ -31,6 +31,8 @@
 #include <asm/mshyperv.h>
 #include <asm/mshyperv.h>
 #include <asm/apic.h>
 #include <asm/apic.h>
 
 
+#include <asm/trace/hyperv.h>
+
 static struct apic orig_apic;
 static struct apic orig_apic;
 
 
 static u64 hv_apic_icr_read(void)
 static u64 hv_apic_icr_read(void)
@@ -134,6 +136,8 @@ static bool __send_ipi_mask(const struct cpumask *mask, int vector)
 	struct ipi_arg_non_ex ipi_arg;
 	struct ipi_arg_non_ex ipi_arg;
 	int ret = 1;
 	int ret = 1;
 
 
+	trace_hyperv_send_ipi_mask(mask, vector);
+
 	if (cpumask_empty(mask))
 	if (cpumask_empty(mask))
 		return true;
 		return true;
 
 

+ 15 - 0
arch/x86/include/asm/trace/hyperv.h

@@ -28,6 +28,21 @@ TRACE_EVENT(hyperv_mmu_flush_tlb_others,
 		      __entry->addr, __entry->end)
 		      __entry->addr, __entry->end)
 	);
 	);
 
 
+TRACE_EVENT(hyperv_send_ipi_mask,
+	    TP_PROTO(const struct cpumask *cpus,
+		     int vector),
+	    TP_ARGS(cpus, vector),
+	    TP_STRUCT__entry(
+		    __field(unsigned int, ncpus)
+		    __field(int, vector)
+		    ),
+	    TP_fast_assign(__entry->ncpus = cpumask_weight(cpus);
+			   __entry->vector = vector;
+		    ),
+	    TP_printk("ncpus %d vector %x",
+		      __entry->ncpus, __entry->vector)
+	);
+
 #endif /* CONFIG_HYPERV */
 #endif /* CONFIG_HYPERV */
 
 
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_PATH