- workspace-cleanup
- job-template:
- name: latency-tracker_{mversion}_build-vanilla
+ name: latency-tracker_{mversion}_{buildtype}-vanilla
defaults: latency-tracker
description: |
The LTTng modules provide Linux kernel tracing capability to the LTTng
name: 'kverfloor'
default: 'v3.12'
description: 'The lowest kernel version to build.'
+ - string:
+ name: 'kverfilter'
+ default: 'stable-head'
+ description: 'Kernel versions list filtering strategy.'
- string:
name: 'kgitrepo'
default: 'git://git-mirror.internal.efficios.com/kernel/stable/linux-stable.git'
description: 'The linux kernel git repository url.'
- string:
name: 'kbuildjob'
- default: 'latency-tracker_VERSION_param-build'
+ default: 'latency-tracker_VERSION_param-{buildtype}'
description: 'The parametrized job to use for child builds.'
builders:
publishers:
- workspace-cleanup
+- job-template:
+ name: latency-tracker_VERSION_param-crossbuild
+ defaults: latency-tracker
+ description: |
+ This is a parametrized job used by 'master' jobs to build any combinations
+ of latency-tracker and linux kernel versions.
+
+ <p>Job is managed by Jenkins Job Builder.</p>
+
+ project-type: matrix
+ node: 'master' # Applies only to matrix flyweight task
+ axes:
+ - axis:
+ type: user-defined
+ name: cross_arch
+ values: '{obj:cross_arch}'
+
+ properties:
+ - build-discarder:
+ days-to-keep: 2
+
+ parameters:
+ - string:
+ name: 'mversion'
+ default: 'master'
+ description: 'The latency-tracker branch to build.'
+ - string:
+ name: 'kversion'
+ default: ''
+ description: 'The linux kernel git tag to build against.'
+ - string:
+ name: 'kgitrepo'
+ default: 'git://git-mirror.internal.efficios.com/kernel/stable/linux-stable.git'
+ description: 'The linux kernel git repository url.'
+
+ concurrent: true
+
+ scm:
+ - git:
+ url: git://github.com/efficios/latency-tracker.git
+ browser: githubweb
+ browser-url: https://github.com/efficios/latency-tracker
+ branches:
+ - "${{mversion}}"
+ skip-tag: true
+ basedir: src/latency-tracker
+
+ triggers:
+
+ builders:
+ - shell: |
+ git clone --depth=1 -b "$kversion" --reference $HOME/gitcache/linux-stable.git/ "$kgitrepo" src/linux
+ - shell:
+ !include-raw-escape: scripts/latency-tracker/param-build.sh
+
+ publishers:
+ - workspace-cleanup
+
- job-template:
name: latency-tracker_{mversion}_coverity
defaults: latency-tracker
mversion:
- master
jobs:
- - 'latency-tracker_{mversion}_build-vanilla'
+ - 'latency-tracker_{mversion}_{buildtype}-vanilla':
+ buildtype: build
- 'latency-tracker_{mversion}_build-rt':
- 'latency-tracker_{mversion}_build-{uversion}':
uversion:
- xenial
+ - 'latency-tracker_{mversion}_{buildtype}-vanilla':
+ buildtype: crossbuild
- 'latency-tracker_VERSION_param-build':
arch: !!python/tuple [x86-32, x86-64]
+ - 'latency-tracker_VERSION_param-crossbuild':
+ cross_arch: !!python/tuple [armhf, arm64]
- 'latency-tracker_{mversion}_cppcheck'
- 'latency-tracker_{mversion}_sloccount':
mversion: master
- workspace-cleanup
- job-template:
- name: lttng-modules_{mversion}_build-vanilla
+ name: lttng-modules_{mversion}_{buildtype}-vanilla
defaults: lttng-modules
description: |
The LTTng modules provide Linux kernel tracing capability to the LTTng
description: 'The maximum number of concurrent child build to run.'
- string:
name: 'kverfloor'
- default: 'v2.6.36'
+ default: '{kverfloor}'
description: 'The lowest kernel version to build.'
+ - string:
+ name: 'kverfilter'
+ default: '{kverfilter}'
+ description: 'Kernel versions list filtering strategy.'
- string:
name: 'kgitrepo'
default: 'git://git-mirror.internal.efficios.com/kernel/stable/linux-stable.git'
description: 'The linux kernel git repository url.'
- string:
name: 'kbuildjob'
- default: 'lttng-modules_VERSION_param-build'
+ default: 'lttng-modules_VERSION_param-{buildtype}'
description: 'The parametrized job to use for child builds.'
builders:
publishers:
- workspace-cleanup
+- job-template:
+ name: lttng-modules_VERSION_param-crossbuild
+ defaults: lttng-modules
+ description: |
+ This is a parametrized job used by 'master' jobs to build any combinations
+ of lttng-modules and linux kernel versions.
+
+ <p>Job is managed by Jenkins Job Builder.</p>
+
+ project-type: matrix
+ node: 'master' # Applies only to matrix flyweight task
+ axes:
+ - axis:
+ type: user-defined
+ name: cross_arch
+ values: '{obj:cross_arch}'
+
+ properties:
+ - build-discarder:
+ days-to-keep: 2
+
+ parameters:
+ - string:
+ name: 'mversion'
+ default: 'master'
+ description: 'The lttng-modules branch to build.'
+ - string:
+ name: 'kversion'
+ default: ''
+ description: 'The linux kernel git tag to build against.'
+ - string:
+ name: 'kgitrepo'
+ default: 'git://git-mirror.internal.efficios.com/kernel/stable/linux-stable.git'
+ description: 'The linux kernel git repository url.'
+
+ concurrent: true
+
+ scm:
+ - git:
+ url: git://github.com/lttng/lttng-modules.git
+ browser: githubweb
+ browser-url: https://github.com/lttng/lttng-modules
+ branches:
+ - "${{mversion}}"
+ skip-tag: true
+ basedir: src/lttng-modules
+
+ triggers:
+
+ builders:
+ - shell: |
+ git clone --depth=1 -b "$kversion" --reference $HOME/gitcache/linux-stable.git/ "$kgitrepo" src/linux
+ - shell:
+ !include-raw-escape: scripts/lttng-modules/param-build.sh
+
+ publishers:
+ - workspace-cleanup
+
- job-template:
name: lttng-modules_{mversion}_coverity
defaults: lttng-modules
- stable-2.9
- master
jobs:
- - 'lttng-modules_{mversion}_build-vanilla'
+ - 'lttng-modules_{mversion}_{buildtype}-vanilla':
+ buildtype: build
+ kverfloor: v2.6.36
+ kverfilter: none
- 'lttng-modules_{mversion}_build-rt':
mversion: master
- 'lttng-modules_{mversion}_build-{uversion}':
uversion:
- trusty
- xenial
+ - 'lttng-modules_{mversion}_{buildtype}-vanilla':
+ buildtype: crossbuild
+ kverfloor: v3.16
+ kverfilter: stable-head
- 'lttng-modules_VERSION_param-build':
arch: !!python/tuple [x86-32, x86-64]
+ - 'lttng-modules_VERSION_param-crossbuild':
+ cross_arch: !!python/tuple [armhf, arm64, powerpc, ppc64el]
- 'lttng-modules_{mversion}_cppcheck'
- 'lttng-modules_{mversion}_sloccount':
mversion: master
/**
- * Copyright (C) 2016 - Michael Jeanson <mjeanson@efficios.com>
+ * Copyright (C) 2016-2017 - Michael Jeanson <mjeanson@efficios.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return this.rc != Integer.MAX_VALUE
}
+ // Return true if both version are of the same stable branch
+ Boolean isSameStable(kVersion o) {
+ if (this.major != o.major) {
+ return false
+ }
+ if (this.majorB != o.majorB) {
+ return false
+ }
+ if (this.minor != o.minor) {
+ return false
+ }
+
+ return true
+ }
+
@Override int compareTo(kVersion o) {
if (this.major != o.major) {
- return Integer.compare(this.major, o.major);
+ return Integer.compare(this.major, o.major)
}
if (this.majorB != o.majorB) {
- return Integer.compare(this.majorB, o.majorB);
+ return Integer.compare(this.majorB, o.majorB)
}
if (this.minor != o.minor) {
- return Integer.compare(this.minor, o.minor);
+ return Integer.compare(this.minor, o.minor)
}
if (this.patch != o.patch) {
- return Integer.compare(this.patch, o.patch);
+ return Integer.compare(this.patch, o.patch)
}
if (this.rc != o.rc) {
- return Integer.compare(this.rc, o.rc);
+ return Integer.compare(this.rc, o.rc)
}
// Same version
def maxConcurrentBuild = build.buildVariableResolver.resolve('maxConcurrentBuild')
def kgitrepo = build.buildVariableResolver.resolve('kgitrepo')
def kverfloor = new kVersion(build.buildVariableResolver.resolve('kverfloor'))
+def kverfilter = build.buildVariableResolver.resolve('kverfilter')
def job = Hudson.instance.getJob(build.buildVariableResolver.resolve('kbuildjob'))
def currentJobName = build.project.getFullDisplayName()
kversions.sort()
kversionsRC.sort()
+switch (kverfilter) {
+ case 'stable-head':
+ // Keep only the head of each stable branch
+ println('Filter kernel versions to keep only the latest point release of each stable branch.')
+
+ for (i = 0; i < kversions.size(); i++) {
+ def curr = kversions[i]
+ def next = i < kversions.size() - 1 ? kversions[i + 1] : null
+
+ if (next != null) {
+ if (curr.isSameStable(next)) {
+ kversions.remove(i)
+ i--
+ }
+ }
+ }
+ break
+
+ default:
+ // No filtering of kernel versions
+ println('No kernel versions filtering selected.')
+ break
+}
+
// If the last RC version is newer than the last stable, add it to the build list
if (kversionsRC.last() > kversions.last()) {
kversions.add(kversionsRC.last())
}
}
- // Check for queued similar job since we only want to run latest
- // as Mathieu Desnoyers requirement
+ // If a newer instance of this job is queued, abort to let it run
similarJobQueued = Hudson.instance.queue.items.count{it.task.getFullDisplayName() == currentJobName}
if ( similarJobQueued > 0 ) {
// Abort since new build is queued
echo "CONFIG_KALLSYMS_ALL=y" >> "${outdir}"/.config
- make ${koutput} silentoldconfig CC=$CC
+ make ${koutput} olddefconfig CC=$CC
make ${koutput} modules_prepare CC=$CC
# Version specific tasks
# We expect this build to fail, if it doesn't, fail the job.
if [ "$?" -eq 0 ]; then
+ echo "This build should have failed."
exit 1
fi
## MAIN ##
-# Use gcc 4.9, older kernel don't build with gcc 5
-export CC=gcc-4.9
-
# Use all CPU cores
NPROC=$(nproc)
;;
esac
+ # Use default gcc when cross-compiling
+ CC="${cross_compile}gcc"
+
# Export variables used by Kbuild for cross compilation
export ARCH="${karch}"
export CROSS_COMPILE="${cross_compile}"
-
# Set arch specific values if we are not cross compiling
elif [ "x${arch:-}" != "x" ]; then
+
case "$arch" in
"x86-32")
karch="x86"
exit 1
;;
esac
+
+ # Use gcc 4.9, older kernel don't build with gcc 5
+ CC=gcc-4.9
+
else
echo "Not arch or cross_arch specified"
exit 1
/**
- * Copyright (C) 2016 - Michael Jeanson <mjeanson@efficios.com>
+ * Copyright (C) 2016-2017 - Michael Jeanson <mjeanson@efficios.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return this.rc != Integer.MAX_VALUE
}
+ // Return true if both version are of the same stable branch
+ Boolean isSameStable(kVersion o) {
+ if (this.major != o.major) {
+ return false
+ }
+ if (this.majorB != o.majorB) {
+ return false
+ }
+ if (this.minor != o.minor) {
+ return false
+ }
+
+ return true
+ }
+
@Override int compareTo(kVersion o) {
if (this.major != o.major) {
- return Integer.compare(this.major, o.major);
+ return Integer.compare(this.major, o.major)
}
if (this.majorB != o.majorB) {
- return Integer.compare(this.majorB, o.majorB);
+ return Integer.compare(this.majorB, o.majorB)
}
if (this.minor != o.minor) {
- return Integer.compare(this.minor, o.minor);
+ return Integer.compare(this.minor, o.minor)
}
if (this.patch != o.patch) {
- return Integer.compare(this.patch, o.patch);
+ return Integer.compare(this.patch, o.patch)
}
if (this.rc != o.rc) {
- return Integer.compare(this.rc, o.rc);
+ return Integer.compare(this.rc, o.rc)
}
// Same version
def maxConcurrentBuild = build.buildVariableResolver.resolve('maxConcurrentBuild')
def kgitrepo = build.buildVariableResolver.resolve('kgitrepo')
def kverfloor = new kVersion(build.buildVariableResolver.resolve('kverfloor'))
+def kverfilter = build.buildVariableResolver.resolve('kverfilter')
def job = Hudson.instance.getJob(build.buildVariableResolver.resolve('kbuildjob'))
def currentJobName = build.project.getFullDisplayName()
kversions.sort()
kversionsRC.sort()
+switch (kverfilter) {
+ case 'stable-head':
+ // Keep only the head of each stable branch
+ println('Filter kernel versions to keep only the latest point release of each stable branch.')
+
+ for (i = 0; i < kversions.size(); i++) {
+ def curr = kversions[i]
+ def next = i < kversions.size() - 1 ? kversions[i + 1] : null
+
+ if (next != null) {
+ if (curr.isSameStable(next)) {
+ kversions.remove(i)
+ i--
+ }
+ }
+ }
+ break
+
+ default:
+ // No filtering of kernel versions
+ println('No kernel versions filtering selected.')
+ break
+}
+
// If the last RC version is newer than the last stable, add it to the build list
if (kversionsRC.last() > kversions.last()) {
kversions.add(kversionsRC.last())
}
}
- // Check for queued similar job since we only want to run latest
- // as Mathieu Desnoyers requirement
+ // If a newer instance of this job is queued, abort to let it run
similarJobQueued = Hudson.instance.queue.items.count{it.task.getFullDisplayName() == currentJobName}
if ( similarJobQueued > 0 ) {
// Abort since new build is queued
;;
*)
# Que sera sera
- make ${koutput} allyesconfig CC=$CC
+ make ${koutput} ${vanilla_config} CC=$CC
;;
esac
echo "CONFIG_KALLSYMS_ALL=y" >> "${outdir}"/.config
- make ${koutput} silentoldconfig CC=$CC
+ make ${koutput} olddefconfig CC=$CC
make ${koutput} modules_prepare CC=$CC
# Version specific tasks
# We expect this build to fail, if it doesn't, fail the job.
if [ "$?" -eq 0 ]; then
+ echo "This build should have failed."
exit 1
fi
## MAIN ##
-# Use gcc 4.9, older kernel don't build with gcc 5
-export CC=gcc-4.9
-
# Use all CPU cores
NPROC=$(nproc)
"armhf")
karch="arm"
cross_compile="arm-linux-gnueabihf-"
+ vanilla_config="allyesconfig"
ubuntu_config="armhf-config.flavour.generic"
;;
"arm64")
karch="arm64"
cross_compile="aarch64-linux-gnu-"
+ vanilla_config="allyesconfig"
ubuntu_config="arm64-config.flavour.generic"
;;
"powerpc")
karch="powerpc"
cross_compile="powerpc-linux-gnu-"
+ vanilla_config="ppc44x_defconfig"
ubuntu_config="powerpc-config.flavour.powerpc-smp"
;;
"ppc64el")
karch="powerpc"
cross_compile="powerpc64le-linux-gnu-"
+ vanilla_config="pseries_le_defconfig"
ubuntu_config="ppc64el-config.flavour.generic"
;;
;;
esac
+ # Use default gcc when cross-compiling
+ CC="${cross_compile}gcc"
+
# Export variables used by Kbuild for cross compilation
export ARCH="${karch}"
export CROSS_COMPILE="${cross_compile}"
-
# Set arch specific values if we are not cross compiling
elif [ "x${arch:-}" != "x" ]; then
+
case "$arch" in
"x86-32")
karch="x86"
+ vanilla_config="allyesconfig"
ubuntu_config="i386-config.flavour.generic"
;;
"x86-64")
karch="x86"
+ vanilla_config="allyesconfig"
ubuntu_config="amd64-config.flavour.generic"
;;
"armhf")
karch="arm"
+ vanilla_config="allyesconfig"
ubuntu_config="armhf-config.flavour.generic"
;;
"arm64")
karch="arm64"
+ vanilla_config="allyesconfig"
ubuntu_config="arm64-config.flavour.generic"
;;
"powerpc")
karch="powerpc"
+ vanilla_config="allyesconfig"
ubuntu_config="powerpc-config.flavour.powerpc-smp"
;;
"ppc64el")
karch="powerpc"
+ vanilla_config="allyesconfig"
ubuntu_config="ppc64el-config.flavour.generic"
;;
exit 1
;;
esac
+
+ # Use gcc 4.9, older kernel don't build with gcc 5
+ CC=gcc-4.9
+
else
echo "Not arch or cross_arch specified"
exit 1