ver_functions.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. #
  3. # Kernel-version-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, 2013
  20. #
  21. # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  22. # rcutorture_param_n_barrier_cbs bootparam-string
  23. #
  24. # Adds n_barrier_cbs rcutorture module parameter to kernels having it.
  25. rcutorture_param_n_barrier_cbs () {
  26. if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
  27. then
  28. :
  29. else
  30. echo rcutorture.n_barrier_cbs=4
  31. fi
  32. }
  33. # rcutorture_param_onoff bootparam-string config-file
  34. #
  35. # Adds onoff rcutorture module parameters to kernels having it.
  36. rcutorture_param_onoff () {
  37. if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
  38. then
  39. echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2
  40. echo rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
  41. fi
  42. }
  43. # per_version_boot_params bootparam-string config-file seconds
  44. #
  45. # Adds per-version torture-module parameters to kernels supporting them.
  46. per_version_boot_params () {
  47. echo $1 `rcutorture_param_onoff "$1" "$2"` \
  48. `rcutorture_param_n_barrier_cbs "$1"` \
  49. rcutorture.stat_interval=15 \
  50. rcutorture.shutdown_secs=$3 \
  51. rcutorture.torture_runnable=1 \
  52. rcutorture.test_no_idle_hz=1 \
  53. rcutorture.verbose=1
  54. }