diff mbox

[3/3] kvm-kmod: dummy event trace hooks

Message ID 20090618144819.646605314@localhost.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Marcelo Tosatti June 18, 2009, 2:47 p.m. UTC
And don't stop if kvm_trace.c is gone.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
diff mbox

Patch

Index: kvm-kmod/external-module-compat-comm.h
===================================================================
--- kvm-kmod.orig/external-module-compat-comm.h
+++ kvm-kmod/external-module-compat-comm.h
@@ -762,6 +762,18 @@  static inline bool zalloc_cpumask_var(cp
 
 #endif
 
+/* event traces added in 2.6.31 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+
+#define TP_PROTO(args...) args
+
+#define TRACE_EVENT(name, proto, args, entry, fa, printk)               \
+	static inline void trace_##name(proto) { }
+
+static inline void tracepoint_synchronize_unregister(void) { }
+
+#endif
+
 
 /* Macro introduced only on newer kernels: */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
Index: kvm-kmod/sync
===================================================================
--- kvm-kmod.orig/sync
+++ kvm-kmod/sync
@@ -171,6 +171,10 @@  def header_sync(arch):
                % { 'T': T, 'name': os.path.basename(file) })
         cp(file, out)
         unifdef(out)
+    for file in glob('%(linux)s/include/trace/events/kvm.h' % { 'linux': linux }):
+        out = ('%(T)s/include/trace/events/%(name)s'
+                % { 'T': T, 'name': os.path.basename(file) })
+        cp(file, out)
     arch_headers = (
         [x
          for dir in ['%(linux)s/arch/%(arch)s/include/asm/./kvm*.h',
@@ -207,7 +211,13 @@  def source_sync(arch):
         unifdef(i)
 
     for i in hack_files[arch]:
-        hack(T, arch, i)
+        try:
+            os.stat(T + "/" + i )
+        except OSError:
+              if i != "kvm_trace.c":
+                  raise
+        else:
+              hack(T, arch, i)
 
     copy_if_changed(T, arch)
     rmtree(T)
Index: kvm-kmod/include-compat/trace/define_trace.h
===================================================================
--- /dev/null
+++ kvm-kmod/include-compat/trace/define_trace.h
@@ -0,0 +1 @@ 
+/* Dummy file */