summaryrefslogtreecommitdiffstats
path: root/ctdb/lib
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-04-13 17:07:13 +1000
committerAmitay Isaacs <amitay@gmail.com>2012-04-13 17:28:14 +1000
commit3381b597d6654502a433ebba1b2d2fafe2760e2e (patch)
tree8d63e1daa441745e37cf2f1b63dc5b5de294e6d1 /ctdb/lib
parenta6abfa28cf9eda24944d3e00984058ed91415517 (diff)
downloadsamba-3381b597d6654502a433ebba1b2d2fafe2760e2e.tar.gz
samba-3381b597d6654502a433ebba1b2d2fafe2760e2e.tar.xz
samba-3381b597d6654502a433ebba1b2d2fafe2760e2e.zip
lib/tevent: Remove local modifications to tevent
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d1bc4a97ea649f5a07802178591688e438313ff8)
Diffstat (limited to 'ctdb/lib')
-rw-r--r--ctdb/lib/tevent/tevent_epoll.c5
-rw-r--r--ctdb/lib/tevent/tevent_select.c5
-rw-r--r--ctdb/lib/tevent/tevent_standard.c5
-rw-r--r--ctdb/lib/tevent/tevent_util.c51
-rw-r--r--ctdb/lib/tevent/tevent_util.h3
5 files changed, 0 insertions, 69 deletions
diff --git a/ctdb/lib/tevent/tevent_epoll.c b/ctdb/lib/tevent/tevent_epoll.c
index 1c3396eb6b6..a475f382350 100644
--- a/ctdb/lib/tevent/tevent_epoll.c
+++ b/ctdb/lib/tevent/tevent_epoll.c
@@ -228,8 +228,6 @@ static void epoll_change_event(struct epoll_event_context *epoll_ev, struct teve
}
}
-extern pid_t ctdbd_pid;
-
/*
event loop handling using epoll
*/
@@ -252,10 +250,7 @@ static int epoll_event_loop(struct epoll_event_context *epoll_ev, struct timeval
return 0;
}
- if (getpid() == ctdbd_pid) tevent_before_wait(epoll_ev->ev);
ret = epoll_wait(epoll_ev->epoll_fd, events, MAXEVENTS, timeout);
- if (getpid() == ctdbd_pid) tevent_after_wait(epoll_ev->ev);
-
if (ret == -1 && errno == EINTR && epoll_ev->ev->signal_events) {
if (tevent_common_check_signal(epoll_ev->ev)) {
return 0;
diff --git a/ctdb/lib/tevent/tevent_select.c b/ctdb/lib/tevent/tevent_select.c
index 1671198a20a..dc525b2bb2e 100644
--- a/ctdb/lib/tevent/tevent_select.c
+++ b/ctdb/lib/tevent/tevent_select.c
@@ -125,8 +125,6 @@ static struct tevent_fd *select_event_add_fd(struct tevent_context *ev, TALLOC_C
return fde;
}
-extern pid_t ctdbd_pid;
-
/*
event loop handling using select()
*/
@@ -159,10 +157,7 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
return 0;
}
- if (getpid() == ctdbd_pid) tevent_before_wait(select_ev->ev);
selrtn = select(select_ev->maxfd+1, &r_fds, &w_fds, NULL, tvalp);
- if (getpid() == ctdbd_pid) tevent_after_wait(select_ev->ev);
-
if (selrtn == -1 && errno == EINTR &&
select_ev->ev->signal_events) {
tevent_common_check_signal(select_ev->ev);
diff --git a/ctdb/lib/tevent/tevent_standard.c b/ctdb/lib/tevent/tevent_standard.c
index 05d734a627c..e79e602efa1 100644
--- a/ctdb/lib/tevent/tevent_standard.c
+++ b/ctdb/lib/tevent/tevent_standard.c
@@ -239,8 +239,6 @@ static void epoll_change_event(struct std_event_context *std_ev, struct tevent_f
}
}
-extern pid_t ctdbd_pid;
-
/*
event loop handling using epoll
*/
@@ -263,10 +261,7 @@ static int epoll_event_loop(struct std_event_context *std_ev, struct timeval *tv
return 0;
}
- if (getpid() == ctdbd_pid) tevent_before_wait(std_ev->ev);
ret = epoll_wait(std_ev->epoll_fd, events, MAXEVENTS, timeout);
- if (getpid() == ctdbd_pid) tevent_after_wait(std_ev->ev);
-
if (ret == -1 && errno == EINTR && std_ev->ev->signal_events) {
if (tevent_common_check_signal(std_ev->ev)) {
return 0;
diff --git a/ctdb/lib/tevent/tevent_util.c b/ctdb/lib/tevent/tevent_util.c
index 54c1787400f..f78cd8f707d 100644
--- a/ctdb/lib/tevent/tevent_util.c
+++ b/ctdb/lib/tevent/tevent_util.c
@@ -88,54 +88,3 @@ int ev_set_blocking(int fd, bool set)
return fcntl( fd, F_SETFL, val);
#undef FLAG_TO_SET
}
-
-static struct timeval tevent_before_wait_ts;
-static struct timeval tevent_after_wait_ts;
-
-/*
- * measure the time difference between multiple arrivals
- * to the point where we wait for new events to come in
- *
- * allows to measure how long it takes to work on a
- * event
- */
-void tevent_before_wait(struct event_context *ev) {
-
- struct timeval diff;
- struct timeval now = tevent_timeval_current();
-
- if (!tevent_timeval_is_zero(&tevent_after_wait_ts)) {
- diff = tevent_timeval_until(&tevent_after_wait_ts, &now);
- if (diff.tv_sec > 3) {
- tevent_debug(ev, TEVENT_DEBUG_ERROR, __location__
- " Handling event took %d seconds!",
- (int) diff.tv_sec);
- }
- }
-
- tevent_before_wait_ts = tevent_timeval_current();
-
-}
-
-/*
- * measure how long the select()/epoll() call took
- *
- * allows to measure how long we are waiting for new events
- */
-void tevent_after_wait(struct event_context *ev) {
-
- struct timeval diff;
- struct timeval now = tevent_timeval_current();
-
- if (!tevent_timeval_is_zero(&tevent_before_wait_ts)) {
- diff = tevent_timeval_until(&tevent_before_wait_ts, &now);
- if (diff.tv_sec > 3) {
- tevent_debug(ev, TEVENT_DEBUG_FATAL, __location__
- " No event for %d seconds!",
- (int) diff.tv_sec);
- }
- }
-
- tevent_after_wait_ts = tevent_timeval_current();
-
-}
diff --git a/ctdb/lib/tevent/tevent_util.h b/ctdb/lib/tevent/tevent_util.h
index 2852e9f26ae..2f4bc2f0438 100644
--- a/ctdb/lib/tevent/tevent_util.h
+++ b/ctdb/lib/tevent/tevent_util.h
@@ -184,9 +184,6 @@ const char **ev_str_list_add(const char **list, const char *s);
int ev_set_blocking(int fd, bool set);
size_t ev_str_list_length(const char **list);
-void tevent_before_wait(struct event_context *ev);
-void tevent_after_wait(struct event_context *ev);
-
/* Defined here so we can build against older talloc versions that don't
* have this define yet. */