r23562: Add dump_event_list() for debugging the event list.
authorGünther Deschner <gd@samba.org>
Thu, 21 Jun 2007 13:03:27 +0000 (13:03 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:29 +0000 (12:23 -0500)
Guenther
(This used to be commit 4e1e697ac48513719bd3a2152f17871bc00df796)

source3/lib/events.c

index 9b0a2b6712609750227bc92fb28d186eb5de45ca..09915a2dcde70447d6eab1d4cee5d2bd751bee52 100644 (file)
@@ -391,3 +391,27 @@ int cancel_named_event(struct event_context *event_ctx,
        }
        return 0;
 }
+
+void dump_event_list(struct event_context *event_ctx)
+{
+       struct timed_event *te;
+       struct timeval evt, now;
+
+       if (!event_ctx) {
+               return;
+       }
+
+       now = timeval_current();
+
+       DEBUG(10,("dump_event_list:\n"));
+
+       for (te = event_ctx->timed_events; te; te = te->next) {
+
+               evt = timeval_until(&now, &te->when);
+
+               DEBUGADD(10,("Event \"%s\" %lx handled in %d seconds\n",
+                          te->event_name,
+                          (unsigned long)te,
+                          (int)evt.tv_sec));
+       }
+}