From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp15.mail.ru (smtp15.mail.ru [94.100.176.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 653104696C3 for ; Wed, 15 Apr 2020 19:03:32 +0300 (MSK) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) From: Serge Petrenko In-Reply-To: <57e4a60ed158cec91fa18ed020dd0896d2da00f7.1576824858.git.avtikhon@tarantool.org> Date: Wed, 15 Apr 2020 19:03:31 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <853BAC98-35BB-4111-9A9D-E0BF17DA1A0E@tarantool.org> References: <57e4a60ed158cec91fa18ed020dd0896d2da00f7.1576824858.git.avtikhon@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v1] test: add ARM at travis-ci List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Alexander V. Tikhonov" Cc: tml Hi! Thanks for the patch! Let me add my 5 cents. > 20 =D0=B4=D0=B5=D0=BA. 2019 =D0=B3., =D0=B2 09:55, Alexander V. = Tikhonov =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB= (=D0=B0): >=20 > Added ARM architecture for testing release and > debug Tarantool builds on Travis-ci. >=20 > Close #4270 > --- >=20 > Github: = https://github.com/tarantool/tarantool/tree/avtikhon/gh-4270-travis-ci-arm= > Issue: https://github.com/tarantool/tarantool/issues/4270 >=20 > .gitlab-ci.yml | 11 +++++++++++ > .travis.mk | 12 ++++++++++++ > src/lib/core/fiber.c | 17 ++++++++++++++++- > 3 files changed, 39 insertions(+), 1 deletion(-) >=20 > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml > index 3af5a3c8a..1603b65e3 100644 > --- a/.gitlab-ci.yml > +++ b/.gitlab-ci.yml > @@ -90,6 +90,17 @@ release_asan_clang8: > script: > - ${GITLAB_MAKE} test_asan_debian_no_deps >=20 > +release_arm: > + stage: test > + tags: > + - test > + variables: > + DOCKER_IMAGE: = "${CI_REGISTRY}/${CI_PROJECT_PATH}/testing/arm64v8-debian-buster:latest" > + DOCKER_OPTIONS: "--network=3Dhost" > + CMAKE_EXTRA_PARAMS: -DENABLE_BACKTRACE=3DOFF > + script: > + - ${GITLAB_MAKE} test_arm_debian_no_deps > + > osx_13_release: > <<: *release_only_definition > <<: *vbox_definition > diff --git a/.travis.mk b/.travis.mk > index 42969ff56..1427d5b2f 100644 > --- a/.travis.mk > +++ b/.travis.mk > @@ -24,6 +24,7 @@ asan: docker_test_asan_debian > docker_%: > mkdir -p ~/.cache/ccache > docker run \ > + ${DOCKER_OPTIONS} \ > --rm=3Dtrue --tty=3Dtrue \ > --volume "${PWD}:/tarantool" \ > --volume "${HOME}/.cache:/cache" \ > @@ -123,6 +124,17 @@ test_asan_debian_no_deps: build_asan_debian >=20 > test_asan_debian: deps_debian deps_buster_clang_8 = test_asan_debian_no_deps >=20 > +####### > +# ARM # > +####### > + > +qemu_arm_debian: > + docker run --rm --privileged multiarch/qemu-user-static --reset = -p yes > + > +build_arm_debian: qemu_arm_debian docker_build_debian > + > +test_arm_debian_no_deps: qemu_arm_debian docker_test_debian_no_deps > + > ####### > # OSX # > ####### > diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c > index 00ae8cded..6ef3c22db 100644 > --- a/src/lib/core/fiber.c > +++ b/src/lib/core/fiber.c > @@ -43,7 +43,22 @@ > #include "trigger.h" >=20 > #if ENABLE_FIBER_TOP > +#if !defined(__arm__) && !defined(__aarch64__) && = !defined(__powerpc64__) && !defined(__PPC64__) && \ > + !defined(__powerpc__) > #include /* __rdtscp() */ > +#elif defined(__aarch64__) > +static __inline__ unsigned long long __rdtscp(uint32_t *cpu_id) Please check src/lib/core/fiber.h It disables fiber.top for ARM architecture: ``` /* = =20 * Fiber top doesn't work on ARM processors at the moment, = =20 * because we haven't chosen an alternative to rdtsc. = =20 */ = =20 #ifdef __CC_ARM = =20 #define ENABLE_FIBER_TOP 0 = =20 #else = =20 #define ENABLE_FIBER_TOP 1 = =20 #endif ``` So, it looks like your patch not only adds ARM testing, but also closes = a relevant ticket re fiber.top = (https://github.com/tarantool/tarantool/issues/4573) [Implement fiber.top() for ARM]. Anyway, this is worth a separate patch, and IMO in this patch you should = just disable fiber.top() test on ARM somehow. As I can see you tried to implement it = on arm because otherwise the test would fail. > +{ > + // System timer of ARMv8 runs at a different frequency than = the CPU's. > + // The frequency is fixed, typically in the range 1-50MHz. It = can be > + // read at CNTFRQ special register. We assume the OS has set = up > + // the virtual timer properly. > + if (!cpu_id) { cpu_id =3D 0; } > + int64_t virtual_timer_value; > + __asm__ volatile("mrs %0, cntvct_el0" : = "=3Dr"(virtual_timer_value)); > + return virtual_timer_value; > +} > +#endif >=20 > static inline void > clock_stat_add_delta(struct clock_stat *stat, uint64_t clock_delta) > @@ -109,7 +124,7 @@ cpu_stat_reset(struct cpu_stat *stat) > static uint64_t > cpu_stat_on_csw(struct cpu_stat *stat) > { > - uint32_t cpu_id; > + uint32_t cpu_id =3D 0; > uint64_t delta, clock =3D __rdtscp(&cpu_id); >=20 > if (cpu_id =3D=3D stat->prev_cpu_id) { > =E2=80=94=20 > 2.17.1 >=20 -- Serge Petrenko sergepetrenko@tarantool.org