From: Pavel Filipenský Date: Wed, 3 May 2023 09:19:45 +0000 (+0200) Subject: s3:winbind: Add callback winbind_call_flow() X-Git-Tag: ldb-2.8.0~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b130e620faf0129ae4dbc456788aea693efa11e;p=thirdparty%2Fsamba.git s3:winbind: Add callback winbind_call_flow() Signed-off-by: Pavel Filipenský Reviewed-by: Stefan Metzmacher --- diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c index bed4e422796..3dbbc2f92fb 100644 --- a/source3/winbindd/winbindd_misc.c +++ b/source3/winbindd/winbindd_misc.c @@ -475,3 +475,39 @@ bool winbindd_reload_services_file(const char *lfile) return(ret); } + +static size_t *debug_call_depth = NULL; + +void winbind_debug_call_depth_setup(size_t *depth) +{ + debug_call_depth = depth; +} + +void winbind_call_flow(void *private_data, + enum tevent_thread_call_depth_cmd cmd, + struct tevent_req *req, + size_t depth, + const char *fname) +{ + switch (cmd) { + case TEVENT_CALL_FLOW_REQ_CREATE: + *debug_call_depth = depth; + DEBUG(20, ("flow: -> %s\n", fname)); + break; + case TEVENT_CALL_FLOW_REQ_NOTIFY_CB: + *debug_call_depth = depth; + DEBUG(20, ("flow: <- %s\n", fname)); + break; + case TEVENT_CALL_FLOW_REQ_QUEUE_TRIGGER: + *debug_call_depth = depth; + break; + case TEVENT_CALL_FLOW_REQ_RESET: + *debug_call_depth = depth; + break; + case TEVENT_CALL_FLOW_REQ_CANCEL: + case TEVENT_CALL_FLOW_REQ_CLEANUP: + case TEVENT_CALL_FLOW_REQ_QUEUE_ENTER: + case TEVENT_CALL_FLOW_REQ_QUEUE_LEAVE: + break; + } +} diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 46682ed0dab..6111b568116 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -34,6 +34,12 @@ bool winbindd_use_cache(void); void winbindd_set_use_cache(bool use_cache); char *get_winbind_priv_pipe_dir(void); void winbindd_flush_caches(void); +void winbind_debug_call_depth_setup(size_t *depth); +void winbind_call_flow(void *private_data, + enum tevent_thread_call_depth_cmd cmd, + struct tevent_req *req, + size_t depth, + const char *fname); bool winbindd_reload_services_file(const char *lfile); /* The following definitions come from winbindd/winbindd_ads.c */