WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] xentrace: new trace event to track lost trace re

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] xentrace: new trace event to track lost trace records
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Fri, 18 Aug 2006 14:20:35 +0100
Cc: Rob Gardner <rob.gardner@xxxxxx>
Delivery-date: Fri, 18 Aug 2006 06:21:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <44AD9E24.9050808@xxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <44AD9E24.9050808@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.1
I like this idea.  Thanks for all the work you're doing on the trace buffer.

> diff -r 67f658b84025 -r 81e7d6e0f910 xen/common/trace.c
> --- a/xen/common/trace.c    Thu Jul  6 18:08:37 2006
> +++ b/xen/common/trace.c    Thu Jul  6 23:29:26 2006
> @@ -234,7 +234,8 @@
>      struct t_buf *buf;
>      struct t_rec *rec;
>      unsigned long flags;
> -
> +    static long lost_records = 0;
> +

Shouldn't this be a per-CPU counter?  Otherwise there are going to be issues 
with multiple CPUs accessing it, and with not knowing which CPU lost the 
data.

Although I guess we're very unlikely to ever overflow this, perhaps it's also 
worth considering making it a saturating counter so that userland knows the 
count may not be accurate?  Just a random thought...

> +    if (lost_records) {
> +        rec = &t_recs[smp_processor_id()][buf->prod % nr_recs];

You could use &this_cpu[t_recs] here - I think the rest of the code is now 
converted to use this format.

Cheers,
Mark

> +        rec->cycles  = (u64)get_cycles();
> +        rec->event   = TRC_LOST_RECORDS;
> +        rec->data[0] = lost_records;
> +        rec->data[1] = 0;
> +        rec->data[2] = 0;
> +        rec->data[3] = 0;
> +        rec->data[4] = 0;
> +
> +        wmb();
> +        buf->prod++;
> +        lost_records = 0;
>      }
>
>      rec = &t_recs[smp_processor_id()][buf->prod % nr_recs];
> diff -r 67f658b84025 -r 81e7d6e0f910 xen/include/public/trace.h
> --- a/xen/include/public/trace.h    Thu Jul  6 18:08:37 2006
> +++ b/xen/include/public/trace.h    Thu Jul  6 23:29:26 2006
> @@ -26,6 +26,7 @@
>  #define TRC_VMXIO    0x00088000   /* VMX io emulation trace  */
>
>  /* Trace events per class */
> +#define TRC_LOST_RECORDS        (TRC_GEN + 1)
>
>  #define TRC_SCHED_DOM_ADD       (TRC_SCHED +  1)
>  #define TRC_SCHED_DOM_REM       (TRC_SCHED +  2)

-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-devel] [PATCH] xentrace: new trace event to track lost trace records, Mark Williamson <=