Commit c7a97f5f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Keep track of shmlog mutex contests


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1051 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 65049b17
......@@ -422,9 +422,6 @@ cli_func_t cli_func_dump_pool;
/* rfc2616.c */
int RFC2616_cache_policy(struct sess *sp, struct http *hp);
#define LOCKSHM(foo) AZ(pthread_mutex_lock(foo))
#define UNLOCKSHM(foo) AZ(pthread_mutex_unlock(foo))
#if 1
#define MTX pthread_mutex_t
#define MTX_INIT(foo) AZ(pthread_mutex_init(foo, NULL))
......
......@@ -16,6 +16,16 @@
#include "heritage.h"
#define LOCKSHM(foo) \
do { \
if (pthread_mutex_trylock(foo)) { \
AZ(pthread_mutex_lock(foo)); \
VSL_stats->shm_cont++; \
} \
} while (0);
#define UNLOCKSHM(foo) AZ(pthread_mutex_unlock(foo))
#ifndef MAP_HASSEMAPHORE
#define MAP_HASSEMAPHORE 0 /* XXX Linux */
#endif
......
......@@ -24,7 +24,6 @@ noinst_HEADERS = \
shmlog_tags.h \
stat_field.h \
stats.h \
tree.h \
varnish/assert.h \
varnishapi.h \
vcl.h \
......
......@@ -48,3 +48,5 @@ MAC_STAT(sess_closed, uint64_t, "u", "Session Closed")
MAC_STAT(sess_pipeline, uint64_t, "u", "Session Pipeline")
MAC_STAT(sess_readahead, uint64_t, "u", "Session Read Ahead")
MAC_STAT(sess_herd, uint64_t, "u", "Session herd")
MAC_STAT(shm_cont, uint64_t, "u", "SHM MTX contention")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment