[Ocfs2-tools-commits] smushran commits r786 - in trunk:
debugfs.ocfs2 extras mounted.ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Apr 5 21:13:44 CDT 2005
Author: smushran
Date: 2005-04-05 21:13:42 -0500 (Tue, 05 Apr 2005)
New Revision: 786
Added:
trunk/extras/watch-hb.sh
Modified:
trunk/debugfs.ocfs2/main.c
trunk/mounted.ocfs2/mounted.c
Log:
watch-hb added
Modified: trunk/debugfs.ocfs2/main.c
===================================================================
--- trunk/debugfs.ocfs2/main.c 2005-04-05 08:12:29 UTC (rev 785)
+++ trunk/debugfs.ocfs2/main.c 2005-04-06 02:13:42 UTC (rev 786)
@@ -131,7 +131,8 @@
break;
}
} else {
- line = readline (PROMPT);
+ fprintf(stderr, "%s", PROMPT);
+ line = readline (NULL);
if (line && *line) {
g_strchug(line);
@@ -196,7 +197,7 @@
if (line) {
if (!gbls.interactive)
- fprintf (stdout, "%s%s\n", PROMPT, line);
+ fprintf (stderr, "%s%s\n", PROMPT, line);
do_command (line);
if (gbls.interactive)
free (line);
Added: trunk/extras/watch-hb.sh
===================================================================
--- trunk/extras/watch-hb.sh 2005-04-05 08:12:29 UTC (rev 785)
+++ trunk/extras/watch-hb.sh 2005-04-06 02:13:42 UTC (rev 786)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+die() {
+ echo $@", exiting" > /dev/stderr
+ exit 1
+}
+
+usage() {
+ echo "-r region the hb region to watch"
+}
+
+while getopts ":r:" opt; do
+ case $opt in
+ r)
+ region="$OPTARG"
+ ;;
+ \?) usage
+ esac
+done
+
+[ -z "$region" ] && \
+ die "a region must be specified with -r"
+
+dev=$(cat $region/dev) || die "couldn't read $region/dev"
+[ -z "$dev" ] && \
+ die "$region/dev isn't set, is the region active?"
+
+for attr in slot_bytes; do
+ eval "$attr=$(cat $region/$attr)" || die "couldn't read $region/$attr"
+done
+
+watch -n 3 -d \
+ "echo \"cat //heartbeat\" | debugfs.ocfs2 /dev/$dev 2>/dev/null \
+ | od -A d -x | \
+ awk '( NF > 2 ) { \$(1) = \$1 / $slot_bytes; if (\$1 == int(\$1)) print \$0 }'"
Property changes on: trunk/extras/watch-hb.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/mounted.ocfs2/mounted.c
===================================================================
--- trunk/mounted.ocfs2/mounted.c 2005-04-05 08:12:29 UTC (rev 785)
+++ trunk/mounted.ocfs2/mounted.c 2005-04-06 02:13:42 UTC (rev 786)
@@ -75,7 +75,6 @@
char **node_names = NULL;
char **cluster_names = NULL;
char *nodes[OCFS2_MAX_NODES];
- char value[10];
int i = 0;
uint16_t num;
More information about the Ocfs2-tools-commits
mailing list