From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [PATCH v2 5/5] [RFC] Traditional console timestamps including milliseconds Date: Tue, 04 Mar 2014 15:51:15 -0500 Message-ID: <53163CC3.2000606@terremark.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> <5315AB4F.9080900@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5315AB4F.9080900@citrix.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: Andrew Cooper , Jan Beulich Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org On 03/04/14 05:30, Andrew Cooper wrote: > 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. I think that only 3 digits is enough for this format. This format (that I asked for) is more useful in a set of long running servers where the date/time a given server started is not handy or easy to add seconds to so as to know when something was logged. The TSM_SINCE_BOOT mode is more for looking at issues in a shorter time frame. -Don Slutz > ~Andrew > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel