From nobody Tue Nov 22 16:16:55 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NGqCG3Ybcz4j07X for ; Tue, 22 Nov 2022 16:16:58 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NGqCG0cbwz3HVw for ; Tue, 22 Nov 2022 16:16:57 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (123-1-88-210.area1b.commufa.jp [123.1.88.210]) (authenticated bits=0) by www121.sakura.ne.jp (8.16.1/8.16.1/[SAKURA-WEB]/20201212) with ESMTPA id 2AMGGtfc069002; Wed, 23 Nov 2022 01:16:55 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Wed, 23 Nov 2022 01:16:55 +0900 From: Tomoaki AOKI To: Dan Mack Cc: Alexander Kabaev , freebsd-current@freebsd.org Subject: Re: dmesg content lifetime Message-Id: <20221123011655.c6a00ee21636e45e8b4f3a69@dec.sakura.ne.jp> In-Reply-To: References: <9d519f-ce87-72d-dc6-789817468974@macktronics.com> <20221122104445.4ed88f6f@kan> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4NGqCG0cbwz3HVw X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, 22 Nov 2022 09:47:10 -0600 (CST) Dan Mack wrote: > On Tue, 22 Nov 2022, Alexander Kabaev wrote: > > > On Tue, 22 Nov 2022 09:12:28 -0600 (CST) > > Dan Mack wrote: > > > >> It seems like dmesg content ages out over time. Is there a way to > >> leave the contents based on a fixed memory size instead? > >> > >> Dan > >> > > I think this is how it works: the kernel message bugger is of fixed > > size and kernel and syslog sequences (dmesg -a) share it. The other > > syslog users eventually puts enough content in there to displace all of > > kernel messages. If the kernel stays quiet, 'dmesg' then returns > > nothing, as by default it filters syslog entries that do not KERN > > facility out, see sbin/dmesg/dmesg.c. > > > > -- > > Alexander Kabaev > > > > Thank you Alexander, I did not know this. I'll USL (use-the-source-luke) > :-) > > Dan Increase kern.msgbufsize tunable on /boot/loader.conf if you want dmesg to live longer. For example, recommended value by iwlwifi team is 1146880. Much larger than default. Note that this is actually a tunable and can be set only on boot time. -- Tomoaki AOKI