[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/group/daemon app.c cpg.c gd_internal.h ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland sourceware org	2006-09-26 21:32:38

Modified files:
	group/daemon   : app.c cpg.c gd_internal.h main.c 

Log message:
	Adding -vv to the groupd command line will result in a log_debug
	for every cpg send and every cpg recv.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/app.c.diff?cvsroot=cluster&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cpg.c.diff?cvsroot=cluster&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/gd_internal.h.diff?cvsroot=cluster&r1=1.41&r2=1.42
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/main.c.diff?cvsroot=cluster&r1=1.45&r2=1.46

--- cluster/group/daemon/app.c	2006/09/26 19:17:20	1.46
+++ cluster/group/daemon/app.c	2006/09/26 21:32:38	1.47
@@ -693,7 +693,7 @@
 
 	log_group(g, "send stopped");
 	g->app->sent_event_id = ev->id;
-	return send_message_groupd(g, &msg, sizeof(msg));
+	return send_message_groupd(g, &msg, sizeof(msg), MSG_APP_STOPPED);
 }
 
 static int send_started(group_t *g)
@@ -712,7 +712,7 @@
 
 	log_group(g, "send started");
 	g->app->sent_event_id = ev->id;
-	return send_message_groupd(g, &msg, sizeof(msg));
+	return send_message_groupd(g, &msg, sizeof(msg), MSG_APP_STARTED);
 }
 
 int do_stopdone(char *name, int level)
--- cluster/group/daemon/cpg.c	2006/09/26 19:17:20	1.32
+++ cluster/group/daemon/cpg.c	2006/09/26 21:32:38	1.33
@@ -226,8 +226,15 @@
 		memcpy(&name, &msg->ms_name, MAX_NAMELEN);
 
 		g = find_group_level(name, msg->ms_level);
-		if (!g)
+		if (!g) {
+			if (groupd_debug_verbose > 1) {
+				log_print("%d:%s RECV len %d %s from %d, "
+					  "no group",
+				  	  msg->ms_level, name, data_len,
+				  	  msg_type(msg->ms_type), nodeid);
+			}
 			return;
+		}
 	} else {
 		g = find_group_by_handle(handle);
 		if (!g) {
@@ -242,10 +249,9 @@
 		}
 	}
 
-	/*
-	log_group(g, "deliver_cb from %d len %d type %s", nodeid, data_len,
-		  msg_type(msg->ms_type));
-	*/
+	if (groupd_debug_verbose > 1)
+		log_group(g, "RECV len %d %s from %d", data_len,
+			  msg_type(msg->ms_type), nodeid);
 
 	if (nodeid == our_nodeid && g->app->sent_event_id == msg->ms_event_id)
 		g->app->sent_event_id = 0;
@@ -557,8 +563,11 @@
 	return 0;
 }
 
-int send_message_groupd(group_t *g, void *buf, int len)
+int send_message_groupd(group_t *g, void *buf, int len, int type)
 {
+	if (groupd_debug_verbose > 1)
+		log_group(g, "SEND len %d %s", len, msg_type(type));
+
 	return _send_message(groupd_handle, g, buf, len);
 }
 
--- cluster/group/daemon/gd_internal.h	2006/09/26 19:17:21	1.41
+++ cluster/group/daemon/gd_internal.h	2006/09/26 21:32:38	1.42
@@ -51,6 +51,7 @@
 
 extern char *prog_name;
 extern int groupd_debug_opt;
+extern int groupd_debug_verbose;
 extern char groupd_debug_buf[256];
 extern char dump_buf[DUMP_SIZE];
 extern int dump_point;
@@ -276,7 +277,7 @@
 int do_cpg_join(group_t *g);
 int do_cpg_leave(group_t *g);
 int send_message(group_t *g, void *buf, int len);
-int send_message_groupd(group_t *g, void *buf, int len);
+int send_message_groupd(group_t *g, void *buf, int len, int type);
 void copy_groupd_data(group_data_t *data);
 int in_groupd_cpg(int nodeid);
 
--- cluster/group/daemon/main.c	2006/09/26 19:17:21	1.45
+++ cluster/group/daemon/main.c	2006/09/26 21:32:38	1.46
@@ -12,7 +12,7 @@
 
 #include "gd_internal.h"
 
-#define OPTION_STRING			"DhV"
+#define OPTION_STRING			"DhVv"
 #define LOCKFILE_NAME			"/var/run/groupd.pid"
 
 extern struct list_head recovery_sets;
@@ -598,7 +598,7 @@
 
 	act = get_action(buf);
 
-	log_debug("got %d bytes from client %d %s", rv, ci, last_action);
+	log_debug("got client %d %s", ci, last_action);
 
 	switch (act) {
 
@@ -850,6 +850,10 @@
 			exit(EXIT_SUCCESS);
 			break;
 
+		case 'v':
+			groupd_debug_verbose++;
+			break;
+
 		case 'V':
 			printf("groupd (built %s %s)\n", __DATE__, __TIME__);
 			/* printf("%s\n", REDHAT_COPYRIGHT); */
@@ -934,6 +938,7 @@
 
 char *prog_name;
 int groupd_debug_opt;
+int groupd_debug_verbose;
 char groupd_debug_buf[256];
 char dump_buf[DUMP_SIZE];
 int dump_point;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]