[PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Arnaud Lacombe
Hi folks, You'll find hereafter a new version of the patch to add timestamp to msgbuf. Broken out patches are available in the git repository at: git://github.com/lacombar/freebsd.git master/topic/msgbuf-timestamp Diff since RFC: - build should be fixed on LP64 - micro-second field is now

Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Ed Schouten
Hi Arnaud! * Arnaud Lacombe lacom...@gmail.com, 20111017 22:41: + buf[0] = '\0'; + getnanouptime(ts); + err = snprintf(buf, sizeof buf, [%zd.%.6ld] , + ts.tv_sec, ts.tv_nsec / 1000); What's the use of buf[0] = '\0'? snprintf() will

Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Ed Schouten
Ah, missed something. + getnanouptime(ts); + err = snprintf(buf, sizeof buf, [%zd.%.6ld] , + ts.tv_sec, ts.tv_nsec / 1000); It seems we also have a getmicrouptime(), which returns a struct timeval. Also a more general question: is it actually safe to

Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Arnaud Lacombe
Hi, On Mon, Oct 17, 2011 at 6:19 PM, Ed Schouten e...@80386.nl wrote: Hi Arnaud! * Arnaud Lacombe lacom...@gmail.com, 20111017 22:41: +             buf[0] = '\0'; +             getnanouptime(ts); +             err = snprintf(buf, sizeof buf, [%zd.%.6ld] , +                 ts.tv_sec,

Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Arnaud Lacombe
Hi, On Mon, Oct 17, 2011 at 6:22 PM, Ed Schouten e...@80386.nl wrote: Ah, missed something. +             getnanouptime(ts); +             err = snprintf(buf, sizeof buf, [%zd.%.6ld] , +                 ts.tv_sec, ts.tv_nsec / 1000); It seems we also have a getmicrouptime(), which returns

Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Garrett Cooper
On Mon, Oct 17, 2011 at 5:18 PM, Arnaud Lacombe lacom...@gmail.com wrote: Hi, On Mon, Oct 17, 2011 at 6:22 PM, Ed Schouten e...@80386.nl wrote: Ah, missed something. +             getnanouptime(ts); +             err = snprintf(buf, sizeof buf, [%zd.%.6ld] , +                 ts.tv_sec,