From owner-freebsd-current@FreeBSD.ORG Tue Oct 18 00:18:25 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C791065675 for ; Tue, 18 Oct 2011 00:18:25 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id F36488FC15 for ; Tue, 18 Oct 2011 00:18:24 +0000 (UTC) Received: by wwn22 with SMTP id 22so4229086wwn.1 for ; Mon, 17 Oct 2011 17:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=jkqod2th5v7+g3DUiJ4DnGu3dvL6I/50VtEF2einrbo=; b=nZ82ygRwA/LN1T5wQCUq90O58EqmjKIR/RKGNZSCz/2GDz/ERx0heKEUo2qHpteMpe U1gErfK495CTfj+fhdpyE6HiX60OFbVsEa2s7t2BHYG2z6QMaGnh+sdyXukuuMYmuUYQ IlKHcG2qGejejBuvQlK19C4nA0TZm6kCH8S7w= MIME-Version: 1.0 Received: by 10.227.166.69 with SMTP id l5mr29670wby.34.1318897104055; Mon, 17 Oct 2011 17:18:24 -0700 (PDT) Received: by 10.180.103.198 with HTTP; Mon, 17 Oct 2011 17:18:24 -0700 (PDT) In-Reply-To: <20111017222259.GA91943@hoeg.nl> References: <1318884099-6005-1-git-send-email-lacombar@gmail.com> <20111017221933.GZ91943@hoeg.nl> <20111017222259.GA91943@hoeg.nl> Date: Mon, 17 Oct 2011 20:18:24 -0400 Message-ID: From: Arnaud Lacombe To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Current Subject: Re: [PATCH] Prepend timestamp in msgbuf X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2011 00:18:25 -0000 Hi, On Mon, Oct 17, 2011 at 6:22 PM, Ed Schouten 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. - Arnaud > -- > =A0Ed Schouten > =A0WWW: http://80386.nl/ >