From e83a55c35643af2dad8e11bd51797908a6224451 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 5 Jan 2009 19:52:47 +0100 Subject: tevent: add some debugging for timer events, that mostly matches samba3 metze --- lib/tevent/tevent_timed.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/tevent') 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(); -- cgit