From cd260391fae7888de0e6e1be64eebb50f399525b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 20 Jun 2012 08:53:10 +0200 Subject: s3:smbd: fix the build with the --with-profiling-data option metze --- source3/smbd/globals.h | 2 ++ source3/smbd/process.c | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 8113b8ebbb..0164cb627d 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -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, diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 9e1abb268c..465f429747 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -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); -- cgit