kvm-recheck-rcu.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/bash
  2. #
  3. # Analyze a given results directory for rcutorture progress.
  4. #
  5. # Usage: kvm-recheck-rcu.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" -a -r "$i"
  26. then
  27. :
  28. else
  29. echo Unreadable results directory: $i
  30. exit 1
  31. fi
  32. . functions.sh
  33. configfile=`echo $i | sed -e 's/^.*\///'`
  34. ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
  35. if test -z "$ngps"
  36. then
  37. echo "$configfile -------"
  38. else
  39. title="$configfile ------- $ngps grace periods"
  40. dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
  41. if test -z "$dur"
  42. then
  43. :
  44. else
  45. ngpsps=`awk -v ngps=$ngps -v dur=$dur '
  46. BEGIN { print ngps / dur }' < /dev/null`
  47. title="$title ($ngpsps per second)"
  48. fi
  49. echo $title
  50. nclosecalls=`grep --binary-files=text 'torture: Reader Batch' $i/console.log | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
  51. if test -z "$nclosecalls"
  52. then
  53. exit 0
  54. fi
  55. if test "$nclosecalls" -eq 0
  56. then
  57. exit 0
  58. fi
  59. # Compute number of close calls per tenth of an hour
  60. nclosecalls10=`awk -v nclosecalls=$nclosecalls -v dur=$dur 'BEGIN { print int(nclosecalls * 36000 / dur) }' < /dev/null`
  61. if test $nclosecalls10 -gt 5 -a $nclosecalls -gt 1
  62. then
  63. print_bug $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i
  64. else
  65. print_warning $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i
  66. fi
  67. fi