Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Aug 2018 01:32:10 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337518 - in head/sys: kern sys
Message-ID:  <201808090132.w791WAQm057199@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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, --<<BOOT>>--, 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 <aurelien.nephtali@wanadoo.fr> (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  "---<<BOOT>>---"
+
 #ifdef _KERNEL
 extern int	msgbufsize;
 extern int	msgbuftrigger;



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