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;

-------------------------------------------------------------------------
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
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to