Compare commits

...
Author SHA1 Message Date
Evan Hunt 1af069c318 add lock profiling 2020-03-23 16:12:48 -07:00
3 changed files with 6 additions and 5 deletions
+1 -2
View File
@@ -9063,8 +9063,7 @@ load_configuration(const char *filename, named_server_t *server,
{ {
named_g_memstatistics = cfg_obj_asboolean(obj); named_g_memstatistics = cfg_obj_asboolean(obj);
} else { } else {
named_g_memstatistics = named_g_memstatistics = true;
((isc_mem_debugging & ISC_MEM_DEBUGRECORD) != 0);
} }
obj = NULL; obj = NULL;
+1 -1
View File
@@ -44,7 +44,7 @@ extern pthread_mutexattr_t isc__mutex_attrs;
* waiting to obtain the lock. * waiting to obtain the lock.
*/ */
#ifndef ISC_MUTEX_PROFILE #ifndef ISC_MUTEX_PROFILE
#define ISC_MUTEX_PROFILE 0 #define ISC_MUTEX_PROFILE 1
#endif #endif
#if ISC_MUTEX_PROFILE #if ISC_MUTEX_PROFILE
+4 -2
View File
@@ -53,7 +53,7 @@
/*@}*/ /*@}*/
#define ISC_MUTEX_MAX_LOCKERS 32 #define ISC_MUTEX_MAX_LOCKERS 64
typedef struct { typedef struct {
const char * file; const char * file;
@@ -75,7 +75,7 @@ struct isc_mutexstats {
}; };
#ifndef ISC_MUTEX_PROFTABLESIZE #ifndef ISC_MUTEX_PROFTABLESIZE
#define ISC_MUTEX_PROFTABLESIZE (1024 * 1024) #define ISC_MUTEX_PROFTABLESIZE (512 * 1024)
#endif #endif
static isc_mutexstats_t stats[ISC_MUTEX_PROFTABLESIZE]; static isc_mutexstats_t stats[ISC_MUTEX_PROFTABLESIZE];
static int stats_next = 0; static int stats_next = 0;
@@ -85,6 +85,7 @@ static pthread_mutex_t statslock = PTHREAD_MUTEX_INITIALIZER;
void void
isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) { isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) {
char strbuf[ISC_STRERRORSIZE];
int i, err; int i, err;
err = pthread_mutex_init(&mp->mutex, NULL); err = pthread_mutex_init(&mp->mutex, NULL);
@@ -235,6 +236,7 @@ initialize_errcheck(void) {
void void
isc_mutex_init_errcheck(isc_mutex_t *mp) { isc_mutex_init_errcheck(isc_mutex_t *mp) {
char strbuf[ISC_STRERRORSIZE];
isc_result_t result; isc_result_t result;
int err; int err;