[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 6/12/06 16:10, "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx> wrote:
> > The ultimate best way of doing it would be to have trace functions
> > took a format string and a variable number of arguments. The actual
> > trace record written in the buffer would just contain the record
> > and the length of the record, followed by the variable data. The
> > string would be written out in an a separate segment, enabling it to
> > extracted and used by the trace post-process tool to pretty print
> > records.
> I agree this is a good way to go. We certainly don't want lots of
> single use trace-record structures, one per trace point in Xen! That
> be overkill -- format strings are a good middle ground.

If the trace record writing function was inlined, I wander whether gcc
would be smart enough to skip all the var args stuff and just write the
appropriate parameters into the trace buffer? I think that's probably
being optimistic.  It might be possible to do something horrendous with
the C pre-processor, matching various static format strings for common
patterns (e.g. all %x), else falling back to a trivial parser. 

Ideally the format string would include the 'pretty print' format for
the post processing tools (e.g. put the strings as literals in a
separate segment and extract them later in the build process. That's not
attractive if we have to parse the strings at run time, though. It could
easily be fixed by pre-processing all source files with M4 or perl, but
I don't think we want to go there.


Xen-devel mailing list



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