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

Re: [Xen-devel] [PATCH v2 5/5] [RFC] Traditional console timestamps including milliseconds



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 <andrew.cooper3@xxxxxxxxxx> 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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


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