diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2018-08-09 17:47:47 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2018-08-09 17:47:47 +0000 |
commit | 2a4650cc117cdbda17c26257d5084c3083635308 (patch) | |
tree | 5ee3c4c3d7f14b097ef6c1142b2d97dedabb4df6 /sys/kern/subr_prf.c | |
parent | 21aa6e834558d085efe22f754f7086a01d7ca1b9 (diff) | |
download | src-2a4650cc117cdbda17c26257d5084c3083635308.tar.gz src-2a4650cc117cdbda17c26257d5084c3083635308.zip |
Notes
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r-- | sys/kern/subr_prf.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 666677c4453c..041d9dc332ff 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -124,6 +124,18 @@ static bool msgbufmapped; /* Set when safe to use msgbuf */ int msgbuftrigger; struct msgbuf *msgbufp; +#ifndef BOOT_TAG_SZ +#define BOOT_TAG_SZ 32 +#endif +#ifndef BOOT_TAG +/* Tag used to mark the start of a boot in dmesg */ +#define BOOT_TAG "---<<BOOT>>---" +#endif + +static char current_boot_tag[BOOT_TAG_SZ + 1] = BOOT_TAG; +SYSCTL_STRING(_kern, OID_AUTO, boot_tag, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + current_boot_tag, 0, "Tag added to dmesg at start of boot"); + static int log_console_output = 1; SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RWTUN, &log_console_output, 0, "Duplicate console output to the syslog"); @@ -1025,9 +1037,13 @@ msgbufinit(void *ptr, int size) size -= sizeof(*msgbufp); cp = (char *)ptr; + /* Attempt to fetch kern.boot_tag tunable on first mapping */ + if (!msgbufmapped) + TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, + BOOT_TAG_SZ + 1); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); - msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); + msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = true; |