svn commit: samba r23562 - in branches: SAMBA_3_0/source/lib SAMBA_3_0_26/source/lib

gd at samba.org gd at samba.org
Thu Jun 21 13:03:27 GMT 2007


Author: gd
Date: 2007-06-21 13:03:27 +0000 (Thu, 21 Jun 2007)
New Revision: 23562

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23562

Log:
Add dump_event_list() for debugging the event list.

Guenther

Modified:
   branches/SAMBA_3_0/source/lib/events.c
   branches/SAMBA_3_0_26/source/lib/events.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/events.c
===================================================================
--- branches/SAMBA_3_0/source/lib/events.c	2007-06-21 11:14:12 UTC (rev 23561)
+++ branches/SAMBA_3_0/source/lib/events.c	2007-06-21 13:03:27 UTC (rev 23562)
@@ -391,3 +391,27 @@
 	}
 	return 0;
 }
+
+void dump_event_list(struct event_context *event_ctx)
+{
+	struct timed_event *te;
+	struct timeval evt, now;
+
+	if (!event_ctx) {
+		return;
+	}
+
+	now = timeval_current();
+
+	DEBUG(10,("dump_event_list:\n"));
+
+	for (te = event_ctx->timed_events; te; te = te->next) {
+
+		evt = timeval_until(&now, &te->when);
+
+		DEBUGADD(10,("Event \"%s\" %lx handled in %d seconds\n",
+			   te->event_name,
+			   (unsigned long)te,
+			   (int)evt.tv_sec));
+	}
+}

Modified: branches/SAMBA_3_0_26/source/lib/events.c
===================================================================
--- branches/SAMBA_3_0_26/source/lib/events.c	2007-06-21 11:14:12 UTC (rev 23561)
+++ branches/SAMBA_3_0_26/source/lib/events.c	2007-06-21 13:03:27 UTC (rev 23562)
@@ -391,3 +391,27 @@
 	}
 	return 0;
 }
+
+void dump_event_list(struct event_context *event_ctx)
+{
+	struct timed_event *te;
+	struct timeval evt, now;
+
+	if (!event_ctx) {
+		return;
+	}
+
+	now = timeval_current();
+
+	DEBUG(10,("dump_event_list:\n"));
+
+	for (te = event_ctx->timed_events; te; te = te->next) {
+
+		evt = timeval_until(&now, &te->when);
+
+		DEBUGADD(10,("Event \"%s\" %lx handled in %d seconds\n",
+			   te->event_name,
+			   (unsigned long)te,
+			   (int)evt.tv_sec));
+	}
+}



More information about the samba-cvs mailing list