summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_timed.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-05 19:52:47 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-05 22:44:54 +0100
commite83a55c35643af2dad8e11bd51797908a6224451 (patch)
treed0d941982c176e4b06be2ab5378cabeff499722d /lib/tevent/tevent_timed.c
parentb09718fef22ba6805482e85fd0b0e339f19d2324 (diff)
downloadsamba-e83a55c35643af2dad8e11bd51797908a6224451.tar.gz
samba-e83a55c35643af2dad8e11bd51797908a6224451.tar.bz2
samba-e83a55c35643af2dad8e11bd51797908a6224451.zip
tevent: add some debugging for timer events, that mostly matches samba3
metze
Diffstat (limited to 'lib/tevent/tevent_timed.c')
-rw-r--r--lib/tevent/tevent_timed.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/tevent/tevent_timed.c b/lib/tevent/tevent_timed.c
index 78c8a24511..6f28159ed2 100644
--- a/lib/tevent/tevent_timed.c
+++ b/lib/tevent/tevent_timed.c
@@ -108,9 +108,14 @@ bool ev_timeval_is_zero(const struct timeval *tv)
*/
static int tevent_common_timed_destructor(struct tevent_timer *te)
{
+ tevent_debug(te->event_ctx, TEVENT_DEBUG_TRACE,
+ "Destroying timer event %p \"%s\"\n",
+ te, te->handler_name);
+
if (te->event_ctx) {
DLIST_REMOVE(te->event_ctx->timer_events, te);
}
+
return 0;
}
@@ -158,6 +163,9 @@ struct tevent_timer *tevent_common_add_timer(struct tevent_context *ev, TALLOC_C
talloc_set_destructor(te, tevent_common_timed_destructor);
+ tevent_debug(ev, TEVENT_DEBUG_TRACE,
+ "Added timed event \"%s\": %p\n",
+ handler_name, te);
return te;
}
@@ -224,6 +232,10 @@ struct timeval tevent_common_loop_timer_delay(struct tevent_context *ev)
* event from the list. */
talloc_set_destructor(te, NULL);
+ tevent_debug(te->event_ctx, TEVENT_DEBUG_TRACE,
+ "Ending timer event %p \"%s\"\n",
+ te, te->handler_name);
+
talloc_free(te);
return ev_timeval_zero();