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>
TEST_NAME=$2
WARMUP=$3
+NODE_CPU_ARCH="$(uname -m)"
+
# write the result to stdout in json format
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
+ /usr/lib/lmbench/bin/bw_mem -W $WARMUP ${SIZE}k $TEST_NAME 2>&1 | output_json
+else
+ /usr/lib/lmbench/bin/x86_64-linux-gnu/bw_mem -W $WARMUP ${SIZE}k $TEST_NAME 2>&1 | output_json
+fi
shift
STRIDE=$1
+NODE_CPU_ARCH="$(uname -m)"
+
# write the result to stdout in json format
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
+ /usr/lib/lmbench/bin/lat_mem_rd $SIZE $STRIDE 2>&1 | output_json
+else
+ /usr/lib/lmbench/bin/x86_64-linux-gnu/lat_mem_rd $SIZE $STRIDE 2>&1 | output_json
+fi
REPETITON=$1
WARMUP=$2
+NODE_CPU_ARCH="$(uname -m)"
+
# write the result to stdout in json format
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
+ /usr/lib/lmbench/bin/cache -W $WARMUP -N $REPETITON 2>&1 | output_json
+else
+ /usr/lib/lmbench/bin/x86_64-linux-gnu/cache -W $WARMUP -N $REPETITON 2>&1 | output_json
+fi