diff options
author | attilio <attilio@FreeBSD.org> | 2008-05-07 21:50:17 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-05-07 21:50:17 +0000 |
commit | 5f37114b4d2f0a697ddf2afbe2a749070a907421 (patch) | |
tree | 1999175df023ec7f213a9addca659d0f647730b7 /share/examples | |
parent | 0ce490cd030083500502567e22b65997c9131cd6 (diff) | |
download | FreeBSD-src-5f37114b4d2f0a697ddf2afbe2a749070a907421.zip FreeBSD-src-5f37114b4d2f0a697ddf2afbe2a749070a907421.tar.gz |
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')
-rw-r--r-- | share/examples/witness/lockgraphs.sh | 24 |
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 0000000..92a7dd2 --- /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 |