Linux-libre 5.3.12-gnu
[librecmc/linux-libre.git] / tools / testing / selftests / rcutorture / configs / lock / ver_functions.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0+
3 #
4 # Kernel-version-dependent shell functions for the rest of the scripts.
5 #
6 # Copyright (C) IBM Corporation, 2014
7 #
8 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
9
10 # locktorture_param_onoff bootparam-string config-file
11 #
12 # Adds onoff locktorture module parameters to kernels having it.
13 locktorture_param_onoff () {
14         if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
15         then
16                 echo CPU-hotplug kernel, adding locktorture onoff. 1>&2
17                 echo locktorture.onoff_interval=3 locktorture.onoff_holdoff=30
18         fi
19 }
20
21 # per_version_boot_params bootparam-string config-file seconds
22 #
23 # Adds per-version torture-module parameters to kernels supporting them.
24 per_version_boot_params () {
25         echo $1 `locktorture_param_onoff "$1" "$2"` \
26                 locktorture.stat_interval=15 \
27                 locktorture.shutdown_secs=$3 \
28                 locktorture.verbose=1
29 }