From: Poornima Nayak <mpnayak@linux.vnet.ibm.com>
To: ltp-list@lists.sourceforge.net, svaidy@linux.vnet.ibm.com,
ego@in.ibm.com, arun@linux.vnet.ibm.com
Subject: [LTP] [Patch 5/8] Modified library functions based on review comments
Date: Fri, 28 Aug 2009 15:45:14 +0530 [thread overview]
Message-ID: <20090828101514.12177.34040.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090828101440.12177.32012.sendpatchset@localhost.localdomain>
Incorporated Garrett Cooper's comments & hence modified code
Signed-off-by: poornima nayak <mpnayak@linux.vnet.ibm.com>
diff -uprN ltp_orig/testcases/kernel/power_management/pm_include.sh ltp/testcases/kernel/power_management/pm_include.sh
--- ltp_orig/testcases/kernel/power_management/pm_include.sh 2009-08-28 10:54:59.000000000 +0530
+++ ltp/testcases/kernel/power_management/pm_include.sh 2009-08-28 12:34:00.000000000 +0530
@@ -9,20 +9,23 @@ MISSING_FILE=3
UNTESTED=4
YES=0
-function cleanup() {
+cleanup() {
if [ -f ${1} ] ; then
rm -f ${1}
fi
}
-function check_config_options() {
+
+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() {
+
+no_of_cpus() {
echo $(cat /proc/cpuinfo | grep processor | wc -l)
}
-function get_topology() {
+
+get_topology() {
declare -a cpus
declare -a phyid
@@ -43,7 +46,8 @@ function get_topology() {
(( j+=1 ))
done
}
-function check_cpufreq() {
+
+check_cpufreq() {
total_cpus=$(no_of_cpus)
(( total_cpus-=1 ))
@@ -55,24 +59,22 @@ function check_cpufreq() {
fi
done
}
-function get_supporting_freq() {
+
+get_supporting_freq() {
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies | uniq
}
-function get_supporting_govr() {
+
+get_supporting_govr() {
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors | uniq
}
-function is_hyper_threaded() {
+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
+ [ $siblins > $cpu_cores ]; return $?
}
-function check_input() {
+check_input() {
validity_check=${2:-valid}
testfile=$3
if [ "${validity_check}" = "invalid" ] ; then
@@ -103,61 +105,39 @@ function check_input() {
return $RC
}
-function is_multi_socket() {
+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
+ [ $no_of_sockets -gt 1 ] ; return $?
}
-function is_multi_core() {
+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
+ [ $cpu_cores -gt 1 ]; return $?
else
: $(( num_of_cpus = siblings / cpu_cores ))
- if [ $num_of_cpus -gt 1 ]; then
- return 0
- else
- return 1
- fi
+ [ $num_of_cpus -gt 1 ]; return $?
fi
}
-function is_dual_core() {
+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
+ [ $cpu_cores -eq 2 ]; return $?
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
+ [ $num_of_cpus -eq 2 ]; return $?
fi
}
-function get_kernel_version() {
+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() {
+get_valid_input() {
kernel_version=$1
case "$kernel_version" in
'2.6.26' | '2.6.27' | '2.6.28')
@@ -166,22 +146,14 @@ function get_valid_input() {
esac
}
-function check_supp_wkld() {
+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
+ 1) [ "$work_load" == "ebizzy" ]; return $?
;;
- 2) if [ "$work_load" == "ebizzy" -o "$work_load" == "kernbench" ]; then
- return 0
- else
- return 1
- fi
+ 2) [ "$work_load" == "ebizzy" -o "$work_load" == "kernbench" ]; return $?
;;
*)
return 1
@@ -189,7 +161,7 @@ function check_supp_wkld() {
esac
}
-function analyze_wrt_workload_hyperthreaded() {
+analyze_wrt_workload_hyperthreaded() {
sched_mc=$1
work_load=$2
pass_count=$3
@@ -223,7 +195,7 @@ unsupported workload $work_load when sch
esac
}
-function analyze_wrt_wkld() {
+analyze_wrt_wkld() {
sched_mc=$1
work_load=$2
pass_count=$3
@@ -257,7 +229,7 @@ unsupported workload $work_load when sch
fi
}
-function analyze_result_hyperthreaded() {
+analyze_result_hyperthreaded() {
sched_mc=$1
work_load=$2
pass_count=$3
@@ -299,13 +271,12 @@ $sched_mc for workload=$work_load"
esac
}
-function analyze_package_consolidation_result() {
+analyze_package_consolidation_result() {
sched_mc=$1
work_load=$2
pass_count=$3
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
else
@@ -326,7 +297,7 @@ $sched_mc for workload=$work_load"
fi
}
-function analyze_core_consolidation_result() {
+analyze_core_consolidation_result() {
sched_smt=$1
work_load=$2
pass_count=$3
@@ -353,7 +324,7 @@ unsupported workload $work_load when sch
esac
}
-function analyze_sched_domain_result(){
+analyze_sched_domain_result(){
sched_mc=$1
result=$2
sched_smt=$3
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2009-08-28 10:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-28 10:14 [LTP] [Patch 1/8] New testcase to validate Ideal Load Balancer Functionality Poornima Nayak
2009-08-28 10:14 ` [LTP] [Patch 2/8] Power management master script modified to integrate ILB testcase Poornima Nayak
2009-08-30 17:36 ` Subrata Modak
2009-08-28 10:14 ` [LTP] [Patch 3/8] Patch to integrate ILB testcase to LTP Poornima Nayak
2009-08-30 17:36 ` Subrata Modak
2009-08-28 10:15 ` [LTP] [Patch 4/8] Addional new reusable functions for ILB testing Poornima Nayak
2009-08-30 17:36 ` Subrata Modak
2009-08-28 10:15 ` Poornima Nayak [this message]
2009-08-30 17:36 ` [LTP] [Patch 5/8] Modified library functions based on review comments Subrata Modak
2009-08-28 10:15 ` [LTP] [Patch 6/8] Included new function to check feature versus kernel version Poornima Nayak
2009-08-30 17:36 ` Subrata Modak
2009-08-28 10:15 ` [LTP] [Patch 7/8] Patch for cpu_consolidation to incorporate changes in reusable function Poornima Nayak
2009-08-30 17:36 ` Subrata Modak
2009-08-28 10:15 ` [LTP] [Patch 8/8]Patch to modify Readme file as new functionality testcase is integrated Poornima Nayak
2009-08-30 17:37 ` Subrata Modak
2009-08-30 17:36 ` [LTP] [Patch 1/8] New testcase to validate Ideal Load Balancer Functionality Subrata Modak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090828101514.12177.34040.sendpatchset@localhost.localdomain \
--to=mpnayak@linux.vnet.ibm.com \
--cc=arun@linux.vnet.ibm.com \
--cc=ego@in.ibm.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=svaidy@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox