Bug 26746

Summary: dmesg only prints the last couple of lines of the message buffer
Product: Base System Reporter: td <td>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description td 2001-04-21 15:50:03 UTC
The dmesg only prints the last couple of lines from the message buffer, 
and the first line is only partially printed.

uib-vpn-gw# dmesg
p3
arplookup 192.168.0.1 failed: host is not on local network
arplookup 192.168.0.1 failed: host is not on local network
arplookup 192.168.0.1 failed: host is not on local network
arplookup 192.168.0.1 failed: host is not on local network
arplookup 192.168.0.1 failed: host is not on local network
uib-vpn-gw#

This is the rcsid of the dmesg with the trouble:
"$FreeBSD: src/sbin/dmesg/dmesg.c,v 1.11.2.1 2001/01/12 12:40:28 phk Exp $";

Copying an older dmesg from another box with the following rcsid,
fixes the problem:

"$FreeBSD: src/sbin/dmesg/dmesg.c,v 1.11 1999/08/28 00:12:36 peter Exp $";
Comment 1 dd freebsd_committer freebsd_triage 2001-04-29 04:00:41 UTC
State Changed
From-To: open->feedback

Did you try the -a option?
Comment 2 trond.davidsen 2001-04-29 14:03:50 UTC
dmesg -a gives the expected output (~450 lines).  But I can't see
anything in the man page that explains why I get only ~3 lines when I
use dmesg without any commandline options.

Trond
Comment 3 Bruce Evans 2001-04-30 01:36:45 UTC
On Sun, 29 Apr 2001, Trond Davidsen wrote:

>  dmesg -a gives the expected output (~450 lines).  But I can't see
>  anything in the man page that explains why I get only ~3 lines when I
>  use dmesg without any commandline options.

Maybe there is on 3 lines left after removing the extras printed by -a.

ISTR seeing this behaviour while using dmesg in single user mode.  This
seemed to be caused by the message buffer filling up and either the
internal wrap-around not working or dmesg not understanding the wrap-
around.

Bruce
Comment 4 trond.davidsen 2001-04-30 14:43:38 UTC
> 
> ISTR seeing this behaviour while using dmesg in single user mode.  This
> seemed to be caused by the message buffer filling up and either the
> internal wrap-around not working or dmesg not understanding the wrap-
> around.
> 
> Bruce

This box is used as a vpn server, with lots of ipfw logging, so the
message buffer has definitly wraped around.  I think both of the
scenarios you mention is wrong, and either should be documented, or
dmesg should be fixed to give the pre -a behaviour when called without
parameters.

Trond
Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 2002-01-17 16:12:05 UTC
State Changed
From-To: feedback->closed

Automatic feedback timeout.  If additional feedback that warrants 
the re-opening of this PR is available but not included in the 
audit trail, please include the feedback in a reply to this message 
(preserving the Subject line) and ask that the PR be re-opened.