Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 2015 23:58:03 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287183 - head/sys/kern
Message-ID:  <201508262358.t7QNw3kX026176@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Wed Aug 26 23:58:03 2015
New Revision: 287183
URL: https://svnweb.freebsd.org/changeset/base/287183

Log:
  When the kernel is compiled with INVARIANTS, export that as
  debug.invariants.
  
  Differential Revision: https://reviews.freebsd.org/D3488
  MFC after: 3 days

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Wed Aug 26 23:45:06 2015	(r287182)
+++ head/sys/kern/init_main.c	Wed Aug 26 23:58:03 2015	(r287183)
@@ -117,6 +117,15 @@ int	bootverbose = BOOTVERBOSE;
 SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0,
 	"Control the output of verbose kernel messages");
 
+/* Want to avoid defining INVARIANTS if not already defined */
+#ifdef INVARIANTS
+static int	invariants = 1;
+#else
+static int	invariants = 0;
+#endif
+SYSCTL_INT(_debug, OID_AUTO, invariants, CTLFLAG_RD, &invariants, 0,
+	"Kernel compiled with invariants");
+
 /*
  * This ensures that there is at least one entry so that the sysinit_set
  * symbol is not undefined.  A sybsystem ID of SI_SUB_DUMMY is never



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