From: Hollis Blanchard <hollisb@us.ibm.com>
To: "Liu, Eric E" <eric.e.liu@intel.com>
Cc: kvm-devel@lists.sourceforge.net,
kvm-ppc-devel@lists.sourceforge.net,
Avi Kivity <avi@qumranet.com>
Subject: Re: [PATCH 1/5]Add some trace markers and exposeinterfaces in kernel for tracing
Date: Wed, 16 Apr 2008 00:34:55 -0500 [thread overview]
Message-ID: <200804160034.55802.hollisb@us.ibm.com> (raw)
In-Reply-To: <9D7649D18729DE4BB2BD7B494F7FEDC201262498@pdsmsx415.ccr.corp.intel.com>
On Tuesday 15 April 2008 22:13:28 Liu, Eric E wrote:
> Hollis Blanchard wrote:
> > On Wednesday 09 April 2008 05:01:36 Liu, Eric E wrote:
> >> +/* This structure represents a single trace buffer record. */
> >> +struct kvm_trace_rec { + __u32 event:28;
> >> + __u32 extra_u32:3;
> >> + __u32 cycle_in:1;
> >> + __u32 pid;
> >> + __u32 vcpu_id;
> >> + union {
> >> + struct {
> >> + __u32 cycle_lo, cycle_hi;
> >> + __u32 extra_u32[KVM_TRC_EXTRA_MAX];
> >> + } cycle; + struct {
> >> + __u32 extra_u32[KVM_TRC_EXTRA_MAX];
> >> + } nocycle; + } u;
> >> +};
> >
> > Do we really need bitfields here? They are notoriously non-portable.
> >
> > Practically speaking, this will prevent me from copying a trace file
> > from my big-endian target to my little-endian workstation for
> > analysis, at least without some ugly hacking in the userland tool.
> Here the main consideration using bitfields is to save storage space for
each record, but as you said it is non-portable for your mentioned case, so
should we need to adjust the struct like this?
> __u32 event;
> __16 extra_u32;
> __16 cycle_in;
If space really is a worry, you could still combine the fields, and just use
masks to extract the data later. No matter what, byteswapping is required in
the userland tool. I suspect this isn't there already, but it will be easier
to add without the bitfields.
Hmm, while we're on the subject, I'm not sure what the best way to
automatically byteswap will be. It probably isn't worth it to convert all
trace data to a standard ordering (which would add overhead to tracing), but
I suppose there is no metadata in the trace log? A command line switch might
be inconvenient but inevitable.
--
Hollis Blanchard
IBM Linux Technology Center
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-04-16 5:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-09 10:01 [PATCH 1/5]Add some trace markers and expose interfaces in kernel for tracing Liu, Eric E
2008-04-15 20:57 ` Hollis Blanchard
2008-04-16 3:13 ` [PATCH 1/5]Add some trace markers and exposeinterfaces " Liu, Eric E
2008-04-16 5:34 ` Hollis Blanchard [this message]
2008-04-16 6:45 ` Liu, Eric E
2008-04-17 21:59 ` [kvm-ppc-devel] " Hollis Blanchard
2008-04-18 1:41 ` Liu, Eric E
2008-04-18 6:08 ` Christian Ehrhardt
2008-04-20 5:38 ` Liu, Eric E
2008-04-21 21:22 ` Hollis Blanchard
2008-04-22 2:20 ` Liu, Eric E
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=200804160034.55802.hollisb@us.ibm.com \
--to=hollisb@us.ibm.com \
--cc=avi@qumranet.com \
--cc=eric.e.liu@intel.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=kvm-ppc-devel@lists.sourceforge.net \
/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