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

Re: [Xen-devel] [RFC][PATCH] 1/3] [XEN] Use explicit bit sized fieldsfor exported xentrace data.



On Thu, Dec 07, 2006 at 02:43:58AM +0000, Mark Williamson wrote:
> > The ultimate best way of doing it would be to have trace functions that
> > took a format string and a variable number of arguments.
> 
> Agreed.
> 
> > The actual 
> > trace record written in the buffer would just contain the record type
> > and the length of the record, followed by the variable data. The format
> > string would be written out in an a separate segment, enabling it to be
> > extracted and used by the trace post-process tool to pretty print the
> > records.
> 
> Cool.
> 
> It would be fairly trivial to declare a name for each "type" and allow 
> userspace to query the type name <-> type ID mapping.  This then removes all 
> responsibility for determining output formatting from userspace, and should 
> make everything neater.
> 
> Nice.  All we need is a coder - anyone interested?

I'll hack something together. to match /my/ understanding of the current
proposals.  We can go from there.

Briefly I think we're talking about using a variable length structure,
with tracepoints looking like a printf() style function.

so
--
        TRACE_4D(TRC_SCHED_SWITCH,
                 prev->domain->domain_id, prev->vcpu_id,
                 next->domain->domain_id, next->vcpu_id);
--
would become something like:
--
        trace(TRC_SCHED_SWITCH, "%d%d%d%d", 
              prev->domain->domain_id, prev->vcpu_id,
              next->domain->domain_id, next->vcpu_id);
--

Trace would store a lookup table for TRC_SCHED_SWITCH => "%d%d%d%d".
The data would get stored in a fashion similar to Mark's suggestion in
http://lists.xensource.com/archives/html/xen-devel/2006-12/msg00179.html

The xentrace tool would write the record and format specifier to disk,
in network byte order (until then data remains in native byte order).
There would fo course be implicit 64bit tsc and 32bit event-type
prefixed to each record.

xentrace_format will pretty print the datafile.

I like the idea of stepping away from printf codes and using explicit
size args (%8, %16, %32 and %64), does anyone disagree?

Yours Tony

   linux.conf.au       http://linux.conf.au/ || http://lca2007.linux.org.au/
   Jan 15-20 2007      The Australian Linux Technical Conference!


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


 


Rackspace

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