xen/trace: add multicall tracing
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -459,6 +461,8 @@ 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
|
||||
@@ -475,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
|
||||
@@ -485,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
|
||||
@@ -504,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
|
||||
@@ -520,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
|
||||
@@ -528,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
|
||||
@@ -539,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
|
||||
@@ -550,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
|
||||
@@ -558,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
|
||||
@@ -567,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 */
|
||||
|
18
arch/x86/include/asm/xen/trace_types.h
Normal file
18
arch/x86/include/asm/xen/trace_types.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _ASM_XEN_TRACE_TYPES_H
|
||||
#define _ASM_XEN_TRACE_TYPES_H
|
||||
|
||||
enum xen_mc_flush_reason {
|
||||
XEN_MC_FL_NONE, /* explicit flush */
|
||||
XEN_MC_FL_BATCH, /* out of hypercall space */
|
||||
XEN_MC_FL_ARGS, /* out of argument space */
|
||||
XEN_MC_FL_CALLBACK, /* out of callback space */
|
||||
};
|
||||
|
||||
enum xen_mc_extend_args {
|
||||
XEN_MC_XE_OK,
|
||||
XEN_MC_XE_BAD_OP,
|
||||
XEN_MC_XE_NO_SPACE
|
||||
};
|
||||
typedef void (*xen_mc_callback_fn_t)(void *);
|
||||
|
||||
#endif /* _ASM_XEN_TRACE_TYPES_H */
|
Reference in New Issue
Block a user