ia64/xen-unstable

changeset 9447:dfbf0939350c

This patch is mainly a cleanup of vmx related xentrace code. One minor
xentrace bug is fixed.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
Signed-off-by: Yunfeng Zhao <yunfeng.zhao@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 24 10:59:31 2006 +0100 (2006-03-24)
parents 6d0929e34ce2
children d78dedc4831f
files tools/xentrace/Makefile tools/xentrace/formats tools/xentrace/xentrace.c xen/arch/x86/hvm/vmx/vmx.c xen/include/public/trace.h
line diff
     1.1 --- a/tools/xentrace/Makefile	Fri Mar 24 10:57:52 2006 +0100
     1.2 +++ b/tools/xentrace/Makefile	Fri Mar 24 10:59:31 2006 +0100
     1.3 @@ -6,7 +6,7 @@ INSTALL_DATA	= $(INSTALL) -m0644
     1.4  XEN_ROOT=../..
     1.5  include $(XEN_ROOT)/tools/Rules.mk
     1.6  
     1.7 -CFLAGS  += -Werror
     1.8 +CFLAGS  += -Werror -D_LARGEFILE64_SOURCE
     1.9  
    1.10  CFLAGS  += -I $(XEN_XC)
    1.11  CFLAGS  += -I $(XEN_LIBXC)
     2.1 --- a/tools/xentrace/formats	Fri Mar 24 10:57:52 2006 +0100
     2.2 +++ b/tools/xentrace/formats	Fri Mar 24 10:59:31 2006 +0100
     2.3 @@ -16,6 +16,6 @@ 0x00080001	CPU%(cpu)d      %(tsc)d		VMX_
     2.4  0x00080002	CPU%(cpu)d      %(tsc)d		VMX_VECTOR		[ domid = 0x%(1)08x, eip = 0x%(2)08x, vector = 0x%(3)08x ]
     2.5  0x00080003	CPU%(cpu)d      %(tsc)d		VMX_INT			[ domid = 0x%(1)08x, trap = 0x%(2)08x, va = 0x%(3)08x ]
     2.6  
     2.7 -0x00090001      CPU%(cpu)d      %(tsc)d         VMENTRY                 0x%(1)08x 0x%(2)08x 0x%(3)08x 0x%(4)08x 0x%(5)08x
     2.8 -0x00090002      CPU%(cpu)d      %(tsc)d         VMEXIT                  0x%(1)08x 0x%(2)08x 0x%(3)08x 
     2.9 +0x00081001      CPU%(cpu)d      %(tsc)d         VMEXIT                  0x%(1)08x 0x%(2)08x 0x%(3)08x 
    2.10 +0x00081002      CPU%(cpu)d      %(tsc)d         VMENTRY                 0x%(1)08x 0x%(2)08x 0x%(3)08x 0x%(4)08x 0x%(5)08x
    2.11  
     3.1 --- a/tools/xentrace/xentrace.c	Fri Mar 24 10:57:52 2006 +0100
     3.2 +++ b/tools/xentrace/xentrace.c	Fri Mar 24 10:59:31 2006 +0100
     3.3 @@ -498,7 +498,7 @@ int main(int argc, char **argv)
     3.4      }
     3.5  
     3.6      if ( opts.outfile )
     3.7 -        outfd = open(opts.outfile, O_WRONLY | O_CREAT);
     3.8 +        outfd = open(opts.outfile, O_WRONLY | O_CREAT | O_LARGEFILE, 0644);
     3.9  
    3.10      if(outfd < 0)
    3.11      {
     4.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Mar 24 10:57:52 2006 +0100
     4.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Mar 24 10:59:31 2006 +0100
     4.3 @@ -988,7 +988,7 @@ static void vmx_io_instruction(struct cp
     4.4          port = (exit_qualification >> 16) & 0xFFFF;
     4.5      else
     4.6          port = regs->edx & 0xffff;
     4.7 -    TRACE_VMEXIT(2, port);
     4.8 +    TRACE_VMEXIT(1, port);
     4.9      size = (exit_qualification & 7) + 1;
    4.10      dir = test_bit(3, &exit_qualification); /* direction */
    4.11  
    4.12 @@ -1913,6 +1913,7 @@ static inline void vmx_vmexit_do_extint(
    4.13  
    4.14      vector &= 0xff;
    4.15      local_irq_disable();
    4.16 +    TRACE_VMEXIT(1,vector);
    4.17  
    4.18      switch(vector) {
    4.19      case LOCAL_TIMER_VECTOR:
    4.20 @@ -2042,7 +2043,6 @@ asmlinkage void vmx_vmexit_handler(struc
    4.21  
    4.22      {
    4.23          __vmread(GUEST_RIP, &eip);
    4.24 -        TRACE_3D(TRC_VMX_VMEXIT, v->domain->domain_id, eip, exit_reason);
    4.25          TRACE_VMEXIT(0,exit_reason);
    4.26      }
    4.27  
    4.28 @@ -2066,7 +2066,6 @@ asmlinkage void vmx_vmexit_handler(struc
    4.29          TRACE_VMEXIT(1,vector);
    4.30          perfc_incra(cause_vector, vector);
    4.31  
    4.32 -        TRACE_3D(TRC_VMX_VECTOR, v->domain->domain_id, eip, vector);
    4.33          switch (vector) {
    4.34  #ifdef XEN_DEBUGGER
    4.35          case TRAP_debug:
    4.36 @@ -2250,7 +2249,7 @@ asmlinkage void vmx_load_cr2(void)
    4.37  
    4.38  asmlinkage void vmx_trace_vmentry (void)
    4.39  {
    4.40 -    TRACE_5D(TRC_VMENTRY,
    4.41 +    TRACE_5D(TRC_VMX_VMENTRY,
    4.42               trace_values[smp_processor_id()][0],
    4.43               trace_values[smp_processor_id()][1],
    4.44               trace_values[smp_processor_id()][2],
    4.45 @@ -2266,7 +2265,7 @@ asmlinkage void vmx_trace_vmentry (void)
    4.46  
    4.47  asmlinkage void vmx_trace_vmexit (void)
    4.48  {
    4.49 -    TRACE_3D(TRC_VMEXIT,0,0,0);
    4.50 +    TRACE_3D(TRC_VMX_VMEXIT,0,0,0);
    4.51      return;
    4.52  }
    4.53  
     5.1 --- a/xen/include/public/trace.h	Fri Mar 24 10:57:52 2006 +0100
     5.2 +++ b/xen/include/public/trace.h	Fri Mar 24 10:59:31 2006 +0100
     5.3 @@ -24,7 +24,6 @@
     5.4  #define TRC_VMXTIMER 0x00082000   /* VMX timer trace           */
     5.5  #define TRC_VMXINT   0x00084000   /* VMX interrupt trace       */
     5.6  #define TRC_VMXIO    0x00088000   /* VMX io emulation trace  */
     5.7 -#define TRC_VMEXIT_HANDLER    0x00090000   /* VMX handler trace  */
     5.8  
     5.9  /* Trace events per class */
    5.10  
    5.11 @@ -50,15 +49,12 @@
    5.12  
    5.13  /* trace events per subclass */
    5.14  #define TRC_VMX_VMEXIT          (TRC_VMXEXIT + 1)
    5.15 -#define TRC_VMX_VECTOR          (TRC_VMXEXIT + 2)
    5.16 +#define TRC_VMX_VMENTRY         (TRC_VMXEXIT + 2)
    5.17  
    5.18  #define TRC_VMX_TIMER_INTR      (TRC_VMXTIMER + 1)
    5.19  
    5.20  #define TRC_VMX_INT             (TRC_VMXINT + 1)
    5.21  
    5.22 -#define TRC_VMEXIT              (TRC_VMEXIT_HANDLER + 1)
    5.23 -#define TRC_VMENTRY             (TRC_VMEXIT_HANDLER + 2)
    5.24 -
    5.25  
    5.26  /* This structure represents a single trace buffer record. */
    5.27  struct t_rec {