s3:winbind: Add callback winbind_call_flow()
authorPavel Filipenský <pfilipensky@samba.org>
Wed, 3 May 2023 09:19:45 +0000 (11:19 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 19 Jul 2023 08:02:33 +0000 (08:02 +0000)
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/winbindd/winbindd_misc.c
source3/winbindd/winbindd_proto.h

index bed4e4227965f0fecc8f82dac07d98d2e1d98015..3dbbc2f92fb4b3f4bdd3d138a6faf48a392ac9f8 100644 (file)
@@ -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;
+       }
+}
index 46682ed0dabc1d968cd6de020bf2920e479f6023..6111b568116e86cf98b204557d3b96082055a0dc 100644 (file)
@@ -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  */