summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-06-21 13:03:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:29 -0500
commit90773ab0be6030f249ac8b8cf65ad3e8141cbb42 (patch)
treebba43fa7f814947451ee8997751bff6fd09b3ca8 /source3/lib
parent1deb049a020cb2e804fc74e9b06f5c04f73005e8 (diff)
downloadsamba-90773ab0be6030f249ac8b8cf65ad3e8141cbb42.tar.gz
samba-90773ab0be6030f249ac8b8cf65ad3e8141cbb42.tar.bz2
samba-90773ab0be6030f249ac8b8cf65ad3e8141cbb42.zip
r23562: Add dump_event_list() for debugging the event list.
Guenther (This used to be commit 4e1e697ac48513719bd3a2152f17871bc00df796)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/events.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c
index 9b0a2b6712..09915a2dcd 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -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));
+ }
+}