aboutsummaryrefslogtreecommitdiffstats
path: root/share/examples/witness
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2008-05-07 21:50:17 +0000
committerAttilio Rao <attilio@FreeBSD.org>2008-05-07 21:50:17 +0000
commit29614b3788d02015457cdfd012c197dcd391f1c5 (patch)
tree1999175df023ec7f213a9addca659d0f647730b7 /share/examples/witness
parent688b98135c8d9f68358d11ecdc073239ec7c6490 (diff)
Add a new awk script which parses informations returned by the newly
added sysctl debug.witness.graphs and returns all the graphs involving Giant lock creating an appropriate script in DOT format which can be plotted immediately. Submitted by: Michele Dallachiesa <michele dot dallachiesa at poste dot it>
Diffstat (limited to 'share/examples/witness')
-rw-r--r--share/examples/witness/lockgraphs.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/share/examples/witness/lockgraphs.sh b/share/examples/witness/lockgraphs.sh
new file mode 100644
index 000000000000..92a7dd2a1f81
--- /dev/null
+++ b/share/examples/witness/lockgraphs.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+################################################################################
+#
+# lockgraphs.sh by Michele Dallachiesa -- 2008-05-07 -- v0.1
+#
+# $FreeBSD$
+#
+################################################################################
+
+sysctl debug.witness.graphs | awk '
+BEGIN {
+ print "digraph lockgraphs {"
+ }
+
+NR > 1 && $0 ~ /"Giant"/ {
+ gsub(","," -> ");
+ print $0 ";"
+}
+
+END {
+ print "}"
+ }'
+
+#eof