Skip to contentSkip to conversation

cluster/group/gfs_controld lock_dlm.h main.c

Cluster-devel [email protected] 1 participant 1 message Jul 14, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-07-14 18:56:10

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

Log message:
keep a 1MB circular buffer of debug messages, they can be dumped out by running 'group_tool dump gfs'

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/lock_dlm.h.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/gfs_controld/main.c.diff?cvsroot=cluster&r1=1.4&r2=1.5

group/gfs_controld/lock_dlm.h +8 -0
@@ -43,6 +43,7 @@
 #define MAX_CLIENTS		8
 #define MAX_MSGLEN		2048
 #define MAX_OPTIONS_LEN		1024
+#define DUMP_SIZE		(1024 * 1024)
 
 #define LOCK_DLM_GROUP_LEVEL	2
 #define LOCK_DLM_GROUP_NAME	"gfs"
@@ -67,11 +68,17 @@
 extern char *prog_name;
 extern int daemon_debug_opt;
 extern char daemon_debug_buf[256];
+extern char dump_buf[DUMP_SIZE];
+extern int dump_point;
+extern int dump_wrap;
+
+extern void daemon_dump_save(void);
 
 #define log_debug(fmt, args...) \
 do { \
 	snprintf(daemon_debug_buf, 255, "%ld " fmt "\n", time(NULL), ##args); \
 	if (daemon_debug_opt) fprintf(stderr, "%s", daemon_debug_buf); \
+	daemon_dump_save(); \
 } while (0)
 
 #define log_group(g, fmt, args...) \
@@ -79,6 +86,7 @@
 	snprintf(daemon_debug_buf, 255, "%ld %s " fmt "\n", time(NULL), \
 		 (g)->name, ##args); \
 	if (daemon_debug_opt) fprintf(stderr, "%s", daemon_debug_buf); \
+	daemon_dump_save(); \
 } while (0)
 
 #define log_error(fmt, args...) \
group/gfs_controld/main.c +41 -1

61 lines not on this page · raw message