From: Subrata <sub...@us...> - 2009-08-30 16:51:52
|
Update of /cvsroot/ltp/ltp/testcases/kernel/power_management In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27863/ltp/testcases/kernel/power_management Modified Files: pm_include.sh Log Message: To test ILB feature in Power management a set of testcases has been developed. These patches tests ILB with respect to different test variables sched_mc, sched_smt and workload. The patches sent has been tested on Quad core machine. [Patch 5/8] Modified library functions based on review comments: Incorporated Garrett Cooper's comments & hence modified code. Signed-off-by: poornima nayak <mp...@li...>. Index: pm_include.sh =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/power_management/pm_include.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pm_include.sh 23 Aug 2009 06:49:12 -0000 1.5 --- pm_include.sh 30 Aug 2009 16:51:42 -0000 1.6 *************** *** 10,27 **** YES=0 ! function cleanup() { if [ -f ${1} ] ; then rm -f ${1} fi } ! function check_config_options() { if ( ! ${3} "${1}" ${2} | grep -v "#" > /dev/null ) ; then echo "NOSUPPORT: current system dosen't support ${1}" fi } ! function no_of_cpus() { echo $(cat /proc/cpuinfo | grep processor | wc -l) } ! function get_topology() { declare -a cpus declare -a phyid --- 10,30 ---- YES=0 ! cleanup() { if [ -f ${1} ] ; then rm -f ${1} fi } ! ! check_config_options() { if ( ! ${3} "${1}" ${2} | grep -v "#" > /dev/null ) ; then echo "NOSUPPORT: current system dosen't support ${1}" fi } ! ! no_of_cpus() { echo $(cat /proc/cpuinfo | grep processor | wc -l) } ! ! get_topology() { declare -a cpus declare -a phyid *************** *** 44,48 **** done } ! function check_cpufreq() { total_cpus=$(no_of_cpus) (( total_cpus-=1 )) --- 47,52 ---- done } ! ! check_cpufreq() { total_cpus=$(no_of_cpus) (( total_cpus-=1 )) *************** *** 56,77 **** done } ! function get_supporting_freq() { cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies | uniq } ! function get_supporting_govr() { cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors | uniq } ! function is_hyper_threaded() { siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'` cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'` ! if [ $siblings -eq $cpu_cores ]; then ! return 1 ! else ! return 0 ! fi } ! function check_input() { validity_check=${2:-valid} testfile=$3 --- 60,79 ---- done } ! ! get_supporting_freq() { cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies | uniq } ! ! get_supporting_govr() { cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors | uniq } ! is_hyper_threaded() { siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'` cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'` ! [ $siblins > $cpu_cores ]; return $? } ! check_input() { validity_check=${2:-valid} testfile=$3 *************** *** 104,162 **** } ! function is_multi_socket() { no_of_sockets=`cat /sys/devices/system/cpu/cpu?/topology/physical_package_id | uniq | wc -l` ! if [ $no_of_sockets -gt 1 ] ; then ! return 0 ! else ! return 1 ! fi } ! function is_multi_core() { siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'` cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'` - echo "siblings count $siblings cores count $cpu_cores" if [ $siblings -eq $cpu_cores ]; then ! if [ $cpu_cores -gt 1 ]; then ! return 0 ! else ! return 1 ! fi else : $(( num_of_cpus = siblings / cpu_cores )) ! if [ $num_of_cpus -gt 1 ]; then ! return 0 ! else ! return 1 ! fi fi } ! function is_dual_core() { siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'` cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'` if [ $siblings -eq $cpu_cores ]; then ! if [ $cpu_cores -eq 2 ]; then ! return 1 ! else ! return 0 ! fi else : $(( num_of_cpus = siblings / cpu_cores )) ! if [ $num_of_cpus -eq 2 ]; then ! echo "number of cpus $num_of_cpus" ! return 1 ! else ! return 0 ! fi fi } ! function get_kernel_version() { # Get kernel minor version export kernel_version=`uname -r | awk -F. '{print $1"."$2"."$3}' | cut -f1 -d'-'` } ! function get_valid_input() { kernel_version=$1 case "$kernel_version" in --- 106,142 ---- } ! is_multi_socket() { no_of_sockets=`cat /sys/devices/system/cpu/cpu?/topology/physical_package_id | uniq | wc -l` ! [ $no_of_sockets -gt 1 ] ; return $? } ! is_multi_core() { siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'` cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'` if [ $siblings -eq $cpu_cores ]; then ! [ $cpu_cores -gt 1 ]; return $? else : $(( num_of_cpus = siblings / cpu_cores )) ! [ $num_of_cpus -gt 1 ]; return $? fi } ! is_dual_core() { siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'` cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'` if [ $siblings -eq $cpu_cores ]; then ! [ $cpu_cores -eq 2 ]; return $? else : $(( num_of_cpus = siblings / cpu_cores )) ! [ $num_of_cpus -eq 2 ]; return $? fi } ! get_kernel_version() { # Get kernel minor version export kernel_version=`uname -r | awk -F. '{print $1"."$2"."$3}' | cut -f1 -d'-'` } ! get_valid_input() { kernel_version=$1 case "$kernel_version" in *************** *** 167,186 **** } ! function check_supp_wkld() { sched_mcsmt=$1 work_load=$2 case "$sched_mcsmt" in ! 1) if [ "$work_load" == "ebizzy" ]; then ! return 0 ! else ! return 1 ! fi ;; ! 2) if [ "$work_load" == "ebizzy" -o "$work_load" == "kernbench" ]; then ! return 0 ! else ! return 1 ! fi ;; *) --- 147,158 ---- } ! check_supp_wkld() { sched_mcsmt=$1 work_load=$2 case "$sched_mcsmt" in ! 1) [ "$work_load" == "ebizzy" ]; return $? ;; ! 2) [ "$work_load" == "ebizzy" -o "$work_load" == "kernbench" ]; return $? ;; *) *************** *** 190,194 **** } ! function analyze_wrt_workload_hyperthreaded() { sched_mc=$1 work_load=$2 --- 162,166 ---- } ! analyze_wrt_workload_hyperthreaded() { sched_mc=$1 work_load=$2 *************** *** 224,228 **** } ! function analyze_wrt_wkld() { sched_mc=$1 work_load=$2 --- 196,200 ---- } ! analyze_wrt_wkld() { sched_mc=$1 work_load=$2 *************** *** 258,262 **** } ! function analyze_result_hyperthreaded() { sched_mc=$1 work_load=$2 --- 230,234 ---- } ! analyze_result_hyperthreaded() { sched_mc=$1 work_load=$2 *************** *** 300,304 **** } ! function analyze_package_consolidation_result() { sched_mc=$1 work_load=$2 --- 272,276 ---- } ! analyze_package_consolidation_result() { sched_mc=$1 work_load=$2 *************** *** 306,310 **** sched_smt=$4 - echo "sched mc $sched_mc sched smt is $sched_smt workload $work_load pass count $pass_count" if [ $hyper_threaded -eq $YES ]; then analyze_result_hyperthreaded $sched_mc $work_load $pass_count $sched_smt --- 278,281 ---- *************** *** 327,331 **** } ! function analyze_core_consolidation_result() { sched_smt=$1 work_load=$2 --- 298,302 ---- } ! analyze_core_consolidation_result() { sched_smt=$1 work_load=$2 *************** *** 354,358 **** } ! function analyze_sched_domain_result(){ sched_mc=$1 result=$2 --- 325,329 ---- } ! analyze_sched_domain_result(){ sched_mc=$1 result=$2 |