From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 5/5] [RFC] Traditional console timestamps including milliseconds Date: Tue, 4 Mar 2014 10:30:39 +0000 Message-ID: <5315AB4F.9080900@citrix.com> References: <1393613824-13230-1-git-send-email-andrew.cooper3@citrix.com> <1393613824-13230-6-git-send-email-andrew.cooper3@citrix.com> <5315A7860200007800120C17@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5315A7860200007800120C17@nat28.tlf.novell.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: Jan Beulich Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org On 04/03/14 09:14, Jan Beulich wrote: >>>> On 28.02.14 at 19:57, Andrew Cooper wrote: >> --- a/xen/drivers/char/console.c >> +++ b/xen/drivers/char/console.c >> @@ -53,6 +53,7 @@ enum con_timestamp_mode >> { >> TSM_NONE, /* No timestamps */ >> TSM_DATE, /* [YYYY-MM-DD HH:MM:SS] */ >> + TSM_DATE_MS, /* [YYYY-MM-DD HH:MM:SS.mmmmmm] */ >> TSM_SINCE_BOOT /* [SSSSSS.mmmmmm] */ > Just ".mmm". > >> @@ -588,6 +592,11 @@ static void printk_start_of_line(const char *prefix) >> snprintf(tstr, sizeof(tstr), "[%04u-%02u-%02u %02u:%02u:%02u] ", >> 1900 + tm.tm_year, tm.tm_mon + 1, tm.tm_mday, >> tm.tm_hour, tm.tm_min, tm.tm_sec); >> + else >> + snprintf(tstr, sizeof(tstr), >> + "[%04u-%02u-%02u %02u:%02u:%02u.%06"PRIu64"] ", > And on the same basis just '.%03"PRIu64"]' > >> + 1900 + tm.tm_year, tm.tm_mon + 1, tm.tm_mday, >> + tm.tm_hour, tm.tm_min, tm.tm_sec, nsec / 1000); > And finally "nsec / 1000000". > > Or is the patch title wrong, and you meant microseconds (in which > case the enumerator should be TSM_DATE_US)? > > Jan > The patch title was indeed wrong in context, although either milliseconds or microseconds could be appropriate here; the time prefix was already quite long and is somewhat uncomfortably long given the extra 7 characters. ~Andrew