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

Re: [Xen-devel] [PATCH v3 5/5] xen/console: Traditional console timestamps including milliseconds



On 11/03/14 10:43, Ian Campbell wrote:
> On Fri, 2014-03-07 at 18:33 -0500, Don Slutz wrote:
>
>> Last I knew (struct tm) { 0 } is
>>
>> struct tm {
>>      int     tm_sec;         /* seconds */ = 0
>>      int     tm_min;         /* minutes */ <undef>
>>      int     tm_hour;        /* hours */ <undef>
>>      int     tm_mday;        /* day of the month */ <undef>
>>      int     tm_mon;         /* month */ <undef>
>>      int     tm_year;        /* year */ <undef>
>>      int     tm_wday;        /* day of the week */ <undef>
>>      int     tm_yday;        /* day in the year */ <undef>
>>      int     tm_isdst;       /* daylight saving time */ <undef>
>> };
>>
> Actually I believe the affect of "struct foo = { 0 }" is to zero
> everything (possibly implicitly by causing it to be placed in .bss), but
> I don't have my copy of the spec to hand to quote chapter and verse on
> that.
>
> Ian.
>

This is a stack entry, so no .bss involved.  Sadly, all the time
functions pass `struct tm`s around by value rather than pointer, and
there is probably easy room for optimisation there.

As for { 0 }, it is indeed special, but even with a copy of the C spec
to hand, I cant see where it is exactly specified.  The disassembly of
wallclock_time() does indeed confirm that the entire structure is zeroed.

~Andrew

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