travis: add basic CI support
PATCH v2 1/10 travis: add basic CI support
From: Roman Stratiienko <[email protected]>
---
Since v1: v4.20 removed and added to last commit
.travis.yml | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .travis.yml
.travis.yml new file +68 -0
@@ -0,0 +1,68 @@ +language: c +dist: xenial + +addons: + apt: + packages: + - gcc-aarch64-linux-gnu + - gcc-arm-linux-gnueabihf + - patch + - quilt + - wget + +env: + global: + - KDIR=/tmp/kernel + +install: + - if [[ "${KERNEL_VERSION}" == *-rc* ]]; then + KERNEL_URL=https://git.kernel.org/torvalds/t/linux-${KERNEL_VERSION}.tar.gz; + else + KERNEL_URL=https://www.kernel.org/pub/linux/kernel/v${KERNEL_VERSION::1}.x/linux-${KERNEL_VERSION}.tar.xz; + fi + - wget -O kernel.tar.xz ${KERNEL_URL} && mkdir ${KDIR} && tar -C ${KDIR} --strip=1 -xf kernel.tar.xz + - wget -O /tmp/ipipe.patch ${IPIPE_URL} + +before_script: + - case "${ARCH}" in + "arm64") export CROSS_COMPILE=aarch64-linux-gnu- + ;; + "arm" ) export CROSS_COMPILE=arm-linux-gnueabihf- + ;; + "x86" ) export CROSS_COMPILE= + ;; + esac + - pushd ${KDIR} + - make -j $(nproc) ${KERNEL_DEFCONFIG} + - ./scripts/config -e CONFIG_IPIPE + - ./scripts/config -e CONFIG_XENOMAI + - popd + +script: + - ./scripts/prepare-kernel.sh --ipipe=/tmp/ipipe.patch --arch=${ARCH} --linux=${KDIR} + - cd ${KDIR} + - make -j $(nproc) olddefconfig + - make -j $(nproc) all + +matrix: + include: + - env: + - ARCH: arm + KERNEL_VERSION: 4.14.85 + KERNEL_DEFCONFIG: multi_v7_defconfig + IPIPE_URL: https://xenomai.org/downloads/ipipe/v4.x/arm/ipipe-core-4.14.85-arm-6.patch + - env: + - ARCH: arm + KERNEL_VERSION: 4.1.18 + KERNEL_DEFCONFIG: multi_v7_defconfig + IPIPE_URL: https://xenomai.org/downloads/ipipe/v4.x/arm/older/ipipe-core-4.1.18-arm-9.patch + - env: + - ARCH: x86 + KERNEL_VERSION: 4.14.89 + KERNEL_DEFCONFIG: x86_64_defconfig + IPIPE_URL: https://xenomai.org/downloads/ipipe/v4.x/x86/ipipe-core-4.14.89-x86-2.patch + - env: + - ARCH: x86 + KERNEL_VERSION: 4.4.166 + KERNEL_DEFCONFIG: i386_defconfig + IPIPE_URL: https://xenomai.org/downloads/ipipe/v4.x/x86/ipipe-core-4.4.166-x86-12.patch
Signature · 1 line
2.17.1
PATCH v2 2/10 kernel: cobalt: replace ACCESS_ONCE with READ_ONCE
From: Roman Stratiienko <[email protected]>
READ_ONCE() introduced from v3.19 commit 230fa253df63 ("kernel: Provide READ_ONCE and ASSIGN_ONCE")
and ACCESS_ONCE() removed startibg from v4.15-rc4 commit b899a850431e ("compiler.h: Remove ACCESS_ONCE()") Replace ACCESS_ONCE with READ_ONCE and make READ_ONCE wrapper for case when READ_ONCE is not available (<v3.19)
This will fix build with v4.15
--- include/cobalt/uapi/kernel/urw.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/cobalt/uapi/kernel/urw.h +5 -1
@@ -53,11 +53,15 @@ typedef struct {#define URW_INITIALIZER { 0 }#define DEFINE_URW (__name) urw_t __name = URW_INITIALIZER +#ifndef READ_ONCE +#define READ_ONCE ACCESS_ONCE +#endif +static inline void __try_read_start (const urw_t *urw,urwstate_t *tmp) {__u32 token; repeat: - token =ACCESS_ONCE (urw->sequence); + token =READ_ONCE (urw->sequence);smp_rmb ();if (token &1 ) {cpu_relax ();
Signature · 1 line
2.17.1
PATCH v2 3/10 kernel: cobalt: use printk instead of print_symbol on v4.16 and later
In reply to [email protected]From: Roman Stratiienko <[email protected]>
print_symbol() removed since v4.16-rc1 commit d2279c9d7f7d ("kallsyms: remove print_symbol() function")
use print_symbol for version less than v4.16 and printk starting from v4.16
---
Since v1: add cast to (void *) to fix build warning
kernel/cobalt/posix/process.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/cobalt/posix/process.c +5 -0
@@ -747,8 +747,13 @@ static inline int handle_exception(struct ipipe_trap_data *d) }splexit (s);#endif /* CONFIG_XENO_ARCH_FPU */ +#if LINUX_VERSION_CODE >=KERNEL_VERSION (4 ,16 ,0 ) +printk ("invalid use of FPU in Xenomai context at %pS\n" , + (void *)xnarch_fault_pc (d)); +#else print_symbol ("invalid use of FPU in Xenomai context at %s\n" ,xnarch_fault_pc (d)); +#endif }/*
Signature · 1 line
2.17.1
PATCH v2 4/10 kernel: cobalt: forward SRCARCH from the scripts/prepare-kernel.sh
In reply to [email protected]From: Roman Stratiienko <[email protected]>
$SRCARCH removed since v4.18-rc1, upstream commit 104daea149c4 ("kconfig: reference environment variables directly and remove 'option env='")
This will fix build with v4.18
--- scripts/Kconfig.frag | 2 +- scripts/prepare-kernel.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
scripts/Kconfig.frag +1 -1
@@ -16,7 +16,7 @@ menuconfig XENOMAI Please visit http://xenomai.org for more information. if XENOMAI -source "arch/$SRCARCH/xenomai/Kconfig" +source "arch/@SRCARCH@/xenomai/Kconfig" endif if MIGRATION
scripts/prepare-kernel.sh +1 -0
@@ -376,6 +376,7 @@ case $linux_VERSION.$linux_PATCHLEVEL in -e "s,@VERSION_MINOR@,$version_minor,g" \ -e "s,@REVISION_LEVEL@,$revision_level,g" \ -e "s,@VERSION_STRING@,$version_string,g" \ + -e "s,@SRCARCH@,$linux_arch,g" \ $xenomai_root/scripts/Kconfig.frag | patch_append init/Kconfig fi
Signature · 1 line
2.17.1
PATCH v2 5/10 kernel: cobalt: trace: replace dummy array with field
In reply to [email protected]From: Roman Stratiienko <[email protected]>
After kernel v4.18 commit 4a0772cf0674
("tracing: Prevent further users of zero size static arrays in trace events") creating zero length arrays will force compile-time error
This will fix BUILD_BUG_ON error on v4.18 and later
---
Since v1: Changed to __field
kernel/cobalt/trace/cobalt-posix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cobalt/trace/cobalt-posix.h +1 -1
@@ -266,7 +266,7 @@ DECLARE_EVENT_CLASS(cobalt_void, TP_PROTO(int dummy),TP_ARGS (dummy),TP_STRUCT__entry ( - __array(char, dummy, 0) + __field(int ,dummy ) ), TP_fast_assign( (void)dummy;
Signature · 1 line
2.17.1
PATCH v2 6/10 kernel: cobalt: replace siginfo_t with kernel_siginfo_t
In reply to [email protected]From: Roman Stratiienko <[email protected]>
siginfo_t can't be used in kernel-space starting from v4.20-rc1 commit ae7795bc6187 ("signal: Distinguish between kernel_siginfo and siginfo") replace all siginfo_t to kernel_siginfo_t and create wrapper for kernel < v4.20
--- kernel/cobalt/include/linux/xenomai/wrappers.h | 4 ++++ kernel/cobalt/posix/process.c | 2 +- kernel/cobalt/thread.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-)
kernel/cobalt/include/linux/xenomai/wrappers.h +4 -0
@@ -49,4 +49,8 @@#define ipipe_root_nr_syscalls (ti) NR_syscalls#endif +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,20 ,0 ) +typedef siginfo_t kernel_siginfo_t ; +#endif +#endif /* !_COBALT_LINUX_WRAPPERS_H */
kernel/cobalt/posix/process.c +1 -1
@@ -583,7 +583,7 @@ static inline void clear_threadinfo(void)static inline int disable_ondemand_memory (void ) {struct task_struct *p = current; -siginfo_t si; +kernel_siginfo_t si;if ((p->mm->def_flags &VM_LOCKED ) ==0 ) {memset (&si,0 ,sizeof (si));
kernel/cobalt/thread.c +2 -2
@@ -2070,7 +2070,7 @@ void xnthread_relax(int notify, int reason)struct xnthread *thread =xnthread_current ();struct task_struct *p = current;int cpu__maybe_unused ; -siginfo_t si; +kernel_siginfo_t si;primary_mode_only ();
@@ -2183,7 +2183,7 @@ static void lostage_task_signal(struct ipipe_work_header *work)struct lostage_signal *rq;struct xnthread *thread;struct task_struct *p; -siginfo_t si; +kernel_siginfo_t si;int signo; rq = container_of(work, struct lostage_signal, work);
Signature · 1 line
2.17.1
PATCH v2 7/10 kernel: cobalt: rework access_rok and access_wok wrappers
In reply to [email protected]From: Roman Stratiienko <[email protected]>
Since kernel v5.0 upstream commit 96d4f267e40f ("Remove 'type' argument from access_ok() function")
access_ok() function takes only 2 parameters
Change access_rok and access_wok wrappers for kernels
starting from v5.0, and preserve them for earlier versions
This will fix build error on v5.0 and later
--- kernel/cobalt/include/asm-generic/xenomai/syscall.h | 5 +++++ 1 file changed, 5 insertions(+)
kernel/cobalt/include/asm-generic/xenomai/syscall.h +5 -0
@@ -27,8 +27,13 @@#include <asm/xenomai/machine.h> #include <cobalt/uapi/asm-generic/syscall.h> +#if LINUX_VERSION_CODE >=KERNEL_VERSION (5 ,0 ,0 ) +#define access_rok (addr, size) access_ok((addr), (size)) +#define access_wok (addr, size) access_ok((addr), (size)) +#else #define access_rok (addr, size) access_ok(VERIFY_READ, (addr), (size))#define access_wok (addr, size) access_ok(VERIFY_WRITE, (addr), (size)) +#endif #define __xn_reg_arglist (regs) \ __xn_reg_arg1(regs), \
Signature · 1 line
2.17.1
PATCH v2 8/10 kernel: cobalt: add missing quotes in Kconfig
In reply to [email protected]From: Roman Stratiienko <[email protected]>
Starting from kernel v5.0 commit f5451582c4e2 ("kconfig: stop supporting '.' and '/' in unquoted words") quotes are mandatory for usage
--- kernel/drivers/analogy/Kconfig | 8 ++++---- kernel/drivers/can/Kconfig | 4 ++-- scripts/Kconfig.frag | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
kernel/drivers/analogy/Kconfig +4 -4
@@ -48,9 +48,9 @@ config XENO_DRIVERS_ANALOGY_DRIVER_DEBUG_LEVEL WARNING: this threshold is only applied on the Analogy driver. That will not affect the core. -source drivers/xenomai/analogy/testing/Kconfig -source drivers/xenomai/analogy/intel/Kconfig -source drivers/xenomai/analogy/national_instruments/Kconfig -source drivers/xenomai/analogy/sensoray/Kconfig +source "drivers/xenomai/analogy/testing/Kconfig" +source "drivers/xenomai/analogy/intel/Kconfig" +source "drivers/xenomai/analogy/national_instruments/Kconfig" +source "drivers/xenomai/analogy/sensoray/Kconfig" endmenu
kernel/drivers/can/Kconfig +2 -2
@@ -85,7 +85,7 @@ config XENO_DRIVERS_CAN_FLEXCAN Say Y here if you want to support for Freescale FlexCAN. -source drivers/xenomai/can/mscan/Kconfig -source drivers/xenomai/can/sja1000/Kconfig +source "drivers/xenomai/can/mscan/Kconfig" +source "drivers/xenomai/can/sja1000/Kconfig" endmenu
scripts/Kconfig.frag +1 -1
@@ -48,4 +48,4 @@ config XENO_REVISION_LEVEL config XENO_VERSION_STRING string - default @VERSION_STRING@ + default "@VERSION_STRING@"
Signature · 1 line
2.17.1
PATCH v2 9/10 kernel: cobalt: migrate to ktime_t
In reply to [email protected]From: Roman Stratiienko <[email protected]>
As do_gettimeofday is very old and deprecated, use ktime instead
--- kernel/cobalt/clock.c | 4 +--- kernel/drivers/analogy/rtdm_helpers.c | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-)
kernel/cobalt/clock.c +1 -3
@@ -350,9 +350,7 @@ EXPORT_SYMBOL_GPL(xnclock_adjust);xnticks_t xnclock_get_host_time (void ) { -struct timeval tv; -do_gettimeofday (&tv); -return tv.tv_sec *1000000000ULL + tv.tv_usec *1000 ; +return ktime_to_ns (ktime_get_real ()); }EXPORT_SYMBOL_GPL (xnclock_get_host_time);
kernel/drivers/analogy/rtdm_helpers.c +1 -4
@@ -32,11 +32,8 @@ static nanosecs_abs_t a4l_clkofs;void a4l_init_time (void ) {nanosecs_abs_t t1, t2; -struct timeval tv; t1 =rtdm_clock_read (); -do_gettimeofday (&tv); - t2 =1000000000 * ((nanosecs_abs_t )tv.tv_sec) + -1000000 * ((nanosecs_abs_t )tv.tv_usec); + t2 =ktime_to_ns (ktime_get_real ()); a4l_clkofs = t2 - t1; }
Signature · 1 line
2.17.1
Re: [PATCH v2 09/10] kernel: cobalt: migrate to ktime_t
Quoted 33 lines · roman.stratiienko--- via Xenomai
From: Roman Stratiienko <[email protected]>
As
do_gettimeofdayis very old and deprecated, use ktime insteadSigned-off-by Roman Stratiienko <[email protected]>--- kernel/cobalt/clock.c | 4 +--- kernel/drivers/analogy/rtdm_helpers.c | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-)kernel/cobalt/clock.c +1
-3@@ -350,9 +350,7 @@ EXPORT_SYMBOL_GPL(xnclock_adjust);xnticks_t xnclock_get_host_time (void ) { -struct timeval tv; -do_gettimeofday (&tv); -return tv.tv_sec *1000000000ULL + tv.tv_usec *1000 ; +return ktime_to_ns (ktime_get_real ()); }EXPORT_SYMBOL_GPL (xnclock_get_host_time);kernel/drivers/analogy/rtdm_helpers.c +0
-0@@ -32,11 +32,8 @@ static nanosecs_abs_t a4l_clkofs;void a4l_init_time (void ) {
kernel/drivers/analogy/rtdm_helpers.c static nanosecs_abs_t a4l_clkofs; · line 39
Quoted 10 lines
kernel/drivers/analogy/rtdm_helpers.c +1
-4nanosecs_abs_t t1, t2; -struct timeval tv; t1 =rtdm_clock_read (); -do_gettimeofday (&tv); - t2 =1000000000 * ((nanosecs_abs_t )tv.tv_sec) + -1000000 * ((nanosecs_abs_t )tv.tv_usec); + t2 =ktime_to_ns (ktime_get_real ()); a4l_clkofs = t2 - t1; }
I'm leaving a note in the commit log that this also fixes a conversion bug in a4l_init_time.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
PATCH v2 10/10 travis: append i-pipe arm-v4.20.7 and arm-v5.0 to the matrix
In reply to [email protected]From: Roman Stratiienko <[email protected]>
--- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+)
.travis.yml +10 -0
@@ -46,6 +46,16 @@ script: matrix: include: + - env: + - ARCH: arm + KERNEL_VERSION: 5.0 + KERNEL_DEFCONFIG: multi_v7_defconfig + IPIPE_URL: https://github.com/devel-opi/linux-ipipe-arm-porting/releases/download/v5.0-draft1/ipipe-arm-v5.0-draft.patch + - env: + - ARCH: arm + KERNEL_VERSION: 4.20.7 + KERNEL_DEFCONFIG: multi_v7_defconfig + IPIPE_URL: https://github.com/devel-opi/linux-ipipe-arm-porting/releases/download/draft-v4.20.7/0001-Draft-version-of-ipipe-arm-ported-on-v4.20.7.patch - env: - ARCH: arm KERNEL_VERSION: 4.14.85
Signature · 1 line
2.17.1
Jan Kiszka
AppliedRe: [PATCH v2 10/10] travis: append i-pipe arm-v4.20.7 and arm-v5.0 to the matrix
Quoted 19 lines · roman.stratiienko--- via Xenomai
From: Roman Stratiienko <[email protected]>
Signed-off-by Roman Stratiienko <[email protected]>--- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+).travis.yml +3
-0@@ -46,6 +46,16 @@ script: matrix: include: + - env: + - ARCH: arm + KERNEL_VERSION: 5.0
.travis.yml script: · line 61
Quoted 10 lines
.travis.yml +7
-0+ KERNEL_DEFCONFIG: multi_v7_defconfig + IPIPE_URL: https://github.com/devel-opi/linux-ipipe-arm-porting/releases/download/v5.0-draft1/ipipe-arm-v5.0-draft.patch + - env: + - ARCH: arm + KERNEL_VERSION: 4.20.7 + KERNEL_DEFCONFIG: multi_v7_defconfig + IPIPE_URL: https://github.com/devel-opi/linux-ipipe-arm-porting/releases/download/draft-v4.20.7/0001-Draft-version-of-ipipe-arm-ported-on-v4.20.7.patch - env: - ARCH: arm KERNEL_VERSION: 4.14.85
This one should come it via upstream ipipe. In fact, we should drop the patch-based kernel setup, replacing it with git branches. That will also allow including arm64 into the matrix, where we lack a patch release for the only supported kernel version: 4.14.
Applied all other 9 patches in this series to next now.
Thanks,
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Re: [PATCH v2 10/10] travis: append i-pipe arm-v4.20.7 and arm-v5.0 to the matrix
Some point about repository-based checking VS patch based.
CI is very useful for checking regressions caused by particuar commits. But when mixing repositories we risk to get interferentions between them. So it might be better to have separate CI for each ipipe repository.
вт, 19 мар. 2019 г., 16:56 Jan Kiszka <[email protected]>:
Quoted 49 lines · roman.stratiienko--- via Xenomai
Quoted 12 lines
From: Roman Stratiienko <[email protected]>
Signed-off-by Roman Stratiienko <[email protected]>--- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+).travis.yml +0
-0.travis.yml script: · line 53
Quoted 8 lines
.travis.yml +5
-0@@ -46,6 +46,16 @@ script: matrix: include: + - env: + - ARCH: arm + KERNEL_VERSION: 5.0 + KERNEL_DEFCONFIG: multi_v7_defconfig + IPIPE_URL:.travis.yml script:
Quoted 5 lines
.travis.yml +5
-0+ - env: + - ARCH: arm + KERNEL_VERSION: 4.20.7 + KERNEL_DEFCONFIG: multi_v7_defconfig + IPIPE_URL:.travis.yml script: · line 61
Quoted 4 lines
.travis.yml +0
-0- env: - ARCH: arm KERNEL_VERSION: 4.14.85This one should come it via upstream ipipe. In fact, we should drop the patch-based kernel setup, replacing it with git branches. That will also allow
including arm64 into the matrix, where we lack a patch release for the only
supported kernel version: 4.14.Applied all other 9 patches in this series to next now.
Thanks,
Jan--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Re: [PATCH v2 10/10] travis: append i-pipe arm-v4.20.7 and arm-v5.0 to the matrix
Quoted 3 lines · Roman Stratiienko
Some point about repository-based checking VS patch based.
CI is very useful for checking regressions caused by particuar commits. But when mixing repositories we risk to get interferentions between them. So it might be better to have separate CI for each ipipe repository.
We need both in the end. But for stable I-pipe baselines, we could simply add "latest tag" mode to the CI system, besides "latest branch head". Both could pull from the same git repos.
Note that I also do not want to continuously tune the CI script because we released a new stable kernel patch somewhere.
Jan
Quoted 52 lines
вт, 19 мар. 2019 г., 16:56 Jan Kiszka <[email protected] <mailto:[email protected]>>:
On 06.03.19 18:53, roman.stratiienko--- via Xenomai wrote:
> From: Roman Stratiienko <[email protected]
<mailto:[email protected]>>
>
> Signed-off-by: Roman Stratiienko <[email protected]
<mailto:[email protected]>>
> ---
> .travis.yml | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --gita/.travis.ymlb/.travis.yml
> index24889ca5f..ab23b745d100644
> ---a/.travis.yml
> +++b/.travis.yml
> @@ -46,6 +46,16 @@ script:
>
> matrix:
> include:
> + - env:
> + - ARCH: arm
> +KERNEL_VERSION: 5.0
> +KERNEL_DEFCONFIG:multi_v7_defconfig
> +IPIPE_URL:
https://github.com/devel-opi/linux-ipipe-arm-porting/releases/download/v5.0-draft1/ipipe-arm-v5.0-draft.patch
> + - env:
> + - ARCH: arm
> +KERNEL_VERSION: 4.20.7
> +KERNEL_DEFCONFIG:multi_v7_defconfig
> +IPIPE_URL:
https://github.com/devel-opi/linux-ipipe-arm-porting/releases/download/draft-v4.20.7/0001-Draft-version-of-ipipe-arm-ported-on-v4.20.7.patch
> - env:
> - ARCH: arm
> KERNEL_VERSION: 4.14.85
>This one should come it via upstream ipipe. In fact, we should drop the patch-based kernel setup, replacing it with git branches. That will also allow including arm64 into the matrix, where we lack a patch release for the only supported kernel version: 4.14.
Applied all other 9 patches in this series to next now.
Thanks,
Jan--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux