kvm-recheck-lock.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. #
  3. # Analyze a given results directory for locktorture progress.
  4. #
  5. # Usage: kvm-recheck-lock.sh resdir
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, you can access it online at
  19. # http://www.gnu.org/licenses/gpl-2.0.html.
  20. #
  21. # Copyright (C) IBM Corporation, 2014
  22. #
  23. # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  24. i="$1"
  25. if test -d $i
  26. then
  27. :
  28. else
  29. echo Unreadable results directory: $i
  30. exit 1
  31. fi
  32. configfile=`echo $i | sed -e 's/^.*\///'`
  33. ncs=`grep "Writes: Total:" $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* Total: //' -e 's/ .*$//'`
  34. if test -z "$ncs"
  35. then
  36. echo "$configfile -------"
  37. else
  38. title="$configfile ------- $ncs acquisitions/releases"
  39. dur=`sed -e 's/^.* locktorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
  40. if test -z "$dur"
  41. then
  42. :
  43. else
  44. ncsps=`awk -v ncs=$ncs -v dur=$dur '
  45. BEGIN { print ncs / dur }' < /dev/null`
  46. title="$title ($ncsps per second)"
  47. fi
  48. echo $title
  49. fi