printf "Inserting $1 module\n" # insert module
insmod $1 if [ $? != 0 ]; then
ktap_exit_fail_msg "Insmod $1 failed\n" fi
printf "Removing $1 module\n" # remove module
rmmod $1 if [ $? != 0 ]; then
ktap_exit_fail_msg "rmmod $1 failed\n" fi
printf "\n"
}
# Insert cpufreq driver module and perform basic tests # $1: cpufreq-driver module to insert # $2: If we want to play with CPUs (1) or not (0)
module_driver_test_single()
{
printf "** Test: Running ${FUNCNAME[0]} for driver $1 and cpus_hotplug=$2 **\n\n"
if [ $2 -eq 1 ]; then # offline all non-boot CPUs
for_each_non_boot_cpu offline_cpu
printf "\n" fi
# insert module
printf "Inserting $1 module\n\n"
insmod $1 if [ $? != 0 ]; then
printf "Insmod $1 failed\n"
return; fi
if [ $2 -eq 1 ]; then # online all non-boot CPUs
for_each_non_boot_cpu online_cpu
printf "\n" fi
# run basic tests
cpufreq_basic_tests
# remove module
printf "Removing $1 module\n\n"
rmmod $1 if [ $? != 0 ]; then
printf "rmmod $1 failed\n"
return; fi
# There shouldn't be any cpufreq directories now.
for_each_cpu cpu_should_not_have_cpufreq_directory
printf "\n"
}
# switch to new governor
printf "Switch from $CUR_GOV to $1\n"
switch_show_governor $3 $1
# try removing module, it should fail as governor is used
printf "Removing $2 module\n\n"
rmmod $2 if [ $? = 0 ]; then
printf "WARN: rmmod $2 succeeded even if governor is used\n"
insmod $2 else
printf "Pass: unable to remove $2 while it is being used\n\n" fi
# switch back to old governor
printf "Switchback to $CUR_GOV from $1\n"
restore_governor $3
printf "\n"
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.