diff options
author | jmg <jmg@FreeBSD.org> | 2004-08-19 06:38:26 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2004-08-19 06:38:26 +0000 |
commit | bead871bc0f3ff80e8f33ef17761a029b9bbd474 (patch) | |
tree | 3c7134810ae9368ab3c523ee533b8e18fb367227 /sys/kern/kern_mutex.c | |
parent | 268e93a97ab7c72fc1761c0b603ddbc58df9ce01 (diff) | |
download | FreeBSD-src-bead871bc0f3ff80e8f33ef17761a029b9bbd474.zip FreeBSD-src-bead871bc0f3ff80e8f33ef17761a029b9bbd474.tar.gz |
add options MPROF_BUFFERS and MPROF_HASH_SIZE that adjust the sizes of
the mutex profiling buffers. Document them in the man page and in NOTES.
Ensure _HASH_SIZE is larger than _BUFFERS with a cpp error.
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r-- | sys/kern/kern_mutex.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 884eeda..c041886 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_adaptive_mutexes.h" #include "opt_ddb.h" +#include "opt_mprof.h" #include "opt_mutex_wake_all.h" #include <sys/param.h> @@ -118,10 +119,19 @@ struct mutex_prof { * * Note: NUM_MPROF_BUFFERS must be smaller than MPROF_HASH_SIZE. */ +#ifdef MPROF_BUFFERS +#define NUM_MPROF_BUFFERS MPROF_BUFFERS +#else #define NUM_MPROF_BUFFERS 1000 +#endif static struct mutex_prof mprof_buf[NUM_MPROF_BUFFERS]; static int first_free_mprof_buf; +#ifndef MPROF_HASH_SIZE #define MPROF_HASH_SIZE 1009 +#endif +#if NUM_MPROF_BUFFERS >= MPROF_HASH_SIZE +#error MPROF_BUFFERS must be larger than MPROF_HASH_SIZE +#endif static struct mutex_prof *mprof_hash[MPROF_HASH_SIZE]; /* SWAG: sbuf size = avg stat. line size * number of locks */ #define MPROF_SBUF_SIZE 256 * 400 |