[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-06-22 18:39:27

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

Log message:
	improvements to debug messages

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/app.c.diff?cvsroot=cluster&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cpg.c.diff?cvsroot=cluster&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/gd_internal.h.diff?cvsroot=cluster&r1=1.34&r2=1.35

--- cluster/group/daemon/app.c	2006/06/21 20:43:54	1.31
+++ cluster/group/daemon/app.c	2006/06/22 18:39:26	1.32
@@ -10,6 +10,19 @@
 	int nodeid;
 };
 
+char *msg_type(int type)
+{
+	switch (type) {
+	case MSG_APP_STOPPED:
+		return "stopped";
+	case MSG_APP_STARTED:
+		return "started";
+	case MSG_APP_INTERNAL:
+		return "internal";
+	}
+	return "unknown";
+}
+
 void msg_bswap_out(msg_t *msg)
 {
 	msg->ms_version[0]	= cpu_to_le32(MSG_VER_MAJOR);
@@ -547,23 +560,8 @@
 
 int queue_app_message(group_t *g, struct save_msg *save)
 {
-	/*
-	char *m = "unknown";
-
-	switch (save->msg.ms_type) {
-	case MSG_APP_STOPPED:
-		m = "stopped";
-		break;
-	case MSG_APP_STARTED:
-		m = "started";
-		break;
-	case MSG_APP_INTERNAL:
-		m = "internal";
-		break;
-	}
-	log_group(g, "queue message %s from %d", m, save->nodeid);
-	*/
-
+	/* log_group(g, "queue message %s from %d",
+	             msg_type(save->msg.ms_type), save->nodeid); */
 	list_add_tail(&save->list, &g->messages);
 	return 0;
 }
@@ -1092,9 +1090,12 @@
 
 		ev = a->current_event;
 		if (!ev || ev->id != save->msg.ms_event_id) {
-			log_group(g, "ignore msg from %d id %llx type %d",
-				  save->nodeid, save->msg.ms_event_id,
-				  save->msg.ms_type);
+			if (!save->print_ignore) {
+				log_group(g, "ignore msg from %d id %llx %s",
+				  	  save->nodeid, save->msg.ms_event_id,
+				  	  msg_type(save->msg.ms_type));
+				save->print_ignore = 1;
+			}
 			continue;
 		}
 
--- cluster/group/daemon/cpg.c	2006/06/21 20:43:54	1.26
+++ cluster/group/daemon/cpg.c	2006/06/22 18:39:26	1.27
@@ -51,7 +51,7 @@
 	g->memb_count--;
 	free(node);
 
-	log_group(g, "group del node %d total %d - down",
+	log_group(g, "cpg del node %d total %d - down",
 		  nodeid, g->memb_count);
 
 	/* purge any queued join/leave events from the dead node */
@@ -97,7 +97,7 @@
 			node = new_node(saved_member[i].nodeId);
 			list_add_tail(&node->list, &g->memb);
 			g->memb_count++;
-			log_group(g, "group add node %d total %d - init",
+			log_group(g, "cpg add node %d total %d",
 				  node->nodeid, g->memb_count);
 		}
 
@@ -114,7 +114,7 @@
 		node = new_node(nodeid);
 		list_add_tail(&node->list, &g->memb);
 		g->memb_count++;
-		log_group(g, "group add node %d total %d",
+		log_group(g, "cpg add node %d total %d",
 			  node->nodeid, g->memb_count);
 	}
 
@@ -137,7 +137,7 @@
 	g->memb_count--;
 	free(node);
 
-	log_group(g, "group del node %d total %d", nodeid, g->memb_count);
+	log_group(g, "cpg del node %d total %d", nodeid, g->memb_count);
 
 	queue_app_leave(g, nodeid);
 }
@@ -146,7 +146,7 @@
 {
 	int i, found = 0;
 
-	log_debug("process_groupd_confchg members %d -%d +%d",
+	log_debug("groupd confchg total %d left %d joined %d",
 		  saved_member_count, saved_left_count, saved_joined_count);
 
 	memcpy(&groupd_cpg_member, &saved_member, sizeof(saved_member));
@@ -234,7 +234,8 @@
 	}
 
 	/*
-	log_group(g, "deliver from %d len %d", nodeid, data_len);
+	log_group(g, "deliver_cb from %d len %d type %s", nodeid, data_len,
+		  msg_type(msg->ms_type));
 	*/
 
 	save = malloc(sizeof(struct save_msg));
@@ -265,19 +266,19 @@
 
 	g = find_group_by_handle(saved_handle);
 	if (!g) {
-		log_debug("process_confchg: no group for handle %llx name %s",
+		log_debug("confchg: no group for handle %llx name %s",
 			  saved_handle, saved_name.value);
 		return;
 	}
 
-	log_group(g, "process_confchg members %d -%d +%d",
-		  saved_member_count, saved_left_count, saved_joined_count);
+	log_group(g, "confchg left %d joined %d total %d",
+		  saved_left_count, saved_joined_count, saved_member_count);
 
 	for (i = 0; i < saved_joined_count; i++)
 		process_node_join(g, saved_joined[i].nodeId);
 
 	for (i = 0; i < saved_left_count; i++) {
-		log_group(g, "node %d removed reason %d",
+		log_group(g, "confchg removed node %d reason %d",
 			  saved_left[i].nodeId, saved_left[i].reason);
 
 		if (saved_left[i].reason == CPG_REASON_LEAVE)
@@ -306,8 +307,10 @@
 		}
 	}
 
-	log_debug("%d:%s confchg members %d -%d +%d", level, name,
+	/*
+	log_debug("%d:%s confchg_cb total %d left %d joined %d", level, name,
 		  member_list_entries, left_list_entries, joined_list_entries);
+	*/
 
 	saved_handle = handle;
 
--- cluster/group/daemon/gd_internal.h	2006/06/21 20:43:54	1.34
+++ cluster/group/daemon/gd_internal.h	2006/06/22 18:39:26	1.35
@@ -201,6 +201,7 @@
 struct save_msg {
 	struct list_head	list;
 	int			nodeid;
+	int			print_ignore;
 	int			msg_len;
 	msg_t			msg;
 	char			*msg_long;
@@ -250,6 +251,7 @@
 void msg_bswap_in(msg_t *msg);
 struct recovery_set *get_recovery_set(int nodeid);
 void groupd_down(int nodeid);
+char *msg_type(int type);
 
 /* main.c */
 void app_stop(app_t *a);


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