From owner-freebsd-stable Tue Mar 20 9:11:12 2001 Delivered-To: freebsd-stable@freebsd.org Received: from mail.gmx.net (pop.gmx.net [194.221.183.20]) by hub.freebsd.org (Postfix) with SMTP id 9A97537B71F for ; Tue, 20 Mar 2001 09:11:08 -0800 (PST) (envelope-from tmoestl@gmx.net) Received: (qmail 7470 invoked by uid 0); 20 Mar 2001 17:10:59 -0000 Received: from p3e9e0375.dip.t-dialin.net (HELO forge.local) (62.158.3.117) by mail.gmx.net (mp027-rz3) with SMTP; 20 Mar 2001 17:10:59 -0000 Received: from tmm by forge.local with local (Exim 3.20 #1) id 14fPfB-0000dj-00; Tue, 20 Mar 2001 18:11:17 +0100 Date: Tue, 20 Mar 2001 18:11:17 +0100 From: Thomas Moestl To: Noel Koethe Cc: Thomas Moestl , freebsd-stable@freebsd.org Subject: Re: dmesg output Message-ID: <20010320181117.A2347@crow.dom2ip.de> Mail-Followup-To: Thomas Moestl , Noel Koethe , Thomas Moestl , freebsd-stable@freebsd.org References: <20010320172534.A1977@crow.dom2ip.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from noel@koethe.net on Tue, Mar 20, 2001 at 05:36:49PM +0100 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Mar 20, 2001 at 05:36:49PM +0100, Noel Koethe wrote: > On Tue, 20 Mar 2001, Thomas Moestl wrote: > > > since some weeks my dmesg output is broken: > > > # dmesg > > > 2250 192.168.159.255:138 in via xl0 > > > > > > Maybe someone can give me a hint to fix it if the problem is located at my > > > machine. > > > > Try "dmesg -a". The messages are stored in a ring buffer, so the > > oldest ones will be overwritten if the buffer fills up. Additionally, > > dmesg will normally not show the console output that is also stored in > > the message buffer. This produces these effects. > > This is starting to become a FAQ... > > dmesg -a works. Thx. > But on another machine dmesg still works: > # dmesg > Copyright (c) 1992-2001 The FreeBSD Project. > ... > icmp-response bandwidth limit 522/200 pps > icmp-response bandwidth limit 861/200 pps > ad0: READ command timeout tag=0 serv=0 - resetting > ata0: resetting devices .. done > ad0: UDMA ICRC READ ERROR blk# 13939543 retrying > ad0: READ command timeout tag=0 serv=0 - resetting > ata0: resetting devices .. done > > Why it is here normal on one machine and cutted on the other? > And why does it work before ( I'm sure in December it doesn't work like > now )? OK, I'll go into details a little more. Not too long ago, a patch was MFCed that allows logging console output. To allow this, this ouput is written into the kernel message buffer, where it can be picked up by syslog using the /dev/klog interface. Normal kernel output is written to the message buffer as is, while console output is prefixed with a string in the form "", where category is a number (118 in this case, LOG_CONSOLE|LOG_INFO). dmesg will ignore messages that start with such a string indicating that the message didn't come from the kernel unless it is invoked with the -a option. If syslogd is configured to echo some messages to the console, those messages will be appended to the kernel message buffer, and if this happens too often, this will overwrite all the kernel messages. A common situation is that a lot of kernel messages are generated that fill up the message buffer, syslog snarfs those a little later, writes them to the console and thus overwrites the original kernel messages in turn. dmesg will show nothing in this case, or, more often, a line that came from the console, but of which the first character(s) were overwritten by a new message (they don't start with a "" magic string then, and dmesg will print them). So, dmesg will work as expected on machines that didn't generate enough messages yet, or on systems from before the MFC. - thomas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message