From owner-svn-src-all@freebsd.org Tue Sep 3 14:06:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE03DDBFD6; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ym16Dzz4Nw8; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8F9BA19CFD; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E921E53B1; Fri, 29 Mar 2019 10:57:41 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6561C89FFE; Fri, 29 Mar 2019 10:57:41 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0FADB5373; Fri, 29 Mar 2019 10:57:41 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 80A58536C; Fri, 29 Mar 2019 10:57:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id D830189FF0; Fri, 29 Mar 2019 10:57:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 2EEBEC785; Fri, 29 Mar 2019 21:57:34 +1100 (AEDT) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexey Dokuchaev cc: Bruce Evans , Ravi Pokala , svn-src-head@freebsd.org, Kyle Evans , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r345680 - head/sys/conf In-Reply-To: <20190329094903.GA12522@FreeBSD.org> Message-ID: <20190329205849.E1647@besplex.bde.org> References: <201903290400.x2T40kp7013212@repo.freebsd.org> <20190329164644.X957@besplex.bde.org> <20190329094903.GA12522@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=i80GM_YtHSBQfDR70X0A:9 a=CjuIK1q_8ugA:10 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 6561C89FFE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:06 -0000 X-Original-Date: Fri, 29 Mar 2019 21:57:32 +1100 (EST) X-List-Received-Date: Tue, 03 Sep 2019 14:06:06 -0000 On Fri, 29 Mar 2019, Alexey Dokuchaev wrote: > On Fri, Mar 29, 2019 at 05:40:05PM +1100, Bruce Evans wrote: >>>> ... >>>> -options BOOT_TAG=\"---<>---\" >>>> +options BOOT_TAG=\"\" >> >> Useful variations are not always easy to invent. I usually just add 1 for >> numeric values. This example is useful. It kills the boot tag. It gives >> an empty tag, and the kernel does extra work to avoid printing a newline >> after an empty tag. > > That's a nice idea, thanks Bruce. I always had to revert commits that had > added this stupid boot tag; if empty tag does not imply a newline, then it > makes things much easier. > > ./danfe > > P.S. Boot tag of a healthy human is "Copyright (c) 1992-2018 The FreeBSD > Project". Actually, there are ordering problems. After fixing lost messages, I get for the simplest case of a non-verbose cold boot: XX Mar 29 19:14:08 gamplex syslogd: kernel boot file is /kernel This boot file message is the first one. I often grep for it, so as to ignore messages for previous boots. XX Mar 29 19:14:08 gamplex kernel: ---<>--- This is almost first. XX Mar 29 19:14:08 gamplex kernel: Test of early printf to msgbuf XX Mar 29 19:14:08 gamplex kernel: Test of early printf to console Tests for my fixes. msgbufinit() is called early and uses a statically allocated buffer until the dynamic message buffer is mapped. Early messages are thus not lost for the message buffer. They may be lost for the console. XX Mar 29 19:14:08 gamplex kernel: GDB: debug ports: sio XX Mar 29 19:14:08 gamplex kernel: GDB: current port: sio XX Mar 29 19:14:08 gamplex kernel: KDB: debugger backends: ddb gdb XX Mar 29 19:14:08 gamplex kernel: KDB: current backend: ddb Standard early messages if DDB is configured. XX Mar 29 19:14:08 gamplex kernel: WARNING: loader(8) metadata is missing! I don't use loader on i386, and am reminded that I don't like it by this warning. XX Mar 29 19:14:08 gamplex kernel: Copyright (c) 1992-2019 The FreeBSD Project. Finally the copyright message. The source code still obfuscates the order of this using SYSINIT(), and on x86 and powerpc still has a bogus "Good {morning,afternoon,evening, night}" comment that isn't even attached to its code (the printf() of the message). The comment is in cpu_startup() which runs at SI_SUB_CPU, SI_ORDER_FIRST. This is much later than printing the copyright, which runs at SI_SUB_COPYRIGHT. In between, there are SUBs for VM, KMEM, HYPERISOR, WITNESS, MTX_POOL_DYNAMIC, LOCK, EVENTHANDLER, VNET_PRELINK and KLD. Before COPYRIGHT, there are only DUMMY, DONE and TUNABLES under sysinit, but lots more in early initialization including early console use for the above messages and ddb. The comment on SI_SUB_COPYRIGHT wrongly says that it is for the first use of the console. Booting with -v gives many more early messages that are usually lost. E.g., ones about SMAP on x86. Warm boots sometimes give a dynamic message buffer that is actually useful. To be useful, it must be retained at boot. Otherwise, it is easier to put the message buffer in the bss. The dynamic message buffer only works for me on amd64 and i386 with pae_mode=1 (and probably also more than 4GB RAM). Otherwise, it is below 4GB and the BIOS scribbles on it (fairly sparsely, but it doesn't have enough error correcting to recover). Recovering it fixes loss of the last few messages for the previous boot, but risks doubling of non-lost messages. The BOOT tags are useful for seeing where the new messages start. Everything usually works as well as possible: XX Mar 25 02:59:49 iotaplex syslogd: exiting on signal 15 The use of an amd64 kernel a few days ago was terminated by turning the system off. Messages printed after killing syslogd were lost. XX Mar 29 21:33:49 iotaplex syslogd: kernel boot file is /boot/kernel/kernel XX Mar 29 21:33:49 iotaplex kernel: ---<>--- XX Mar 29 21:33:49 iotaplex kernel: Test of early printf to msgbuf XX Mar 29 21:33:49 iotaplex kernel: GDB: debug ports: sio XX Mar 29 21:33:49 iotaplex kernel: GDB: current port: sio XX Mar 29 21:33:49 iotaplex kernel: KDB: debugger backends: ddb gdb XX Mar 29 21:33:49 iotaplex kernel: KDB: current backend: ddb XX Mar 29 21:33:49 iotaplex kernel: Copyright (c) 1992-2019 The FreeBSD Project. Cold boot of the same kernel today (actually, i386 was running before this, but the boot was cold enough for the message buffer). XX ... XX Mar 29 21:34:32 iotaplex syslogd: exiting on signal 15 As usual, messages printed after killing syslogd are not logged properly... XX Mar 29 21:35:55 iotaplex syslogd: kernel boot file is /boot/kernel/kernel Warm boot of the same amd64 kernel. XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system process `vnlru' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system process `syncer' to stop... XX Mar 29 21:35:55 iotaplex kernel: Syncing disks, vnodes remaining... 0 0 0 done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufdaemon' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufspacedaemon-0' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufspacedaemon-1' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufspacedaemon-2' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufspacedaemon-3' to stop... done XX Mar 29 21:35:55 iotaplex kernel: All buffers synced. ... the new boot finds the lost messages in the old message buffer and logs them. It also finds non-lost messages and the old klog pointer so it knows to not log the non-lost messages again. Everything is as correct as possible except for the timestamps (these are for when the new syslogd reads the messages, not for the events logged by printing the messages). XX Mar 29 21:35:55 iotaplex kernel: ---<>--- XX Mar 29 21:35:55 iotaplex kernel: Test of early printf to msgbuf No "Test of early printf to console" on amd64, since I only do this for i386. XX Mar 29 21:35:55 iotaplex kernel: GDB: debug ports: sio XX Mar 29 21:35:55 iotaplex kernel: GDB: current port: sio XX Mar 29 21:35:55 iotaplex kernel: KDB: debugger backends: ddb gdb XX Mar 29 21:35:55 iotaplex kernel: KDB: current backend: ddb These debugging messages are always before all SYSINIT()s so long before the COPYRIGHT one. XX Mar 29 21:35:55 iotaplex kernel: Copyright (c) 1992-2019 The FreeBSD Project. Continuing with the warm boot. The tag is correctly placed for delimiting messages printed by the new boot. Bruce