Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jun 2020 18:51:02 +0000 (UTC)
From:      Enji Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r362591 - head/sys/kern
Message-ID:  <202006241851.05OIp2gh057898@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Jun 24 18:51:01 2020
New Revision: 362591
URL: https://svnweb.freebsd.org/changeset/base/362591

Log:
  Add `kern.features.witness`
  
  Adding `kern.features.witness` helps expose whether or not the kernel has
  `options WITNESS` enabled, so the `feature_present(3)` API can be used
  to query whether or not witness(9) is built into the kernel.
  
  This support is helpful with userspace applications (generally speaking,
  tests), as it can be queried to determine whether or not tests related
  to WITNESS should be run.
  
  MFC after:	1 week
  Reviewed by: cem, darrick.freebsd_gmail.com
  Differential Revision: https://reviews.freebsd.org/D25302
  Sponsored by:	DellEMC Isilon

Modified:
  head/sys/kern/subr_witness.c

Modified: head/sys/kern/subr_witness.c
==============================================================================
--- head/sys/kern/subr_witness.c	Wed Jun 24 18:40:43 2020	(r362590)
+++ head/sys/kern/subr_witness.c	Wed Jun 24 18:51:01 2020	(r362591)
@@ -361,6 +361,8 @@ static int	witness_output(const char *fmt, ...) __prin
 static int	witness_voutput(const char *fmt, va_list ap) __printflike(1, 0);
 static void	witness_setflag(struct lock_object *lock, int flag, int set);
 
+FEATURE(witness, "kernel has witness(9) support");
+
 static SYSCTL_NODE(_debug, OID_AUTO, witness, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
     "Witness Locking");
 



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