From 29614b3788d02015457cdfd012c197dcd391f1c5 Mon Sep 17 00:00:00 2001 From: Attilio Rao Date: Wed, 7 May 2008 21:50:17 +0000 Subject: [PATCH] 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 --- share/examples/witness/lockgraphs.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 share/examples/witness/lockgraphs.sh 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