ver_functions.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. #
  3. # Torture-suite-dependent shell functions for the rest of the scripts.
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, you can access it online at
  17. # http://www.gnu.org/licenses/gpl-2.0.html.
  18. #
  19. # Copyright (C) IBM Corporation, 2015
  20. #
  21. # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  22. # rcuperf_param_nreaders bootparam-string
  23. #
  24. # Adds nreaders rcuperf module parameter if not already specified.
  25. rcuperf_param_nreaders () {
  26. if ! echo "$1" | grep -q "rcuperf.nreaders"
  27. then
  28. echo rcuperf.nreaders=-1
  29. fi
  30. }
  31. # rcuperf_param_nwriters bootparam-string
  32. #
  33. # Adds nwriters rcuperf module parameter if not already specified.
  34. rcuperf_param_nwriters () {
  35. if ! echo "$1" | grep -q "rcuperf.nwriters"
  36. then
  37. echo rcuperf.nwriters=-1
  38. fi
  39. }
  40. # per_version_boot_params bootparam-string config-file seconds
  41. #
  42. # Adds per-version torture-module parameters to kernels supporting them.
  43. per_version_boot_params () {
  44. echo $1 `rcuperf_param_nreaders "$1"` \
  45. `rcuperf_param_nwriters "$1"` \
  46. rcuperf.perf_runnable=1 \
  47. rcuperf.shutdown=1 \
  48. rcuperf.verbose=1
  49. }