Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0+
0003 #
0004 # Kernel-version-dependent shell functions for the rest of the scripts.
0005 #
0006 # Copyright (C) IBM Corporation, 2013
0007 #
0008 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
0009 
0010 # rcutorture_param_n_barrier_cbs bootparam-string
0011 #
0012 # Adds n_barrier_cbs rcutorture module parameter if not already specified.
0013 rcutorture_param_n_barrier_cbs () {
0014         if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
0015         then
0016                 :
0017         else
0018                 echo rcutorture.n_barrier_cbs=4
0019         fi
0020 }
0021 
0022 # rcutorture_param_onoff bootparam-string config-file
0023 #
0024 # Adds onoff rcutorture module parameters to kernels having it.
0025 rcutorture_param_onoff () {
0026         if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
0027         then
0028                 echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2
0029                 echo rcutorture.onoff_interval=1000 rcutorture.onoff_holdoff=30
0030         fi
0031 }
0032 
0033 # rcutorture_param_stat_interval bootparam-string
0034 #
0035 # Adds stat_interval rcutorture module parameter if not already specified.
0036 rcutorture_param_stat_interval () {
0037         if echo $1 | grep -q "rcutorture\.stat_interval"
0038         then
0039                 :
0040         else
0041                 echo rcutorture.stat_interval=15
0042         fi
0043 }
0044 
0045 # per_version_boot_params bootparam-string config-file seconds
0046 #
0047 # Adds per-version torture-module parameters to kernels supporting them.
0048 per_version_boot_params () {
0049         echo $1 `rcutorture_param_onoff "$1" "$2"` \
0050                 `rcutorture_param_n_barrier_cbs "$1"` \
0051                 `rcutorture_param_stat_interval "$1"` \
0052                 rcutorture.shutdown_secs=$3 \
0053                 rcutorture.test_no_idle_hz=1 \
0054                 rcutorture.verbose=1
0055 }