From: Günther Deschner Date: Thu, 21 Jun 2007 13:03:27 +0000 (+0000) Subject: r23562: Add dump_event_list() for debugging the event list. X-Git-Tag: samba-4.0.0alpha6~801^2~5580 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90773ab0be6030f249ac8b8cf65ad3e8141cbb42;p=thirdparty%2Fsamba.git r23562: Add dump_event_list() for debugging the event list. Guenther (This used to be commit 4e1e697ac48513719bd3a2152f17871bc00df796) --- diff --git a/source3/lib/events.c b/source3/lib/events.c index 9b0a2b67126..09915a2dcde 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)); + } +}