From: Subrata <sub...@us...> - 2009-09-21 16:15:03
|
Update of /cvsroot/ltp/ltp/testcases/kernel/power_management In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32641/ltp/testcases/kernel/power_management Modified Files: pm_include.sh Log Message: Modified library functions based on review comments. 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.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pm_include.sh 30 Aug 2009 16:51:42 -0000 1.6 --- pm_include.sh 21 Sep 2009 16:14:55 -0000 1.7 *************** *** 72,76 **** 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 $? } --- 72,76 ---- siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'` cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'` ! [ $siblings > $cpu_cores ]; return $? } *************** *** 147,271 **** } - 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 $? - ;; - *) - return 1 - ;; - esac - } - - analyze_wrt_workload_hyperthreaded() { - sched_mc=$1 - work_load=$2 - pass_count=$3 - sched_smt=$4 - - if [ $sched_mc -gt $sched_smt ]; then - check_supp_wkld $sched_mc $work_load; valid_workload=$? - else - check_supp_wkld $sched_smt $work_load; valid_workload=$? - fi - - case "$valid_workload" in - 0) - if [ $pass_count -lt 5 ]; then - RC=1 - tst_resm TFAIL "Consolidation at package level failed for \ - sched_mc=$sched_mc, sched_smt=$sched_smt for workload=$work_load" - else - tst_resm TPASS "Consolidation at package level passed for \ - sched_mc=$sched_mc, sched_smt=$sched_smt & workload=$work_load" - fi ;; - 1) - if [ $pass_count -lt 5 ]; then - tst_resm TPASS "Consolidation at package level failed for \ - unsupported workload $work_load when sched_mc=$sched_mc & sched_smt=$sched_smt" - else - RC=1 - tst_resm TFAIL "Consolidation at package level passed for \ - unsupported workload $work_load when sched_mc=$sched_mc & sched_smt=$sched_smt" - fi ;; - esac - } - - analyze_wrt_wkld() { - sched_mc=$1 - work_load=$2 - pass_count=$3 - sched_smt=$4 - - check_supp_wkld $sched_mc $work_load; valid_workload=$? - if [ $hyper_threaded -eq $YES ]; then - analyze_wrt_workload_hyperthreaded $sched_mc $work_load $pass_count\ - $sched_smt - else - case "$valid_workload" in - 0) - if [ "$pass_count" -lt 5 ]; then - RC=1 - tst_resm TFAIL "cpu consolidation failed for \ - sched_mc=$sched_mc for workload=$work_load" - else - tst_resm TPASS "cpu consolidation passed for \ - sched_mc=$sched_mc for workload=$work_load" - fi ;; - 1) - if [ "$pass_count" -lt 5 ]; then - tst_resm TPASS "cpu consolidation failed for \ - unsupported workload $work_load when sched_mc=$sched_mc" - else - RC=1 - tst_resm TFAIL "cpu consolidation passed for \ - unsupported workload $work_load when sched_mc=$sched_mc" - fi ;; - esac - fi - } - analyze_result_hyperthreaded() { sched_mc=$1 - work_load=$2 pass_count=$3 sched_smt=$4 - echo "sched_mc =$sched_mc work-load=$work_load pass_count=$pass_count sched_smt=$sched_smt" case "$sched_mc" in 0) ! if [ $sched_smt ]; then ! case "$sched_smt" in ! 0) ! if [ "$pass_count" -lt 5 ]; then ! tst_resm TPASS "cpu consolidation failed for sched_mc=\ ! $sched_mc & sched_smt=$sched_smt for workload=$work_load" ! else ! RC=1 ! tst_resm TFAIL "cpu consolidation passed for sched_mc=\ ! $sched_mc & sched_smt=$sched_smt for workload=$work_load" ! fi ! ;; ! *) ! analyze_wrt_wkld $sched_mc $work_load $pass_count $sched_smt ! ;; ! esac ! else if [ $pass_count -lt 5 ]; then tst_resm TPASS "cpu consolidation failed for sched_mc=\ ! $sched_mc for workload=$work_load" else RC=1 tst_resm TFAIL "cpu consolidation passed for sched_mc=\ ! $sched_mc for workload=$work_load" fi ! fi ! ;; *) ! analyze_wrt_wkld $sched_mc $work_load $pass_count $sched_smt ;; esac --- 147,188 ---- } analyze_result_hyperthreaded() { sched_mc=$1 pass_count=$3 sched_smt=$4 case "$sched_mc" in 0) ! case "$sched_smt" in ! 0) if [ $pass_count -lt 5 ]; then tst_resm TPASS "cpu consolidation failed for sched_mc=\ ! $sched_mc & sched_smt=$sched_smt" else RC=1 tst_resm TFAIL "cpu consolidation passed for sched_mc=\ ! $sched_mc & sched_smt=$sched_smt" fi ! ;; ! *) ! if [ $pass_count -lt 5 ]; then ! tst_resm TFAIL "cpu consolidation for sched_mc=\ ! $sched_mc & sched_smt=$sched_smt" ! else ! RC=1 ! tst_resm TPASS "cpu consolidation for sched_mc=\ ! $sched_mc & sched_smt=$sched_smt" ! fi ! ;; ! esac ;; *) ! if [ $pass_count -lt 5 ]; then ! tst_resm TFAIL "cpu consolidation for sched_mc=\ ! $sched_mc & sched_smt=$sched_smt" ! else ! RC=1 ! tst_resm TPASS "cpu consolidation for sched_mc=\ ! $sched_mc & sched_smt=$sched_smt" ! fi ;; esac *************** *** 274,283 **** analyze_package_consolidation_result() { sched_mc=$1 - work_load=$2 pass_count=$3 sched_smt=$4 ! if [ $hyper_threaded -eq $YES ]; then ! analyze_result_hyperthreaded $sched_mc $work_load $pass_count $sched_smt else case "$sched_mc" in --- 191,199 ---- analyze_package_consolidation_result() { sched_mc=$1 pass_count=$3 sched_smt=$4 ! if [ $hyper_threaded -eq $YES -a $sched_smt ]; then ! analyze_result_hyperthreaded $sched_mc $pass_count $sched_smt else case "$sched_mc" in *************** *** 285,296 **** if [ $pass_count -lt 5 ]; then tst_resm TPASS "cpu consolidation failed for sched_mc=\ ! $sched_mc for workload=$work_load" else RC=1 tst_resm TFAIL "cpu consolidation passed for sched_mc=\ ! $sched_mc for workload=$work_load" fi ;; *) ! analyze_wrt_wkld $sched_mc $work_load $pass_count ;; esac --- 201,218 ---- if [ $pass_count -lt 5 ]; then tst_resm TPASS "cpu consolidation failed for sched_mc=\ ! $sched_mc" else RC=1 tst_resm TFAIL "cpu consolidation passed for sched_mc=\ ! $sched_mc" fi ;; *) ! if [ $pass_count -lt 5 ]; then ! tst_resm TFAIL "Consolidation at package level failed for \ ! sched_mc=$sched_mc & sched_smt=$sched_smt" ! else ! tst_resm TPASS "Consolidation at package level passed for \ ! sched_mc=$sched_mc & sched_smt=$sched_smt" ! fi ;; esac *************** *** 300,324 **** analyze_core_consolidation_result() { sched_smt=$1 - work_load=$2 pass_count=$3 ! case "$valid_workload" in 0) if [ $pass_count -lt 5 ]; then RC=1 tst_resm TFAIL "Consolidation at core level failed for \ ! sched_mc=$sched_mc, sched_smt=$sched_smt for workload=$work_load" else tst_resm TPASS "Consolidation at core level passed for \ ! sched_mc=$sched_mc, sched_smt=$sched_smt & workload=$work_load" ! fi ;; ! 1) ! if [ $pass_count -lt 5 ]; then ! tst_resm TPASS "Consolidation at core level failed for \ ! unsupported workload $work_load when sched_mc=$sched_mc & sched_smt=$sched_smt" ! else ! RC=1 ! tst_resm TFAIL "Consolidation at core level passed for \ ! unsupported workload $work_load when sched_mc=$sched_mc & sched_smt=$sched_smt" fi ;; esac --- 222,244 ---- analyze_core_consolidation_result() { sched_smt=$1 pass_count=$3 ! case "$sched_smt" in 0) if [ $pass_count -lt 5 ]; then + tst_resm TPASS "Consolidation at core level failed \ + when sched_smt=$sched_smt" + else + tst_resm TFAIL "Consolidation at core level passed for \ + sched_smt=$sched_smt" + fi ;; + *) + if [ $pass_count -lt 5 ]; then RC=1 tst_resm TFAIL "Consolidation at core level failed for \ ! sched_smt=$sched_smt" else tst_resm TPASS "Consolidation at core level passed for \ ! sched_smt=$sched_smt" fi ;; esac |