From: Volker Lendecke Date: Tue, 21 Nov 2023 11:34:02 +0000 (+0100) Subject: profile: Pass dummy smbd_server_connection to smbprofile_dump() X-Git-Tag: tevent-0.17.0~344 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2601898257f9f930b03e29006e80b630262fcef;p=thirdparty%2Fsamba.git profile: Pass dummy smbd_server_connection to smbprofile_dump() It will need access to its fields soon. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme Reviewed-by: Guenther Deschner --- diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index c11b136535a..09fd5e474e2 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -25,6 +25,7 @@ #include #include "lib/util/time.h" +struct smbd_server_connection; struct tevent_context; #ifdef WITH_PROFILE @@ -558,7 +559,7 @@ static inline bool smbprofile_dump_pending(void) return true; } -void smbprofile_dump(void); +void smbprofile_dump(struct smbd_server_connection *sconn); void smbprofile_cleanup(pid_t pid, pid_t dst); void smbprofile_stats_accumulate(struct profile_stats *acc, @@ -645,7 +646,7 @@ static inline void smbprofile_dump_setup(struct tevent_context *ev) return; } -static inline void smbprofile_dump(void) +static inline void smbprofile_dump(struct smbd_server_connection *sconn) { return; } diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 7e139cd0648..70eeac8c8e1 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -173,7 +173,7 @@ static void smbprofile_dump_timer(struct tevent_context *ev, struct timeval current_time, void *private_data) { - smbprofile_dump(); + smbprofile_dump(NULL); } void smbprofile_dump_schedule_timer(void) @@ -210,7 +210,7 @@ static int profile_stats_parser(TDB_DATA key, TDB_DATA value, return 0; } -void smbprofile_dump(void) +void smbprofile_dump(struct smbd_server_connection *sconn) { pid_t pid = 0; TDB_DATA key = { .dptr = (uint8_t *)&pid, .dsize = sizeof(pid) }; diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c index cde0044d3d3..ed399199b87 100644 --- a/source3/smbd/server_exit.c +++ b/source3/smbd/server_exit.c @@ -213,7 +213,7 @@ static void exit_server_common(enum server_exit_reason how, client = NULL; netlogon_creds_cli_close_global_db(); TALLOC_FREE(global_smbXsrv_client); - smbprofile_dump(); + smbprofile_dump(NULL); global_messaging_context_free(); global_event_context_free(); TALLOC_FREE(smbd_memcache_ctx); diff --git a/source3/smbd/smb2_process.c b/source3/smbd/smb2_process.c index 6931bfba81c..67cc0978771 100644 --- a/source3/smbd/smb2_process.c +++ b/source3/smbd/smb2_process.c @@ -1856,7 +1856,7 @@ static void smbd_tevent_trace_callback_profile(enum tevent_trace_point point, * We need to flush our state after sleeping * (hopefully a long time). */ - smbprofile_dump(); + smbprofile_dump(NULL); /* * future profiling events should trigger timers * on our main event context.