/share/examples/witness/lockgraphs.sh

https://bitbucket.org/freebsd/freebsd-head/ · Shell · 24 lines · 13 code · 2 blank · 9 comment · 0 complexity · f33f0a53d015957996494dfc0d007fc5 MD5 · raw file

  1. #!/bin/sh
  2. ################################################################################
  3. #
  4. # lockgraphs.sh by Michele Dallachiesa -- 2008-05-07 -- v0.1
  5. #
  6. # $FreeBSD$
  7. #
  8. ################################################################################
  9. sysctl debug.witness.graphs | awk '
  10. BEGIN {
  11. print "digraph lockgraphs {"
  12. }
  13. NR > 1 && $0 ~ /"Giant"/ {
  14. gsub(","," -> ");
  15. print $0 ";"
  16. }
  17. END {
  18. print "}"
  19. }'
  20. #eof