|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] Question about xentrace to trace s_time_t type of data
On 08/25/2014 02:31 PM, Konrad Rzeszutek Wilk wrote: On Sat, Aug 23, 2014 at 11:24:21PM -0400, Meng Xu wrote: No; trace_var() takes a pointer to a struct and a size. Meng is following the example he's seen in sched_credit2.c. :-) The size of the structure is larger because the structure isn't "packed": by default it will try to make 64-bit elements 64-bit aligned by adding in "padding". You can get around this in one of two ways: 1. Re-arranging the elements so they're naturally aligned. In this case, you could do
struct {
s_time_t cur_budget;
unsigned dom:16, vcpu:16;
} d;
2. Adding "__packed" after "struct". This tells the compiler not to try
to align the bytes according to their size.
That explains why it's 4 words instead of 3, but I'm still a bit mistified why it's not something like [ 00010000 <garbage> 40000000 00000000 ] I guess try with a packed structure and see what you get. :-) -George _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |