xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Don Slutz <dslutz@verizon.com>,
	xen-devel@lists.xen.org, Jan Beulich <jbeulich@suse.com>,
	Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v2 2/2] xentrace: Add TRC_HVM_VCHIP
Date: Tue, 1 Apr 2014 14:23:11 +0100	[thread overview]
Message-ID: <533ABDBF.80603@eu.citrix.com> (raw)
In-Reply-To: <1396025767-3430-3-git-send-email-dslutz@verizon.com>

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@verizon.com>
> ---
>   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

  reply	other threads:[~2014-04-01 13:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 16:56 [PATCH v2 0/2] xentrace: Add TRC_HVM_VCHIP (was xentrace: Add TRC_HW_VCHIP) Don Slutz
2014-03-28 16:56 ` [PATCH v2 1/2] xentrace: Add emacs local variables Don Slutz
2014-04-01  9:16   ` George Dunlap
2014-04-01 21:42     ` Don Slutz
2014-03-28 16:56 ` [PATCH v2 2/2] xentrace: Add TRC_HVM_VCHIP Don Slutz
2014-04-01 13:23   ` George Dunlap [this message]
2014-04-01 17:42     ` Don Slutz
2014-04-03 10:36   ` Tim Deegan
2014-04-01 13:06 ` [PATCH v2 0/2] xentrace: Add TRC_HVM_VCHIP (was xentrace: Add TRC_HW_VCHIP) George Dunlap
2014-04-01 15:18   ` Don Slutz
2014-04-01 16:01     ` George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533ABDBF.80603@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=dslutz@verizon.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).