Re: [PATCH] Prepend timestamp in msgbuf

看板FB_current作者時間14年前 (2011/10/18 08:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串6/6 (看更多)
On Mon, Oct 17, 2011 at 5:18 PM, Arnaud Lacombe <lacombar@gmail.com> wrote: > Hi, > > On Mon, Oct 17, 2011 at 6:22 PM, Ed Schouten <ed@80386.nl> wrote: >> Ah, missed something. >> >>> + =A0 =A0 =A0 =A0 =A0 =A0 getnanouptime(&ts); >>> + =A0 =A0 =A0 =A0 =A0 =A0 err =3D snprintf(buf, sizeof buf, "[%zd.%.6ld= ] ", >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ts.tv_sec, ts.tv_nsec / 1000); >> >> It seems we also have a getmicrouptime(), which returns a struct >> timeval. > fixed. > >> Also a more general question: is it actually safe to call >> getnanouptime() here? This code gets executed from an arbitrary context, >> right? >> > right, but getmicrouptime() is not doing much magic. Just reading a > cached value, do an arithmetic conversion. I do not really see any > unsafe part. Based on glancing around other areas of the kernel, I'd assume that using this KPI as-is is fine because I don't see any locking employed elsewhere... -Garrett _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1EdCa44z (FB_current)
文章代碼(AID): #1EdCa44z (FB_current)