From: Avi Kivity <[email protected]>

Now that the vendor-specific tracepoints have been commonalized, we can
define them in common code and export them to vendor modules.  This
fixes CONFIG_KVM_INTEL=y CONFIG_KVM_AMD=y builds.

Signed-off-by: Avi Kivity <[email protected]>

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index ef1577d..fc14bdf 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -25,12 +25,12 @@
 #include <linux/vmalloc.h>
 #include <linux/highmem.h>
 #include <linux/sched.h>
+#include <linux/ftrace_event.h>
 
 #include <asm/desc.h>
 
 #include <asm/virtext.h>
-#define CREATE_TRACE_POINTS
-#include "trace-arch.h"
+#include "trace.h"
 
 #define __ex(x) __kvm_handle_fault_on_reboot(x)
 
diff --git a/arch/x86/kvm/trace-arch.h b/arch/x86/kvm/trace-arch.h
index 4e3197a..03a3394 100644
--- a/arch/x86/kvm/trace-arch.h
+++ b/arch/x86/kvm/trace-arch.h
@@ -1,13 +1,3 @@
-#if !defined(_TRACE_KVM_ARCH_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_KVM_ARCH_H
-
-#include <linux/tracepoint.h>
-
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM kvm
-#define TRACE_INCLUDE_PATH arch/x86/kvm
-#define TRACE_INCLUDE_FILE trace-arch
-
 /*
  * Tracepoint for kvm guest exit:
  */
@@ -123,8 +113,3 @@ TRACE_EVENT(kvm_cr,
 
 #define trace_kvm_cr_read(cr, val)             trace_kvm_cr(0, cr, val)
 #define trace_kvm_cr_write(cr, val)            trace_kvm_cr(1, cr, val)
-
-#endif /* _TRACE_KVM_ARCH_H */
-
-/* This part must be outside protection */
-#include <trace/define_trace.h>
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index 2b61329..da1a281 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -138,6 +138,8 @@ TRACE_EVENT(kvm_apic,
 #define trace_kvm_apic_read(reg, val)          trace_kvm_apic(0, reg, val)
 #define trace_kvm_apic_write(reg, val)         trace_kvm_apic(1, reg, val)
 
+#include "trace-arch.h"
+
 #endif /* _TRACE_KVM_H */
 
 /* This part must be outside protection */
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e56b817..119fa47 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -25,6 +25,7 @@
 #include <linux/highmem.h>
 #include <linux/sched.h>
 #include <linux/moduleparam.h>
+#include <linux/ftrace_event.h>
 #include "kvm_cache_regs.h"
 #include "x86.h"
 
@@ -34,8 +35,7 @@
 #include <asm/virtext.h>
 #include <asm/mce.h>
 
-#define CREATE_TRACE_POINTS
-#include "trace-arch.h"
+#include "trace.h"
 
 #define __ex(x) __kvm_handle_fault_on_reboot(x)
 
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1549d76..af53f64 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4883,3 +4883,9 @@ int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu)
 {
        return kvm_x86_ops->interrupt_allowed(vcpu);
 }
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_exit);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_inj_virq);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_page_fault);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_msr);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr);
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to