s3:smbd: fix the build with the --with-profiling-data option
authorStefan Metzmacher <metze@samba.org>
Wed, 20 Jun 2012 06:53:10 +0000 (08:53 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 20 Jun 2012 10:58:58 +0000 (12:58 +0200)
metze

source3/smbd/globals.h
source3/smbd/process.c

index 8113b8ebbb332d5bf5b6e8f66a73c524dc5f6eea..0164cb627dbe5f766385a65f7d20aec4f00597d3 100644 (file)
@@ -352,6 +352,8 @@ struct smbXsrv_connection {
        } smb2;
 
        struct msg_state *msg_state;
+
+       uint64_t smbd_idle_profstamp;
 };
 
 NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
index 9e1abb268cd369547c4de6d74174d29e7b2025f7..465f429747098633a99860e6dccea10d05838ed7 100644 (file)
@@ -3166,12 +3166,16 @@ NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
 static void smbd_tevent_trace_callback(enum tevent_trace_point point,
                                       void *private_data)
 {
+       struct smbXsrv_connection *conn =
+               talloc_get_type_abort(private_data,
+               struct smbXsrv_connection);
+
        switch (point) {
        case TEVENT_TRACE_BEFORE_WAIT:
-               START_PROFILE(smbd_idle);
+               START_PROFILE_STAMP(smbd_idle, conn->smbd_idle_profstamp);
                break;
        case TEVENT_TRACE_AFTER_WAIT:
-               END_PROFILE(smbd_idle);
+               END_PROFILE_STAMP(smbd_idle, conn->smbd_idle_profstamp);
                break;
        }
 }
@@ -3513,7 +3517,7 @@ void smbd_process(struct tevent_context *ev_ctx,
 
        TALLOC_FREE(frame);
 
-       tevent_set_trace_callback(ev_ctx, smbd_tevent_trace_callback, NULL);
+       tevent_set_trace_callback(ev_ctx, smbd_tevent_trace_callback, conn);
 
        while (True) {
                frame = talloc_stackframe_pool(8192);