summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Nemes <alexandru.nemes@enea.com>2017-06-02 13:26:30 +0300
committerAlexandru Nemes <alexandru.nemes@enea.com>2017-06-22 08:05:03 +0000
commitd3b6455e19f9bc291601ee6400d99552d1962711 (patch)
tree1b773f2c4a712da2398f20f1f0fd0f279e7c46d2
parent5bdc049447e44738f8a0d67228906c07fd94821e (diff)
Adapt lmbench scripts for aarch64 nodes
LMBench shell scripts were invoking x86_64 executables. This made them fail when executed on aarch64 nodes. Added architecture detection and proper command call. JIRA: ARMBAND-268 Change-Id: I8c9e87158631f7f5479adc2fda9558f9f7e54406 Signed-off-by: Alexandru Nemes <alexandru.nemes@enea.com> (cherry picked from commit fd2b3173d21d34720f714e7e6358dafe7d1ada12)
-rw-r--r--yardstick/benchmark/scenarios/compute/lmbench_bandwidth_benchmark.bash10
-rw-r--r--yardstick/benchmark/scenarios/compute/lmbench_latency_benchmark.bash9
-rw-r--r--yardstick/benchmark/scenarios/compute/lmbench_latency_for_cache.bash9
3 files changed, 25 insertions, 3 deletions
diff --git a/yardstick/benchmark/scenarios/compute/lmbench_bandwidth_benchmark.bash b/yardstick/benchmark/scenarios/compute/lmbench_bandwidth_benchmark.bash
index 09993a088..1a25121c7 100644
--- a/yardstick/benchmark/scenarios/compute/lmbench_bandwidth_benchmark.bash
+++ b/yardstick/benchmark/scenarios/compute/lmbench_bandwidth_benchmark.bash
@@ -19,6 +19,8 @@ SIZE=$1
TEST_NAME=$2
WARMUP=$3
+NODE_CPU_ARCH="$(uname -m)"
+
# write the result to stdout in json format
output_json()
{
@@ -26,4 +28,10 @@ output_json()
echo $DATA | awk '/ /{printf "{\"size(MB)\": %s, \"bandwidth(MBps)\": %s}", $1, $2}'
}
-/usr/lib/lmbench/bin/x86_64-linux-gnu/bw_mem -W $WARMUP ${SIZE}k $TEST_NAME 2>&1 | output_json \ No newline at end of file
+if [ "${NODE_CPU_ARCH}" == "aarch64" ]; then
+ REL_PATH="bw_mem"
+else
+ REL_PATH="x86_64-linux-gnu/bw_mem"
+fi
+
+/usr/lib/lmbench/bin/${REL_PATH} -W $WARMUP ${SIZE}k $TEST_NAME 2>&1 | output_json \ No newline at end of file
diff --git a/yardstick/benchmark/scenarios/compute/lmbench_latency_benchmark.bash b/yardstick/benchmark/scenarios/compute/lmbench_latency_benchmark.bash
index 04e3c1a9d..be27a87b0 100644
--- a/yardstick/benchmark/scenarios/compute/lmbench_latency_benchmark.bash
+++ b/yardstick/benchmark/scenarios/compute/lmbench_latency_benchmark.bash
@@ -19,6 +19,8 @@ SIZE=$1
shift
STRIDE=$1
+NODE_CPU_ARCH="$(uname -m)"
+
# write the result to stdout in json format
output_json()
{
@@ -37,5 +39,10 @@ output_json()
echo ]
}
-/usr/lib/lmbench/bin/x86_64-linux-gnu/lat_mem_rd $SIZE $STRIDE 2>&1 | output_json
+if [ "${NODE_CPU_ARCH}" == "aarch64" ]; then
+ REL_PATH="lat_mem_rd"
+else
+ REL_PATH="x86_64-linux-gnu/lat_mem_rd"
+fi
+/usr/lib/lmbench/bin/${REL_PATH} $SIZE $STRIDE 2>&1 | output_json \ No newline at end of file
diff --git a/yardstick/benchmark/scenarios/compute/lmbench_latency_for_cache.bash b/yardstick/benchmark/scenarios/compute/lmbench_latency_for_cache.bash
index 2ed1bbe14..dd5d6292e 100644
--- a/yardstick/benchmark/scenarios/compute/lmbench_latency_for_cache.bash
+++ b/yardstick/benchmark/scenarios/compute/lmbench_latency_for_cache.bash
@@ -18,6 +18,8 @@ set -e
REPETITON=$1
WARMUP=$2
+NODE_CPU_ARCH="$(uname -m)"
+
# write the result to stdout in json format
output_json()
{
@@ -25,5 +27,10 @@ output_json()
echo $DATA | awk '{printf "{\"L1cache\": %s}", $5}'
}
-/usr/lib/lmbench/bin/x86_64-linux-gnu/cache -W $WARMUP -N $REPETITON 2>&1 | output_json
+if [ "${NODE_CPU_ARCH}" == "aarch64" ]; then
+ REL_PATH="cache"
+else
+ REL_PATH="x86_64-linux-gnu/cache"
+fi
+/usr/lib/lmbench/bin/${REL_PATH} -W $WARMUP -N $REPETITON 2>&1 | output_json \ No newline at end of file