]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb2/timing.c
Change 'unsigned long len' to ber_len_t in get_filter()
[openldap] / servers / slapd / back-bdb2 / timing.c
index fd08a4f63b6a060f930e901e2fa5a0a127474bc5..f707e4527618ffaf3e328291c462b544eb6ddd59 100644 (file)
@@ -3,16 +3,16 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/time.h>
-#include <unistd.h>
 
 #include <ac/string.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
 
 #include "slap.h"
 #include "back-bdb2.h"
 
 
-char *
+static char *
 bdb2i_elapsed( struct timeval firsttime,  struct timeval secondtime )
 {
     long int elapsedmicrosec, elapsedsec;
@@ -26,47 +26,44 @@ bdb2i_elapsed( struct timeval firsttime,  struct timeval secondtime )
     }
 
     sprintf( elapsed_string, "%ld.%.6ld", elapsedsec, elapsedmicrosec );
-    return( strdup( elapsed_string ));
+    return( ch_strdup( elapsed_string ));
 }
 
 
 void
-bdb2i_start_timing(
-       BackendInfo     *bi,
+bdb2i_uncond_start_timing(
        struct timeval  *time1
 )
 {
-       if ( with_timing( bi )) gettimeofday( time1, NULL );
+       gettimeofday( time1, NULL );
 }
 
 
 void
-bdb2i_stop_timing(
-       BackendInfo     *bi,
+bdb2i_uncond_stop_timing(
        struct timeval  time1,
        char            *func,
        Connection      *conn,
-       Operation       *op
+       Operation       *op,
+       int             level
 )
 {
-       if ( with_timing( bi )) {
-               struct timeval  time2;
-               char            *elapsed_time;
-               char            buf[BUFSIZ];
+       struct timeval  time2;
+       char            *elapsed_time;
+       char            buf[BUFSIZ];
 
-               *buf = '\0';
+       *buf = '\0';
 
-               gettimeofday( &time2, NULL);
-               elapsed_time = bdb2i_elapsed( time1, time2 );
+       gettimeofday( &time2, NULL);
+       elapsed_time = bdb2i_elapsed( time1, time2 );
 
-               if ( conn != NULL ) sprintf( buf, "conn=%d ", conn->c_connid );
-               if ( op != NULL )   sprintf( buf, "%sop=%d ", buf, op->o_opid );
+       if ( conn != NULL ) sprintf( buf, "conn=%d ", conn->c_connid );
+       if ( op != NULL )   sprintf( buf, "%sop=%d ", buf, op->o_opid );
 
-               Debug( LDAP_DEBUG_ANY, "%s%s elapsed=%s\n", buf, func, elapsed_time );
+       Debug( level, "%s%s elapsed=%s\n", buf, func, elapsed_time );
 
-               free( elapsed_time );
+       free( elapsed_time );
 
-       }
 }