From 6d3738a5da2db66f17df850010a49ecc82f8741d Mon Sep 17 00:00:00 2001 From: Santosh Shukla Date: Tue, 19 Aug 2014 21:52:58 +0530 Subject: is-cpu-isolated.sh: show script version information add -v (version) switch into getopt to show version information. Change-Id: I92f8bb240e4b1658f52334e1c0b1d248a16c7a82 Signed-off-by: Santosh Shukla Acked-by: Viresh Kumar Not-Tested-by: Viresh Kumar --- common/scripts/is-cpu-isolated.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh index 3c8d0b9..99ae303 100755 --- a/common/scripts/is-cpu-isolated.sh +++ b/common/scripts/is-cpu-isolated.sh @@ -24,6 +24,7 @@ NON_ISOL_CPUS="0" # CPU not to isolate, zero will always be there as we can't st DEBUG_SCRIPT=1 # Print debug messages, set 0 if not required TASK="stress" # Single threaded task to Run on Isolated CPUs FUNC="all" # Perform complete isolation test by default +SCRIPT_VERSION=1.0 # To track release version RESULT="PASS" # Variables to keep an eye on total interrupt counts @@ -428,7 +429,7 @@ clear_cpusets() { # Execution starts from HERE -USAGE="Usage: $0 [-h] [-ctfsd args] [-c ] [-t ] [-f ] [-s ] [-d ]" +USAGE="Usage: $0 [-hv] [-ctfsd args] [-c ] [-t ] [-f ] [-s ] [-d ]" # Run isolation test for $FUNC run_func() @@ -468,7 +469,7 @@ run_func() # Parse isol arguments parse_arguments() { - while getopts hc:t:f:s:d: arguments 2>/dev/null + while getopts hvc:t:f:s:d: arguments 2>/dev/null do case $arguments in h) # --help @@ -476,6 +477,11 @@ parse_arguments() exit 0 ;; + v) # --script version + isdebug echo "$0 Version $SCRIPT_VERSION" + exit 0 + ;; + c) # --cpu (comma separated isol cpulist, default cpu1) ISOL_CPUS=$OPTARG ;; -- cgit v1.2.3