| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 1/2] xfstests: implemented _no_of_online_cpus() function |
| From: | Stanislav Kholmanskikh <stanislav.kholmanskikh@xxxxxxxxxx> |
| Date: | Wed, 23 Oct 2013 15:58:43 +0400 |
| Cc: | vasily.isaenko@xxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1382529524-2184-1-git-send-email-stanislav.kholmanskikh@xxxxxxxxxx> |
| References: | <1382529524-2184-1-git-send-email-stanislav.kholmanskikh@xxxxxxxxxx> |
Its purpose is to get a number of online cpus.
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@xxxxxxxxxx>
---
common/rc | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/common/rc b/common/rc
index 77e96c4..ff2f7fe 100644
--- a/common/rc
+++ b/common/rc
@@ -2145,6 +2145,25 @@ _scale_fsstress_args()
echo $args
}
+_no_of_online_cpus()
+{
+ count=0
+
+ for i in `cat /sys/devices/system/cpu/online | $SED_PROG 's/,/ /g'`; do
+ count=$(( $count + 1 ))
+
+ lnumber=`echo $i | cut -d '-' -f 1`
+ rnumber=`echo $i | cut -d '-' -f 2`
+
+ while [ $lnumber -lt $rnumber ]; do
+ lnumber=$(( $lnumber + 1 ))
+ count=$(( $count + 1 ))
+ done
+ done
+
+ echo $count
+}
+
run_check()
{
echo "# $@" >> $seqres.full 2>&1
--
1.7.1
|
| Previous by Date: | [PATCH] xfstests btrfs/020: test device replace on RO btrfs, Eryu Guan |
|---|---|
| Next by Date: | [PATCH 2/2] xfstests: generic/273: do not use /proc/cpuinfo, Stanislav Kholmanskikh |
| Previous by Thread: | Avoid of using /proc/cpuinfo in generic tests, Stanislav Kholmanskikh |
| Next by Thread: | Re: [PATCH 1/2] xfstests: implemented _no_of_online_cpus() function, Carlos Maiolino |
| Indexes: | [Date] [Thread] [Top] [All Lists] |