Date: Fri, 10 Aug 2018 15:29:06 +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: r337579 - head/sys/kern Message-ID: <201808101529.w7AFT69Y042414@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Fri Aug 10 15:29:06 2018 New Revision: 337579 URL: https://svnweb.freebsd.org/changeset/base/337579 Log: boot tagging: minor fixes msgbufinit may be called multiple times as we initialize the msgbuf into a progressively larger buffer. This doesn't happen as of now on head, but it may happen in the future and we generally support this. As such, only print the boot tag if we've just initialized the buffer for the first time. The boot tag also now has a newline appended to it for better visibility, and has been switched to a normal printf, by requesto f bde, after we've denoted that the msgbuf is mapped. Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Aug 10 15:16:41 2018 (r337578) +++ head/sys/kern/subr_prf.c Fri Aug 10 15:29:06 2018 (r337579) @@ -1033,20 +1033,24 @@ void msgbufinit(void *ptr, int size) { char *cp; - static struct msgbuf *oldp = NULL; + static struct msgbuf *oldp; + bool print_boot_tag; + oldp = NULL; size -= sizeof(*msgbufp); cp = (char *)ptr; + print_boot_tag = !msgbufmapped; /* Attempt to fetch kern.boot_tag tunable on first mapping */ if (!msgbufmapped) TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, sizeof(current_boot_tag)); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); - msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = true; + if (print_boot_tag) + printf("%s\n", current_boot_tag); oldp = msgbufp; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808101529.w7AFT69Y042414>