Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Garrett Cooper
On Mon, Oct 17, 2011 at 5:18 PM, Arnaud Lacombe wrote: > Hi, > > On Mon, Oct 17, 2011 at 6:22 PM, Ed Schouten wrote: >> Ah, missed something. >> >>> +             getnanouptime(&ts); >>> +             err = snprintf(buf, sizeof buf, "[%zd.%.6ld] ", >>> +                 ts.tv_sec, ts.tv_nsec / 10

Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Arnaud Lacombe
Hi, On Mon, Oct 17, 2011 at 6:22 PM, Ed Schouten 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 a

Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Arnaud Lacombe
Hi, On Mon, Oct 17, 2011 at 6:19 PM, Ed Schouten wrote: > Hi Arnaud! > > * Arnaud Lacombe , 20111017 22:41: >> +             buf[0] = '\0'; >> +             getnanouptime(&ts); >> +             err = snprintf(buf, sizeof buf, "[%zd.%.6ld] ", >> +                 ts.tv_sec, ts.tv_nsec / 1000); > >

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

Re: [PATCH] Prepend timestamp in msgbuf

2011-10-17 Thread Ed Schouten
Hi Arnaud! * Arnaud Lacombe , 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 overwrite it anyway,

[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 fi