From owner-svn-src-all@freebsd.org Thu Aug 9 01:32:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEB791073010; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 751B277663; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5752812AB5; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w791WAWt057201; Thu, 9 Aug 2018 01:32:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w791WAQm057199; Thu, 9 Aug 2018 01:32:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090132.w791WAQm057199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 01:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337518 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 337518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list 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: , X-List-Received-Date: Thu, 09 Aug 2018 01:32:10 -0000 Author: kevans Date: Thu Aug 9 01:32:09 2018 New Revision: 337518 URL: https://svnweb.freebsd.org/changeset/base/337518 Log: kern: Add a BOOT_TAG marker at the beginning of boot dmesg From the "newly licensed to drive" PR department, add a BOOT_TAG marker (by default, --<>--, to the beginning of each boot's dmesg. This makes it easier to do textproc magic to locate the start of each boot and, of particular interest to some, the dmesg of the current boot. The PR has a dmesg(8) component as well that I've opted not to include for the moment- it was the more contentious part of this PR. bde@ also made the statement that this boot tag should be written with an ordinary printf, which I've- for the moment- declined to change about this patch to keep it more transparent to observer of the boot process. PR: 43434 Submitted by: dak (basically rewritten) MFC after: maybe never Modified: head/sys/kern/subr_prf.c head/sys/sys/msgbuf.h Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 01:17:35 2018 (r337517) +++ head/sys/kern/subr_prf.c Thu Aug 9 01:32:09 2018 (r337518) @@ -1027,6 +1027,7 @@ msgbufinit(void *ptr, int size) cp = (char *)ptr; msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); + msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = 1; Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Thu Aug 9 01:17:35 2018 (r337517) +++ head/sys/sys/msgbuf.h Thu Aug 9 01:32:09 2018 (r337518) @@ -60,6 +60,9 @@ struct msgbuf { /* Subtract sequence numbers. Note that only positive values result. */ #define MSGBUF_SEQSUB(mbp, seq1, seq2) (MSGBUF_SEQNORM((mbp), (seq1) - (seq2))) +/* Tag used to mark the start of a boot in dmesg */ +#define BOOT_TAG "---<>---" + #ifdef _KERNEL extern int msgbufsize; extern int msgbuftrigger;