Permit debug.malloc.failure_rate to be specified using a tunable so

that the feature can be enabled during the boot process.  Note the
continued limitation that FreeBSD fails so rapidly with this setting
enabled that it's hard to narrow down particular failures for
correction; we really need per-malloc type failure rates.
This commit is contained in:
Robert Watson 2003-03-26 20:44:29 +00:00
parent c26adbe322
commit f2538508f6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112692

View File

@ -151,6 +151,7 @@ static int malloc_nowait_count;
static int malloc_failure_count;
SYSCTL_INT(_debug_malloc, OID_AUTO, failure_rate, CTLFLAG_RW,
&malloc_failure_rate, 0, "Every (n) mallocs with M_NOWAIT will fail");
TUNABLE_INT("debug.malloc.failure_rate", &malloc_failure_rate);
SYSCTL_INT(_debug_malloc, OID_AUTO, failure_count, CTLFLAG_RD,
&malloc_failure_count, 0, "Number of imposed M_NOWAIT malloc failures");
#endif