struct tdb_wrap *db;
struct tevent_context *ev;
struct tevent_timer *te;
+ struct smbd_server_connection *sconn;
} internal;
struct {
extern struct smbprofile_global_state smbprofile_state;
void smbprofile_dump_schedule_timer(void);
-void smbprofile_dump_setup(struct tevent_context *ev);
+void smbprofile_dump_setup(struct tevent_context *ev,
+ struct smbd_server_connection *sconn);
static inline void smbprofile_dump_schedule(void)
{
return false;
}
-static inline void smbprofile_dump_setup(struct tevent_context *ev)
+static inline void smbprofile_dump_setup(struct tevent_context *ev,
+ struct smbd_server_connection *sconn)
{
return;
}
return ok;
}
-void smbprofile_dump_setup(struct tevent_context *ev)
+void smbprofile_dump_setup(struct tevent_context *ev,
+ struct smbd_server_connection *sconn)
{
TALLOC_FREE(smbprofile_state.internal.te);
smbprofile_state.internal.ev = ev;
+ smbprofile_state.internal.sconn = sconn;
}
static void smbprofile_dump_timer(struct tevent_context *ev,
struct timeval current_time,
void *private_data)
{
- smbprofile_dump(NULL);
+ smbprofile_dump(smbprofile_state.internal.sconn);
}
void smbprofile_dump_schedule_timer(void)
struct smbd_tevent_trace_state {
struct tevent_context *ev;
TALLOC_CTX *frame;
+ struct smbd_server_connection *sconn;
SMBPROFILE_BASIC_ASYNC_STATE(profile_idle);
struct timeval before_wait_tv;
struct timeval after_wait_tv;
*
* Instead we want to sleep as long as nothing happens.
*/
- smbprofile_dump_setup(NULL);
+ smbprofile_dump_setup(NULL, NULL);
}
SMBPROFILE_BASIC_ASYNC_START(idle, profile_p, state->profile_idle);
break;
* We need to flush our state after sleeping
* (hopefully a long time).
*/
- smbprofile_dump(NULL);
+ smbprofile_dump(state->sconn);
/*
* future profiling events should trigger timers
* on our main event context.
*/
- smbprofile_dump_setup(state->ev);
+ smbprofile_dump_setup(state->ev, state->sconn);
}
break;
case TEVENT_TRACE_BEFORE_LOOP_ONCE:
if (sconn == NULL) {
exit_server("failed to create smbd_server_connection");
}
+ trace_state.sconn = sconn;
client->sconn = sconn;
sconn->client = client;
exit(1);
}
- smbprofile_dump_setup(ev_ctx);
+ smbprofile_dump_setup(ev_ctx, sconn);
if (!init_dptrs(sconn)) {
exit_server("init_dptrs() failed");