From owner-freebsd-current@FreeBSD.ORG Mon Oct 17 19:38:12 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 00B36106564A for ; Mon, 17 Oct 2011 19:38:12 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8ECDA8FC0A for ; Mon, 17 Oct 2011 19:38:11 +0000 (UTC) Received: by vws11 with SMTP id 11so3954368vws.13 for ; Mon, 17 Oct 2011 12:38:10 -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=NBGp3qmRcFsRmXaK50Qx3RauYWAReGKNqvxPZAFWF58=; b=VIw4ZDrV8YLyusj9jjMKNcLvY6iF4mS7BFkZmjiQYfCnXFppc5mI3hGP7FyYSI8THm FrxJ8STnIqZ/ertnbMdYmTOWu15n2WkRwqohT5+VtpSTqJcyXJ5n50xlNoi31PU5iQox 6RN7qleU7AfyyecHKNSdVBRgpbT5Zb73mHIew= MIME-Version: 1.0 Received: by 10.182.8.10 with SMTP id n10mr12071642oba.36.1318880290710; Mon, 17 Oct 2011 12:38:10 -0700 (PDT) Received: by 10.182.122.33 with HTTP; Mon, 17 Oct 2011 12:38:10 -0700 (PDT) In-Reply-To: References: <20111014085609.GA3799@freebsd.org> <40448.1318582809@critter.freebsd.dk> <20111014092445.GA11785@freebsd.org> <20111014093406.GA13981@freebsd.org> <8662jrlor0.fsf@gmail.com> <20111017180111.GA91732@freebsd.org> Date: Mon, 17 Oct 2011 12:38:10 -0700 Message-ID: From: Garrett Cooper To: Arnaud Lacombe Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Nali Toja , Alexander Best , Poul-Henning Kamp , FreeBSD Current , Nikolay Denev Subject: Re: [RFC] 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: Mon, 17 Oct 2011 19:38:12 -0000 On Mon, Oct 17, 2011 at 12:27 PM, Arnaud Lacombe wrote= : > Hi, > > On Mon, Oct 17, 2011 at 2:01 PM, Alexander Best wro= te: >> On Fri Oct 14 11, Arnaud Lacombe wrote: >>> Hi, >>> >>> On Fri, Oct 14, 2011 at 8:52 AM, Nali Toja wrote: >>> > Alexander Best writes: >>> > >>> >>> On Fri Oct 14 11, Poul-Henning Kamp wrote: >>> >>> > In message <20111014085609.GA3799@freebsd.org>, Alexander Best wr= ites: >>> >>> > >>> >>> > >1) would it be possible to prepend those timestamps to the actua= l console >>> >>> > >output and not only to the output of demsg? maybe via a sysctl t= oggle? >>> >>> > >>> >>> > The kernel does not know enough about timezones to emit anything >>> >>> > but UTC timestamps. >>> >>> >>> >>> hmm ok. >>> >>> >>> >>> > >>> >>> > >2) my dmesg output contains a lot of these entries: "<118>" >>> >>> > >>> >>> > These are magic markers for syslogd(8) specifying priority. >>> >>> >>> >>> it would be nice, if their output could be turned off via a dmesg f= lag imo. >>> >>> >>> >>> > >>> >>> > >3) roughly the first 30 lines of my dmesg output have the timest= amp "[1.0]". >>> >>> > >would it be possible to have more accuracy there? >>> >>> > >>> >>> > No, because we don't know the time until we've found the RTC chip= . >>> >>> >>> >>> maybe prepending the output with [??] instead of [1.0] would make m= ore sense, >>> >>> so users knows that those timestamps are bogus. >>> >> >>> >> maybe the granularity of the timestamps could be limited to a static= value? the >>> >> following output doesn't really look pretty: >>> >> >>> >> [7.729516] <118>/dev/ufs/varfs: clean, 879143 free (7407 frags, 1089= 67 blocks, 0.7% fragmentation) >>> >> [7.891512] <118>Mounting local file systems:WARNING: TMPFS is consid= ered to be a highly experimental feature in FreeBSD. >>> >> [8.33519] . >>> >> [9.440514] <118>Setting hostname: otaku. >>> >> [9.744516] wlan0: Ethernet address: 00:0f:b5:82:07:c8 >>> >> [9.850516] <118>Starting wpa_supplicant. >>> >> [10.335514] <118>Starting Network: lo0 ath0. >>> >> >>> >> so it would be nice, if trailing zeros got printed out, too. >>> > >>> > Why not make formatting similar to linux/xorg logs, e.g. >>> > >>> > =A0[ =A0 =A031.897] (**) Option "XkbLayout" "us" >>> > =A0[ =A0 =A031.897] (II) XINPUT: Adding extended input device "" (type: KEYBOARD, id 7) >>> > =A0[ 11485.404] (II) 3rd Button detected: disabling emulate3Button >>> > >>> > =A0[ =A0 =A00.000000] Linux version 3.0-ARCH (tobias@T-POWA-LX) (gcc = version 4.6.1 20110819 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Aug 30 08:53= :25 CEST 2011 >>> > =A0[ =A0 =A00.000000] Command line: root=3D/dev/disk/by-uuid/625db1f5= -9b51-4d2d-acb7-6726f4d7e199 ro >>> > =A0[...] >>> > =A0[ =A0 15.096862] NET: Registered protocol family 10 >>> > =A0[ =A0 16.792594] [drm] nouveau 0000:01:00.0: plugged DVI-I-2 >>> > =A0[ =A0 26.054186] eth0: no IPv6 routers present >>> > >>> > A way to convert those timestamps to localtime or time delta[1] post-= mortem >>> > via dmesg(8) would be good, too. >>> > >>> well, I do not care for the "pretty" side of the thing, however, this >>> is just a matter length modifier in the string format; should be >>> trivial to fix. >> >> cc -c -O -pipe -march=3Dcore2 -std=3Dc99 -g -Wall -Wredundant-decls -Wne= sted-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winl= ine -Wcast-qual -Wundef -Wno-pointer-sign -Wmissing-include-dirs -nostdinc = =A0-I. -I/usr/git-freebsd-head/sys -I/usr/git-freebsd-head/sys/contrib/altq= -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -= finline-limit=3D8000 --param inline-unit-growth=3D100 --param large-functio= n-growth=3D1000 =A0-fno-omit-frame-pointer -mno-sse -mcmodel=3Dkernel -mno-= red-zone -mno-mmx -msoft-float -fno-asynchronous-unwind-tables -ffreestandi= ng -fformat-extensions -fdiagnostics-show-option -fstack-protector -Werror = =A0/usr/git-freebsd-head/sys/kern/subr_msgbuf.c >> cc1: warnings being treated as errors >> /usr/git-freebsd-head/sys/kern/subr_msgbuf.c: In function 'msgbuf_do_add= char': >> /usr/git-freebsd-head/sys/kern/subr_msgbuf.c:171: warning: format '%d' e= xpects type 'int', but argument 4 has type 'time_t' [-Wformat] >> *** Error code 1 >> >> Stop in /usr/obj/usr/git-freebsd-head/sys/ARUNDEL. >> *** Error code 1 >> >> Stop in /usr/git-freebsd-head. >> *** Error code 1 >> >> Stop in /usr/git-freebsd-head. >> > FreeBSD has no time_t PRI... macros in any , > eventually cast it to `long'. > > Btw, I appreciate the very clear message of yours, no "Hi", no > signature, no idea what "ARUNDEL" is, and especially no details on > which architecture you are attempting to build, which should be, I > assume, LP64 ;-) time_t maps to int32_t on i386 and int64_t on amd64 (at least), so you should be able to use "%zd" in the format string as the type is variable width depending on the architecture. Thanks, -Garrett