diff options
author | David Vrabel <david.vrabel@citrix.com> | 2012-10-03 11:11:06 +0100 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2012-10-03 11:11:06 +0100 |
commit | 86b35acb001f977eb1f82df6c07edaef173f4232 (patch) | |
tree | a3c9bf5a4638b702a19a7b9ac630a1550d83883b /xen/arch/x86/trace.c | |
parent | 4e6967a47ad4caa3af3ada3045fb278a53fd202b (diff) | |
download | xen-86b35acb001f977eb1f82df6c07edaef173f4232.tar.gz xen-86b35acb001f977eb1f82df6c07edaef173f4232.tar.bz2 xen-86b35acb001f977eb1f82df6c07edaef173f4232.zip |
trace: improve usefulness of hypercall trace record
Trace hypercalls using a more useful trace record format.
The EIP field is removed (it was always somewhere in the hypercall
page) and include selected hypercall arguments (e.g., the number of
calls in a multicall, and the number of PTE updates in an mmu_update
etc.). 12 bits in the first extra word are used to indicate which
arguments are present in the record and what size they are (32 or
64-bit).
This is an incompatible record format so a new event ID is used so
tools can distinguish between the two formats.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/trace.c')
-rw-r--r-- | xen/arch/x86/trace.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/xen/arch/x86/trace.c b/xen/arch/x86/trace.c index 27fe150893..f2c75bca05 100644 --- a/xen/arch/x86/trace.c +++ b/xen/arch/x86/trace.c @@ -9,33 +9,28 @@ void trace_hypercall(void) { struct cpu_user_regs *regs = guest_cpu_user_regs(); + unsigned long args[6]; if ( is_pv_32on64_vcpu(current) ) { - struct { - u32 eip,eax; - } __attribute__((packed)) d; - - d.eip = regs->eip; - d.eax = regs->eax; - - __trace_var(TRC_PV_HYPERCALL, 1, sizeof(d), &d); + args[0] = regs->ebx; + args[1] = regs->ecx; + args[2] = regs->edx; + args[3] = regs->esi; + args[4] = regs->edi; + args[5] = regs->ebp; } else { - struct { - unsigned long eip; - u32 eax; - } __attribute__((packed)) d; - u32 event; - - event = TRC_PV_HYPERCALL; - event |= TRC_64_FLAG; - d.eip = regs->eip; - d.eax = regs->eax; - - __trace_var(event, 1/*tsc*/, sizeof(d), &d); + args[0] = regs->rdi; + args[1] = regs->rsi; + args[2] = regs->rdx; + args[3] = regs->r10; + args[4] = regs->r8; + args[5] = regs->r9; } + + __trace_hypercall(regs->eax, args); } void __trace_pv_trap(int trapnr, unsigned long eip, |