From 4269d37ce84127138847542ff313360f39eea5dc Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Tue, 8 Dec 2009 19:08:37 +0100 Subject: [PATCH] improve time jump logging add the __location__ macro to the logs to get a better idea in which loop the problem occured Signed-off-by: Christian Ambach (This used to be ctdb commit dccb549fd6a6e338063699544e52f2a1a6a966b5) --- ctdb/lib/events/events_epoll.c | 4 ++-- ctdb/lib/events/events_select.c | 4 ++-- ctdb/lib/events/events_standard.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ctdb/lib/events/events_epoll.c b/ctdb/lib/events/events_epoll.c index 0dfdb79517a..99fa36c96e9 100644 --- a/ctdb/lib/events/events_epoll.c +++ b/ctdb/lib/events/events_epoll.c @@ -472,11 +472,11 @@ static int epoll_event_loop_wait(struct event_context *ev) new_t=time(NULL); if (t != 0) { if (t > new_t) { - DEBUG(0,("ERROR Time skipped backward by %d seconds\n", (int)(t-new_t))); + DEBUG(0,(__location__ " ERROR Time skipped backward by %d seconds\n", (int)(t-new_t))); } /* We assume here that we get at least one event every 5 seconds */ if (new_t > (t+5)) { - DEBUG(0,("ERROR Time jumped forward by %d seconds\n", (int)(new_t-t))); + DEBUG(0,(__location__ " ERROR Time jumped forward by %d seconds\n", (int)(new_t-t))); } } t=new_t; diff --git a/ctdb/lib/events/events_select.c b/ctdb/lib/events/events_select.c index 404cd8c370a..faccc6d21a0 100644 --- a/ctdb/lib/events/events_select.c +++ b/ctdb/lib/events/events_select.c @@ -287,11 +287,11 @@ static int select_event_loop_wait(struct event_context *ev) new_t=time(NULL); if (t != 0) { if (t > new_t) { - DEBUG(0,("ERROR Time skipped backward by %d seconds\n", (int)(t-new_t))); + DEBUG(0,(__location__ " ERROR Time skipped backward by %d seconds\n", (int)(t-new_t))); } /* We assume here that we get at least one event every 5 seconds */ if (new_t > (t+5)) { - DEBUG(0,("ERROR Time jumped forward by %d seconds\n", (int)(new_t-t))); + DEBUG(0,(__location__ " ERROR Time jumped forward by %d seconds\n", (int)(new_t-t))); } } t=new_t; diff --git a/ctdb/lib/events/events_standard.c b/ctdb/lib/events/events_standard.c index 9ee2328225d..fe128cac2a9 100644 --- a/ctdb/lib/events/events_standard.c +++ b/ctdb/lib/events/events_standard.c @@ -588,11 +588,11 @@ static int std_event_loop_wait(struct event_context *ev) new_t=time(NULL); if (t != 0) { if (t > new_t) { - DEBUG(0,("ERROR Time skipped backward by %d seconds\n", (int)(t-new_t))); + DEBUG(0,(__location__ " ERROR Time skipped backward by %d seconds\n", (int)(t-new_t))); } /* We assume here that we get at least one event every 5 seconds */ if (new_t > (t+5)) { - DEBUG(0,("ERROR Time jumped forward by %d seconds\n", (int)(new_t-t))); + DEBUG(0,(__location__ " ERROR Time jumped forward by %d seconds\n", (int)(new_t-t))); } } t=new_t;