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

Re: [Xen-devel] [PATCH 3/3] libxc: add xc_tbuf_trace() to insert trace records



On 15/08/13 15:39, David Vrabel wrote:
On 15/08/13 15:37, George Dunlap wrote:
On 25/07/13 14:23, David Vrabel wrote:
From: David Vrabel <david.vrabel@xxxxxxxxxx>

Add xc_tbuf_trace() to allow trace records to be added to the trace
buffer.  The subclass and event number and up to 7 uin32_t arguments
may be specified.

The hypercall sub-op used is HVMOP_xentrace which (despite the name)
may be used by PV guests.
Would it make sense to make this interface more like the hypervisor's
trace_var() -- that is, taking a sizeof() and single pointer, so that
callers can easily pass in packed structs?
I did it like this so it would only take a single line to get a useful
trace point.

Yes, I figured that: you're basically using the function call generating code to make an array of unsigned from the arguments. But if at some point in the future you decide that you need to pack a record tighter (to make records smaller or to fit more in a single record), then won't you want a different interface?

On the other hand -- could you just abuse the va_args interface to DTRT anyway? e.g. consider the following:

uint16_t a, b;
uint32_t c;
xc_tbuf_trace(xc, evt, 2, a, b, c);
-----

struct foo st;
xc_tbuf_trace(xc, evt, ROUND_UP(sizeof(st), sizeof(unsigned)), st);

----

1. Would these work?
2. Is this an acceptable thing to do?

If so, it certainly makes the code a lot cleaner...

 -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®.