Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 2002 14:00:16 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/43434: New option to 'dmesg' which allow to display or not old boot messages
Message-ID:  <200210012100.g91L0G55087824@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/43434; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: Brooks Davis <brooks@one-eyed-alien.net>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/43434: New option to 'dmesg' which allow to display or not
 old boot messages
Date: Wed, 2 Oct 2002 06:26:15 +1000 (EST)

 On Tue, 1 Oct 2002, Brooks Davis wrote:
 
 > On Tue, Oct 01, 2002 at 10:10:06AM -0700, Bruce Evans wrote:
 > >
 > >  What's wrong with ``grep [-C] <magic> /var/log/messages'' then? :-)
 > >  (except it doesn't handled rotated log files or races with newsyslog ...).
 > >
 >
 > 99+% of the time when a user types dmesg what they really want to see is:
 >
 > Copyright (c) 1992-2002 The FreeBSD Project.
 > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
 >         The Regents of the University of California. All rights
 > reserved.
 > FreeBSD 5.0-CURRENT #2: Thu Sep 26 14:33:02 PDT 2002
 >     root@minya.sea.one-eyed-alien.net:/usr/obj/usr/src/sys/GENERIC
 > Preloaded elf kernel "/boot/kernel/kernel" at 0xc06ca000.
 > Preloaded elf module "/boot/kernel/snd_maestro3.ko" at 0xc06ca0a8.
 > ...
 >
 > For the _current_ boot.  They couldn't care less about previous boots
 > unless they are looking for a message to diagnose a crash.  Currently if
 > you don't have extra debugging stuff on and you don't generate a lot of
 > errors, you typicaly find boot messages repeated several times, especialy
 > in -stable.  Thus you have to carefully scroll though the whole list to
 > find the current boot.  This change makes dmesg do what the user wants,
 > but allows access to the previous messages in the unlikely event they
 > are needed.
 
 I see.  The description in the PR is confusing -- it says that the last
 boot message is wanted, but actually the messages from the current boot
 are wanted.
 
 I think grep or an editor search is enough to find the start of the
 buffer.  This can be automated, preferably not by hacking on dmesg,
 but I wouldn't mind adding a tag that is easy to search for and likely
 to be unique for each boot.
 
 The implementation has a buffer overrun in subr_prf.c (when msg_bufx is
 near the end of the buffer at init time) and some style bugs.  Any tag
 should be written using an ordinary printf.
 
 Bruce
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210012100.g91L0G55087824>