[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 2/2] xentrace: Add TRC_HVM_VCHIP



On 03/28/2014 04:56 PM, Don Slutz wrote:
This add a set of trace events that track the setup of various
virtual chips related to timers in domU.

This set is hpet, pit (i8253, i8254), rtc (MC146818), apic (lapic),
and pic (i8259).  The pmtimer is not traced since it does not have a
changeable rate.

Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
---
  tools/xentrace/formats     | 18 ++++++++++++++++++
  xen/arch/x86/hvm/hpet.c    |  5 +++++
  xen/arch/x86/hvm/i8254.c   |  9 +++++++++
  xen/arch/x86/hvm/rtc.c     |  9 +++++++++
  xen/arch/x86/hvm/vlapic.c  | 16 ++++++++++++++++
  xen/arch/x86/hvm/vpic.c    | 11 +++++++++++
  xen/include/public/trace.h | 20 ++++++++++++++++++++
  7 files changed, 88 insertions(+)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index 67fd42d..1d28e2a 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -152,3 +152,21 @@
  0x00802006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  assign_vector [ irq = %(1)d = 
vector 0x%(2)x, CPU mask: 0x%(3)08x ]
  0x00802007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  bogus_vector [ 0x%(1)x ]
  0x00802008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_irq [ irq = %(1)d, began = 
%(2)dus, ended = %(3)dus ]
+
+0x00084001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hpet create [ tn = %(1)d, irq 
= %(2)d, delta = %(3)d, period = %(4)d ]
+0x00084002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  pit create [ delta = %(1)d, 
period = %(2)d ]
+0x00084003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtc create [ delta = %(1)d, 
period = %(2)d ]
+0x00084004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vlapic create [ delta = %(1)d, 
period = %(2)d, irq = %(3)d ]
+0x00084005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hpet destroy [ tn = %(1)d ]
+0x00084006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  pit destroy  [ ]
+0x00084007  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtc destroy [ ]
+0x00084008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vlapic destroy [ ]
+0x00084009  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  pit callback [ ]
+0x0008400a  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vlapic callback [ ]
+0x0008400b  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vpic_update_int_output [ 
int_output = %(1)d, is_master = %(2)d, irq = %(3)d ]
+0x0008400c  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vpic vcpu_kick [ irq = %(1)d ]
+0x0008400d  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  __vpic_intack [ is_master = 
%(1)d, irq = %(2)d ]
+0x0008400e  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vpic_irq_positive_edge [ irq = 
%(1)d ]
+0x0008400f  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vpic_irq_negative_edge [ irq = 
%(1)d ]
+0x00084010  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vpic_ack_pending_irq [ 
accept_pic_intr = %(1)d, int_output = %(2)d ]
+0x00084011  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vlapic_accept_pic_intr [ 
i8259_target = %(1)d, accept_pic_int = %(2)d ]
diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index e1e769a..bb6de72 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -24,6 +24,7 @@
  #include <asm/hpet.h>
  #include <xen/sched.h>
  #include <xen/event.h>
+#include <xen/trace.h>

  #define domain_vhpet(x) (&(x)->arch.hvm_domain.pl_time.vhpet)
  #define vcpu_vhpet(x)   (domain_vhpet((x)->domain))
@@ -191,6 +192,7 @@ static void hpet_stop_timer(HPETState *h, unsigned int tn)
  {
      ASSERT(tn < HPET_TIMER_NUM);
      ASSERT(spin_is_locked(&h->lock));
+    TRACE_1D(TRC_HVM_VCHIP_HPET_STOP_TIMER, tn);
      destroy_periodic_time(&h->pt[tn]);
      /* read the comparator to get it updated so a read while stopped will
       * return the expected value. */
@@ -255,6 +257,9 @@ static void hpet_set_timer(HPETState *h, unsigned int tn)
       * being enabled (now).
       */
      oneshot = !timer_is_periodic(h, tn);
+    TRACE_4D(TRC_HVM_VCHIP_HPET_START_TIMER, tn, irq,
+             hpet_tick_to_ns(h, diff),

This will only be 32 bits wide; is there ever any risk that this may exceed 4 seconds (4 billion nanoseconds)?


diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h
index e2f60a6..410f0fe 100644
--- a/xen/include/public/trace.h
+++ b/xen/include/public/trace.h
@@ -52,6 +52,7 @@
  /* trace subclasses for SVM */
  #define TRC_HVM_ENTRYEXIT 0x00081000   /* VMENTRY and #VMEXIT       */
  #define TRC_HVM_HANDLER   0x00082000   /* various HVM handlers      */
+#define TRC_HVM_VCHIP     0x00084000   /* virtual chips */

Maybe TRC_HVM_EMUL, for emulated devices?

 -George


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.