Skip to contentSkip to conversation

cluster/dlm/tool main.c

Cluster-devel [email protected] 1 participant 1 message Jul 2, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: teigland at sourceware.org 2007-07-02 20:07:17

Modified files:
dlm/tool : main.c

Log message:
Separate lockdump (compact, one lock per line) from lockdebug (verbose output as seen from proc).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm/tool/main.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.1&r2=1.3.2.2

dlm/tool/main.c +9 -2
@@ -31,6 +31,7 @@
 #define OP_LEAVE			2
 #define OP_SPACES			3
 #define OP_LOCKDUMP			4
+#define OP_LOCKDEBUG			5
 
 static char *prog_name;
 static char *lsname;
@@ -44,7 +45,7 @@
 {
 	printf("Usage:\n");
 	printf("\n");
-	printf("%s [options] [join|leave|spaces|lockdump]\n", prog_name);
+	printf("%s [options] [join|leave|spaces|lockdump|lockdebug]\n", prog_name);
 	printf("\n");
 	printf("Options:\n");
 	printf("  -v               Verbose output, extra event information\n");
@@ -131,6 +132,11 @@
 			operation = OP_LOCKDUMP;
 			opt_ind = optind + 1;
 			break;
+		} else if (!strncmp(argv[optind], "lockdebug", 9) &&
+			   (strlen(argv[optind]) == 9)) {
+			operation = OP_LOCKDEBUG;
+			opt_ind = optind + 1;
+			break;
 		}
 		optind++;
 	}
@@ -343,7 +349,7 @@
 	file = fopen(path, "r");
 
 	while (fgets(line, PROC_LINE_MAX, file)) {
-		if (verbose) {
+		if (operation == OP_LOCKDEBUG) {
 			printf("%s", line);
 			continue;
 		}
@@ -411,6 +417,7 @@
 		break;
 
 	case OP_LOCKDUMP:
+	case OP_LOCKDEBUG:
 		do_lockdump(lsname);
 		break;
 	}