svn commit: samba r8965 - in trunk/source/smbd: .

vlendec at samba.org vlendec at samba.org
Wed Aug 3 00:05:04 GMT 2005


Author: vlendec
Date: 2005-08-03 00:05:03 +0000 (Wed, 03 Aug 2005)
New Revision: 8965

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

Log:
Make timed events named for debugging
Modified:
   trunk/source/smbd/oplock.c
   trunk/source/smbd/process.c


Changeset:
Modified: trunk/source/smbd/oplock.c
===================================================================
--- trunk/source/smbd/oplock.c	2005-08-02 23:55:46 UTC (rev 8964)
+++ trunk/source/smbd/oplock.c	2005-08-03 00:05:03 UTC (rev 8965)
@@ -1136,6 +1136,7 @@
 	fsp->oplock_timeout =
 		add_timed_event(NULL,
 				timeval_current_ofs(OPLOCK_BREAK_TIMEOUT, 0),
+				"oplock_timeout_handler",
 				oplock_timeout_handler, fsp);
 
 	if (fsp->oplock_timeout == NULL) {

Modified: trunk/source/smbd/process.c
===================================================================
--- trunk/source/smbd/process.c	2005-08-02 23:55:46 UTC (rev 8964)
+++ trunk/source/smbd/process.c	2005-08-03 00:05:03 UTC (rev 8965)
@@ -265,6 +265,7 @@
 struct timed_event {
 	struct timed_event *next, *prev;
 	struct timeval when;
+	const char *event_name;
 	void (*handler)(struct timed_event *te,
 			const struct timeval *now,
 			void *private_data);
@@ -274,7 +275,8 @@
 static int timed_event_destructor(void *p)
 {
 	struct timed_event *te = talloc_get_type_abort(p, struct timed_event);
-	DEBUG(10, ("Destroying timed event\n"));
+	DEBUG(10, ("Destroying timed event %x \"%s\"\n", (unsigned)te,
+		   te->event_name));
 	DLIST_REMOVE(timed_events, te);
 	return 0;
 }
@@ -287,6 +289,7 @@
 
 struct timed_event *add_timed_event(TALLOC_CTX *mem_ctx,
 				    struct timeval when,
+				    const char *event_name,
 				    void (*handler)(struct timed_event *te,
 						    const struct timeval *now,
 						    void *private_data),
@@ -301,6 +304,7 @@
 	}
 
 	te->when = when;
+	te->event_name = event_name;
 	te->handler = handler;
 	te->private_data = private_data;
 
@@ -317,6 +321,9 @@
 
 	DLIST_ADD_AFTER(timed_events, te, last_te);
 	talloc_set_destructor(te, timed_event_destructor);
+
+	DEBUG(10, ("Added timed event \"%s\": %x\n", event_name,
+		   (unsigned)te));
 	return te;
 }
 
@@ -338,6 +345,9 @@
 		return;
 	}
 
+	DEBUG(10, ("Running event \"%s\" %x\n", timed_events->event_name,
+		   (unsigned)timed_events));
+
 	timed_events->handler(timed_events, &now, timed_events->private_data);
 	return;
 }
@@ -382,6 +392,7 @@
 	}
 
 	event->te = add_timed_event(event, timeval_sum(now, &event->interval),
+				    "idle_event_handler",
 				    idle_event_handler, event);
 
 	/* We can't do much but fail here. */
@@ -408,6 +419,7 @@
 	result->private_data = private_data;
 
 	result->te = add_timed_event(result, timeval_sum(&now, &interval),
+				     "idle_event_handler",
 				     idle_event_handler, result);
 	if (result->te == NULL) {
 		DEBUG(0, ("add_timed_event failed\n"));



More information about the samba-cvs mailing list