s3:smbd: readd START_PROFILE(smbd_idle)/END_PROFILE(smbd_idle)
authorStefan Metzmacher <metze@samba.org>
Fri, 8 Jun 2012 12:07:51 +0000 (14:07 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 9 Jun 2012 10:09:17 +0000 (12:09 +0200)
metze

source3/smbd/process.c

index 30d0354223939b893f8d5365cff74bed0ad351f4..5e26826d6a96e573bf30df707b22d90e396c5665 100644 (file)
@@ -3159,6 +3159,19 @@ NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
        return NT_STATUS_OK;
 }
 
+static void smbd_tevent_trace_callback(enum tevent_trace_point point,
+                                      void *private_data)
+{
+       switch (point) {
+       case TEVENT_TRACE_BEFORE_WAIT:
+               START_PROFILE(smbd_idle);
+               break;
+       case TEVENT_TRACE_AFTER_WAIT:
+               END_PROFILE(smbd_idle);
+               break;
+       }
+}
+
 /****************************************************************************
  Process commands from the client
 ****************************************************************************/
@@ -3496,6 +3509,8 @@ void smbd_process(struct tevent_context *ev_ctx,
 
        TALLOC_FREE(frame);
 
+       tevent_set_trace_callback(ev_ctx, smbd_tevent_trace_callback, NULL);
+
        while (True) {
                frame = talloc_stackframe_pool(8192);