From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v3 5/5] xen/console: Traditional console timestamps including milliseconds Date: Tue, 11 Mar 2014 11:32:29 +0000 Message-ID: <531EF44D.7080401@citrix.com> References: <1394134085-22952-1-git-send-email-andrew.cooper3@citrix.com> <1394134085-22952-6-git-send-email-andrew.cooper3@citrix.com> <53190AB0.4020806@terremark.com> <531915C4.6060102@citrix.com> <531A573C.6050807@terremark.com> <1394534613.18366.28.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1394534613.18366.28.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Keir Fraser , Tim Deegan , Don Slutz , Xen-devel , Stefano Stabellini , Jan Beulich List-Id: xen-devel@lists.xenproject.org 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 */ >> int tm_hour; /* hours */ >> int tm_mday; /* day of the month */ >> int tm_mon; /* month */ >> int tm_year; /* year */ >> int tm_wday; /* day of the week */ >> int tm_yday; /* day in the year */ >> int tm_isdst; /* daylight saving time */ >> }; >> > 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