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

[Cluster-devel] cluster/group/gfs_controld cpg.c lock_dlm.h ma ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland sourceware org	2006-08-09 19:35:26

Modified files:
	group/gfs_controld: cpg.c lock_dlm.h main.c plock.c 

Log message:
	don't send plock debugging to stdout with -D, use -P to get that now

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/cpg.c.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/lock_dlm.h.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/main.c.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/plock.c.diff?cvsroot=cluster&r1=1.11&r2=1.12

--- cluster/group/gfs_controld/cpg.c	2006/07/31 18:37:07	1.5
+++ cluster/group/gfs_controld/cpg.c	2006/08/09 19:35:26	1.6
@@ -39,8 +39,10 @@
 
 	mg = find_mg(hd->name);
 	if (!mg) {
+		/*
 		log_error("cpg message from %d len %d no group %s",
 			  nodeid, len, hd->name);
+		*/
 		return;
 	}
 
--- cluster/group/gfs_controld/lock_dlm.h	2006/08/08 21:19:17	1.12
+++ cluster/group/gfs_controld/lock_dlm.h	2006/08/09 19:35:26	1.13
@@ -65,6 +65,7 @@
 };
 
 extern char *prog_name;
+extern int plock_debug_opt;
 extern int daemon_debug_opt;
 extern char daemon_debug_buf[256];
 extern char dump_buf[DUMP_SIZE];
@@ -88,6 +89,13 @@
 	daemon_dump_save(); \
 } while (0)
 
+#define log_plock(g, fmt, args...) \
+do { \
+	snprintf(daemon_debug_buf, 255, "%ld %s " fmt "\n", time(NULL), \
+		 (g)->name, ##args); \
+	if (plock_debug_opt) fprintf(stderr, "%s", daemon_debug_buf); \
+} while (0)
+
 #define log_error(fmt, args...) \
 do { \
 	log_debug(fmt, ##args); \
--- cluster/group/gfs_controld/main.c	2006/07/31 18:37:07	1.7
+++ cluster/group/gfs_controld/main.c	2006/08/09 19:35:26	1.8
@@ -12,7 +12,7 @@
 
 #include "lock_dlm.h"
 
-#define OPTION_STRING			"DhVw"
+#define OPTION_STRING			"DPhVw"
 #define LOCKFILE_NAME			"/var/run/gfs_controld.pid"
 
 struct client {
@@ -473,6 +473,10 @@
 			daemon_debug_opt = 1;
 			break;
 
+		case 'P':
+			plock_debug_opt = 1;
+			break;
+
 		case 'h':
 			print_usage();
 			exit(EXIT_SUCCESS);
@@ -534,6 +538,7 @@
 }
 
 char *prog_name;
+int plock_debug_opt;
 int daemon_debug_opt;
 char daemon_debug_buf[256];
 char dump_buf[DUMP_SIZE];
--- cluster/group/gfs_controld/plock.c	2006/08/08 21:19:17	1.11
+++ cluster/group/gfs_controld/plock.c	2006/08/09 19:35:26	1.12
@@ -308,7 +308,7 @@
 		goto fail;
 	}
 
-	log_group(mg, "read plock %llx %s %s %llx-%llx %d/%u/%llx w %d",
+	log_plock(mg, "read plock %llx %s %s %llx-%llx %d/%u/%llx w %d",
 		  info.number,
 		  op_str(info.optype),
 		  ex_str(info.optype, info.ex),
@@ -867,7 +867,7 @@
 
 	info_bswap_in(&info);
 
-	log_group(mg, "receive plock %llx %s %s %llx-%llx %d/%u/%llx w %d",
+	log_plock(mg, "receive plock %llx %s %s %llx-%llx %d/%u/%llx w %d",
 		  info.number,
 		  op_str(info.optype),
 		  ex_str(info.optype, info.ex),
@@ -985,7 +985,7 @@
 
 	section_len = count * sizeof(struct pack_plock);
 
-	log_group(mg, "pack %llx count %d", r->number, count);
+	log_plock(mg, "pack %llx count %d", r->number, count);
 }
 
 int unpack_section_buf(struct mountgroup *mg, char *numbuf, int buflen)
@@ -1005,7 +1005,7 @@
 	INIT_LIST_HEAD(&r->waiters);
 	sscanf(numbuf, "r%llu", &r->number);
 
-	log_group(mg, "unpack %llx count %d", r->number, count);
+	log_plock(mg, "unpack %llx count %d", r->number, count);
 
 	pp = (struct pack_plock *) &section_buf;
 


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