From fda97cff8a5bd0a9e2ff842c9b5f48c9a8e5fd5e Mon Sep 17 00:00:00 2001 From: "tone.zhang" Date: Sat, 16 Feb 2019 23:51:45 +0800 Subject: [PATCH] UT: Fix valgrind failure in SPDK UT on arm64 system When ran SPDK UT on arm64 system, observerd the valgrind fault: ARM64 front end: branch_etc disInstr(arm64): unhandled instruction 0xD5380000 disInstr(arm64): 1101'0101 0011'1000 0000'0000 0000'0000 ==959274== valgrind: Unrecognised instruction at address 0x4014c90. It is because that arm64 is not supported completly in the latest valgrind release v3.13.0. With the patch, SPDK UT can run successfully on arm64 system. Change-Id: I5b77692f6b148b171fb07dcc1516d194d7ab58b9 Signed-off-by: tone.zhang Reviewed-on: https://review.gerrithub.io/c/444984 Reviewed-by: Darek Stojaczyk Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- test/unit/unittest.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index 6409885f0..814287889 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -46,6 +46,12 @@ if [ "$cov_avail" = "yes" ]; then # zero out coverage data $LCOV -q -c -i -d . -t "Baseline" -o $UT_COVERAGE/ut_cov_base.info fi + +# workaround for valgrind v3.13 on arm64 +if [ $(uname -m) = "aarch64" ]; then + export LD_HWCAP_MASK=1 +fi + $valgrind $testdir/include/spdk/histogram_data.h/histogram_ut $valgrind $testdir/lib/bdev/bdev.c/bdev_ut