summaryrefslogtreecommitdiffstats
path: root/lib/tevent/tevent_epoll.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-06-05 16:00:07 +1000
committerStefan Metzmacher <metze@samba.org>2012-06-08 19:00:05 +0200
commit796acbd9ffd20f13f320641b8a27f86624f3d701 (patch)
tree5185331f59a2197a68ada44ca27f8ab0435d2608 /lib/tevent/tevent_epoll.c
parent653cb76edfc3e9c2c426a6f8ec6ecfb253bd54d9 (diff)
downloadsamba-796acbd9ffd20f13f320641b8a27f86624f3d701.tar.gz
samba-796acbd9ffd20f13f320641b8a27f86624f3d701.tar.xz
samba-796acbd9ffd20f13f320641b8a27f86624f3d701.zip
lib/tevent: Add trace point callback
Set/get a single callback function to be invoked at various trace points. Define "before wait" and "after wait" trace points - more trace points can be added later if required. CTDB wants this to log long waits and events. Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Signed-off-by: Martin Schwenke <martin@meltin.net> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/tevent/tevent_epoll.c')
-rw-r--r--lib/tevent/tevent_epoll.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c
index 33e1d3f20f..5f93de2c57 100644
--- a/lib/tevent/tevent_epoll.c
+++ b/lib/tevent/tevent_epoll.c
@@ -264,7 +264,9 @@ static int epoll_event_loop(struct epoll_event_context *epoll_ev, struct timeval
return 0;
}
+ tevent_trace_point_callback(epoll_ev->ev, TEVENT_TRACE_BEFORE_WAIT);
ret = epoll_wait(epoll_ev->epoll_fd, events, MAXEVENTS, timeout);
+ tevent_trace_point_callback(epoll_ev->ev, TEVENT_TRACE_AFTER_WAIT);
if (ret == -1 && errno == EINTR && epoll_ev->ev->signal_events) {
if (tevent_common_check_signal(epoll_ev->ev)) {