Compare commits

...

1 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

View File

@@ -9063,8 +9063,7 @@ load_configuration(const char *filename, named_server_t *server,
{
named_g_memstatistics = cfg_obj_asboolean(obj);
} else {
named_g_memstatistics =
((isc_mem_debugging & ISC_MEM_DEBUGRECORD) != 0);
named_g_memstatistics = true;
}
obj = NULL;

View File

@@ -44,7 +44,7 @@ extern pthread_mutexattr_t isc__mutex_attrs;
* waiting to obtain the lock.
*/
#ifndef ISC_MUTEX_PROFILE
#define ISC_MUTEX_PROFILE 0
#define ISC_MUTEX_PROFILE 1
#endif
#if ISC_MUTEX_PROFILE

View File

@@ -53,7 +53,7 @@
/*@}*/
#define ISC_MUTEX_MAX_LOCKERS 32
#define ISC_MUTEX_MAX_LOCKERS 64
typedef struct {
const char * file;
@@ -75,7 +75,7 @@ struct isc_mutexstats {
};
#ifndef ISC_MUTEX_PROFTABLESIZE
#define ISC_MUTEX_PROFTABLESIZE (1024 * 1024)
#define ISC_MUTEX_PROFTABLESIZE (512 * 1024)
#endif
static isc_mutexstats_t stats[ISC_MUTEX_PROFTABLESIZE];
static int stats_next = 0;
@@ -85,6 +85,7 @@ static pthread_mutex_t statslock = PTHREAD_MUTEX_INITIALIZER;
void
isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) {
char strbuf[ISC_STRERRORSIZE];
int i, err;
err = pthread_mutex_init(&mp->mutex, NULL);
@@ -235,6 +236,7 @@ initialize_errcheck(void) {
void
isc_mutex_init_errcheck(isc_mutex_t *mp) {
char strbuf[ISC_STRERRORSIZE];
isc_result_t result;
int err;