xen/trace: add multicall tracing
[deliverable/linux.git] / arch / x86 / include / asm / xen / hypercall.h
index 8508bfe52296b18b5b3164acff6e2cf449a31792..417777de5a40b9e039a039b0cd429927e37fca49 100644 (file)
@@ -39,6 +39,8 @@
 #include <linux/string.h>
 #include <linux/types.h>
 
+#include <trace/events/xen.h>
+
 #include <asm/page.h>
 #include <asm/pgtable.h>
 
@@ -447,11 +449,20 @@ HYPERVISOR_hvm_op(int op, void *arg)
        return _hypercall2(unsigned long, hvm_op, op, arg);
 }
 
+static inline int
+HYPERVISOR_tmem_op(
+       struct tmem_op *op)
+{
+       return _hypercall1(int, tmem_op, op);
+}
+
 static inline void
 MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set)
 {
        mcl->op = __HYPERVISOR_fpu_taskswitch;
        mcl->args[0] = set;
+
+       trace_xen_mc_entry(mcl, 1);
 }
 
 static inline void
@@ -468,6 +479,8 @@ MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
                mcl->args[2] = new_val.pte >> 32;
                mcl->args[3] = flags;
        }
+
+       trace_xen_mc_entry(mcl, sizeof(new_val) == sizeof(long) ? 3 : 4);
 }
 
 static inline void
@@ -478,6 +491,8 @@ MULTI_grant_table_op(struct multicall_entry *mcl, unsigned int cmd,
        mcl->args[0] = cmd;
        mcl->args[1] = (unsigned long)uop;
        mcl->args[2] = count;
+
+       trace_xen_mc_entry(mcl, 3);
 }
 
 static inline void
@@ -497,6 +512,8 @@ MULTI_update_va_mapping_otherdomain(struct multicall_entry *mcl, unsigned long v
                mcl->args[3] = flags;
                mcl->args[4] = domid;
        }
+
+       trace_xen_mc_entry(mcl, sizeof(new_val) == sizeof(long) ? 4 : 5);
 }
 
 static inline void
@@ -513,6 +530,8 @@ MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
                mcl->args[2] = desc.a;
                mcl->args[3] = desc.b;
        }
+
+       trace_xen_mc_entry(mcl, sizeof(maddr) == sizeof(long) ? 2 : 4);
 }
 
 static inline void
@@ -521,6 +540,8 @@ MULTI_memory_op(struct multicall_entry *mcl, unsigned int cmd, void *arg)
        mcl->op = __HYPERVISOR_memory_op;
        mcl->args[0] = cmd;
        mcl->args[1] = (unsigned long)arg;
+
+       trace_xen_mc_entry(mcl, 2);
 }
 
 static inline void
@@ -532,6 +553,8 @@ MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
        mcl->args[1] = count;
        mcl->args[2] = (unsigned long)success_count;
        mcl->args[3] = domid;
+
+       trace_xen_mc_entry(mcl, 4);
 }
 
 static inline void
@@ -543,6 +566,8 @@ MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count,
        mcl->args[1] = count;
        mcl->args[2] = (unsigned long)success_count;
        mcl->args[3] = domid;
+
+       trace_xen_mc_entry(mcl, 4);
 }
 
 static inline void
@@ -551,6 +576,8 @@ MULTI_set_gdt(struct multicall_entry *mcl, unsigned long *frames, int entries)
        mcl->op = __HYPERVISOR_set_gdt;
        mcl->args[0] = (unsigned long)frames;
        mcl->args[1] = entries;
+
+       trace_xen_mc_entry(mcl, 2);
 }
 
 static inline void
@@ -560,6 +587,8 @@ MULTI_stack_switch(struct multicall_entry *mcl,
        mcl->op = __HYPERVISOR_stack_switch;
        mcl->args[0] = ss;
        mcl->args[1] = esp;
+
+       trace_xen_mc_entry(mcl, 2);
 }
 
 #endif /* _ASM_X86_XEN_HYPERCALL_H */
This page took 0.093742 seconds and 5 git commands to generate.