* calls the appropriate stub to handle it.
*/
+#ifdef SLAPD_MONITOR
#define INCR_OP(var,index) \
do { \
ldap_pvt_thread_mutex_lock( &num_ops_mutex ); \
(var)[(index)]++; \
ldap_pvt_thread_mutex_unlock( &num_ops_mutex ); \
} while (0)
+#else /* !SLAPD_MONITOR */
+#define INCR_OP(var,index)
+#endif /* !SLAPD_MONITOR */
static void *
connection_operation( void *arg_v )
{
int rc;
struct co_arg *arg = arg_v;
- ber_tag_t tag = arg->co_op->o_tag, oldtag = tag;
+ ber_tag_t tag = arg->co_op->o_tag;
+#ifdef SLAPD_MONITOR
+ ber_tag_t oldtag = tag;
+#endif /* SLAPD_MONITOR */
Connection *conn = arg->co_conn;
ldap_pvt_thread_mutex_lock( &num_ops_mutex );
break;
}
+#ifdef SLAPD_MONITOR
oldtag = tag;
+#endif /* SLAPD_MONITOR */
if( rc == SLAPD_DISCONNECT ) tag = LBER_ERROR;
operations_error:
ldap_pvt_thread_mutex_lock( &num_ops_mutex );
num_ops_completed++;
+#ifdef SLAPD_MONITOR
switch (oldtag) {
case LDAP_REQ_BIND:
num_ops_completed_[SLAP_OP_BIND]++;
num_ops_completed_[SLAP_OP_EXTENDED]++;
break;
}
+#endif /* SLAPD_MONITOR */
ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
#endif
unsigned long num_ops_initiated = 0;
-unsigned long num_ops_initiated_[SLAP_OP_LAST];
unsigned long num_ops_completed = 0;
+#ifdef SLAPD_MONITOR
+unsigned long num_ops_initiated_[SLAP_OP_LAST];
unsigned long num_ops_completed_[SLAP_OP_LAST];
+#endif /* SLAPD_MONITOR */
ldap_pvt_thread_mutex_t num_ops_mutex;
unsigned long num_entries_sent;
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) num_ops_mutex;
LDAP_SLAPD_V (unsigned long) num_ops_completed;
-LDAP_SLAPD_V (unsigned long) num_ops_completed_[SLAP_OP_LAST];
LDAP_SLAPD_V (unsigned long) num_ops_initiated;
+#ifdef SLAPD_MONITOR
+LDAP_SLAPD_V (unsigned long) num_ops_completed_[SLAP_OP_LAST];
LDAP_SLAPD_V (unsigned long) num_ops_initiated_[SLAP_OP_LAST];
+#endif /* SLAPD_MONITOR */
LDAP_SLAPD_V (char *) slapd_pid_file;
LDAP_SLAPD_V (char *) slapd_args_file;