From: George Dunlap <george.dunlap@eu.citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
George Dunlap <george.dunlap@citrix.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH 3/3] libxc: add xc_tbuf_trace() to insert trace records
Date: Thu, 15 Aug 2013 15:48:51 +0100 [thread overview]
Message-ID: <520CEA53.6010305@eu.citrix.com> (raw)
In-Reply-To: <520CE80D.5030500@citrix.com>
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@citrix.com>
>>>
>>> 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
next prev parent reply other threads:[~2013-08-15 14:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 13:22 [PATCH 0/3] xen: guest tracing improvements David Vrabel
2013-07-25 13:23 ` [PATCH 1/3] trace: include timestamp in trace records added by HVMOP_xentrace David Vrabel
2013-08-15 14:15 ` George Dunlap
2013-07-25 13:23 ` [PATCH 2/3] trace: allow HVMOP_xentrace to set trace record subclass David Vrabel
2013-08-15 14:18 ` George Dunlap
2013-07-25 13:23 ` [PATCH 3/3] libxc: add xc_tbuf_trace() to insert trace records David Vrabel
2013-07-25 13:39 ` David Vrabel
2013-08-15 14:37 ` George Dunlap
2013-08-15 14:39 ` David Vrabel
2013-08-15 14:48 ` George Dunlap [this message]
2013-08-06 14:43 ` [PATCH 0/3] xen: guest tracing improvements David Vrabel
2013-08-06 14:46 ` 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=520CEA53.6010305@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=david.vrabel@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=ian.campbell@citrix.com \
--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).