]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
profile: Pass dummy smbd_server_connection to smbprofile_dump()
authorVolker Lendecke <vl@samba.org>
Tue, 21 Nov 2023 11:34:02 +0000 (12:34 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 11 Apr 2025 18:46:40 +0000 (18:46 +0000)
It will need access to its fields soon.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/include/smbprofile.h
source3/profile/profile.c
source3/smbd/server_exit.c
source3/smbd/smb2_process.c

index c11b136535a4a4183ded2fd04769ba14bdc5e272..09fd5e474e2cad89891dc455ee2707e46b6057c5 100644 (file)
@@ -25,6 +25,7 @@
 #include <tdb.h>
 #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;
 }
index 7e139cd06487b59929092879e250e350ab1673c0..70eeac8c8e19e07a347d87dd338616dda67f9b5b 100644 (file)
@@ -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) };
index cde0044d3d3e5e5b8aee5b0da5830e8a1a3bfb4a..ed399199b87bba4859229fceb457efa20fbb6ae9 100644 (file)
@@ -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);
index 6931bfba81c1cb05049238eff2d8746023e3d395..67cc0978771c2f62da31e433ec3e2b3e34e6cd86 100644 (file)
@@ -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.