3 // SPDX-FileCopyrightText: 2021 Michael Jeanson <mjeanson@efficios.com>
5 // SPDX-License-Identifier: GPL-3.0-or-later
10 /* Global options for the pipeline */
13 buildDiscarder(logRotator(numToKeepStr: '5'))
14 timeout(time: 2, unit: 'HOURS')
15 disableConcurrentBuilds()
24 /* Top level sequential stages */
27 /* First level stage */
28 stage('Prepare targets') {
29 agent { label 'deb12-amd64' }
32 stage('Checkout sources') {
36 dir("src/ust/stable-2.12-lower-urcu-dep") {
37 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.12-lower-urcu-dep']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.efficios.com/deliverable/lttng-ust.git']]])
39 dir("src/ust/stable-2.13") {
40 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.13']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/lttng/lttng-ust']]])
43 dir("src/urcu/stable-0.9") {
44 checkout([$class: 'GitSCM', branches: [[name: 'stable-0.9']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.lttng.org/userspace-rcu']]])
46 dir("src/urcu/stable-0.12") {
47 checkout([$class: 'GitSCM', branches: [[name: 'stable-0.12']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/urcu/userspace-rcu']]])
50 dir("src/babeltrace/stable-2.0") {
51 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.0']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/efficios/babeltrace']]])
56 stage('Generate UST 2.12 targets') {
58 TARGETS = "${WORKSPACE}/targets"
59 CUR_TARGET = "current"
60 CPPFLAGS = "-I${TARGETS}/${CUR_TARGET}/include"
61 LDFLAGS = "-L${TARGETS}/${CUR_TARGET}/lib"
62 CLASSPATH = "/usr/share/java/log4j-1.2.jar"
66 /* Create empty include dir to make gcc '-Wmissing-include-dirs' happy */
67 sh "mkdir -p \"${TARGETS}/${CUR_TARGET}/include\""
69 // Build babeltrace 2.0
70 dir("src/babeltrace/stable-2.0") {
72 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --disable-static"
73 sh "make -j\"\$(nproc)\" V=1"
76 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
79 // Add symlink from babeltrace2 to babeltrace
80 dir("${TARGETS}/${CUR_TARGET}/bin") {
81 sh "ln -s babeltrace2 babeltrace"
84 // Build liburcu 0.9 for ust 2.12
85 dir("src/urcu/stable-0.9") {
87 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --disable-static"
88 sh "make -j\"\$(nproc)\" V=1"
91 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
94 // Build ust 2.12 against liburcu 0.9
95 dir("src/ust/stable-2.12-lower-urcu-dep") {
97 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --enable-python-agent --enable-java-agent-all --enable-jni-interface"
98 sh "make -j\"\$(nproc)\" V=1"
101 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
104 // Make a copy of the ust 2.12 target with only urcu 0.9
106 sh "cp -dpr \"${CUR_TARGET}\" \"ust-2.12-urcu-0.9\""
109 // Remove the 'dev' part of liburcu 0.9, keep only the versionned SO
110 dir("${TARGETS}/${CUR_TARGET}") {
111 sh "rm -rf \"${TARGETS}/${CUR_TARGET}/include/urcu\""
112 sh "rm -f \"${TARGETS}/${CUR_TARGET}/include/\"urcu*.h"
113 sh "rm -f \"${TARGETS}/${CUR_TARGET}/lib/\"liburcu*.so"
114 sh "rm -f \"${TARGETS}/${CUR_TARGET}/lib/pkgconfig/\"liburcu*"
117 // Build liburcu 0.12 for tools 2.12
118 dir("src/urcu/stable-0.12") {
120 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --disable-static"
121 sh "make -j\"\$(nproc)\" V=1"
124 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
127 // Copy the liburcu 0.12 runtime SO to the ust-2.12-urcu-0.9 target
128 sh "cp -dpr \"${TARGETS}/${CUR_TARGET}/lib/\"liburcu*.so.6* \"${TARGETS}/ust-2.12-urcu-0.9/lib\""
131 // Archive the first ust 2.12 target with urcu 0.9 dev+runtime and 0.12 runtime
132 stash name: "ust-2.12-urcu-0.9", includes: 'ust-2.12-urcu-0.9/**'
133 archiveArtifacts artifacts: 'ust-2.12-urcu-0.9/**', fingerprint: false
135 // Archive the second ust 2.12 target with urcu 0.9 runtime and 0.12 dev+runtime
136 sh 'mv "${CUR_TARGET}" "ust-2.12-urcu-0.12"'
137 stash name: "ust-2.12-urcu-0.12", includes: 'ust-2.12-urcu-0.12/**'
138 archiveArtifacts artifacts: 'ust-2.12-urcu-0.12/**', fingerprint: false
143 stage('Generate UST 2.13 target') {
145 TARGETS = "${WORKSPACE}/targets"
146 CUR_TARGET = "current"
147 CPPFLAGS = "-I${TARGETS}/${CUR_TARGET}/include"
148 LDFLAGS = "-L${TARGETS}/${CUR_TARGET}/lib"
149 PKG_CONFIG_PATH = "${TARGETS}/${CUR_TARGET}/lib/pkgconfig"
150 CLASSPATH = "/usr/share/java/log4j-1.2.jar"
154 // Create empty include dir to make gcc '-Wmissing-include-dirs' happy
155 sh "mkdir -p \"${TARGETS}/${CUR_TARGET}/include\""
157 // Install babeltrace 2.0 built in the previous stage in a fresh target
158 dir("src/babeltrace/stable-2.0") {
160 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
163 // Add symlink from babeltrace2 to babeltrace
164 dir("${TARGETS}/${CUR_TARGET}/bin") {
165 sh "ln -s babeltrace2 babeltrace"
168 // Install liburcu 0.12 built in the previous stage in a fresh target
169 dir("src/urcu/stable-0.12") {
171 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
174 // Build ust 2.13 against liburcu 0.12
175 dir("src/ust/stable-2.13") {
177 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --enable-python-agent --enable-java-agent-all --enable-jni-interface"
178 sh "make -j\"\$(nproc)\" V=1"
181 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
184 // Archive the target
186 sh 'mv "${CUR_TARGET}" "ust-2.13"'
187 stash name: "ust-2.13", includes: "ust-2.13/**"
188 archiveArtifacts artifacts: 'ust-2.13/**', fingerprint: false
195 /* First level stage */
196 stage('Test tools 2.12 / 2.13 in parallel') {
198 // Parallel stage for tools 2.12
199 stage('Test tools 2.12') {
200 agent { label 'deb12-amd64' }
203 TARGETS = "${WORKSPACE}/targets"
204 CUR_TARGET = "current"
205 CPPFLAGS = "-I${TARGETS}/${CUR_TARGET}/include"
206 LDFLAGS = "-L${TARGETS}/${CUR_TARGET}/lib"
207 PKG_CONFIG_PATH = "${TARGETS}/${CUR_TARGET}/lib/pkgconfig"
208 CLASSPATH = "/usr/share/java/log4j-1.2.jar:${TARGETS}/${CUR_TARGET}/share/java/*"
209 PYTHONPATH = "${TARGETS}/${CUR_TARGET}/lib/python2.7/site-packages"
210 LD_LIBRARY_PATH = "${TARGETS}/${CUR_TARGET}/lib"
211 PATH = "$PATH:${TARGETS}/${CUR_TARGET}/bin"
215 stage('Checkout tools 2.12 sources') {
219 dir("src/tools/stable-2.12") {
220 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.12']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/lttng/lttng-tools']]])
225 stage('Unstash targets') {
228 unstash name: "ust-2.12-urcu-0.9"
229 unstash name: "ust-2.12-urcu-0.12"
234 stage('Build tools 2.12') {
236 // Restore the ust-2.12 target with urcu 0.12
237 sh "ln -sf \"${TARGETS}/ust-2.12-urcu-0.12\" \"${TARGETS}/${CUR_TARGET}\""
240 // --disable-dependency-tracking is important to allow rebuilding only the testapps
241 dir("src/tools/stable-2.12") {
243 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --enable-test-java-agent-all --enable-python-bindings --disable-dependency-tracking"
244 sh "make -j\"\$(nproc)\" V=1"
247 // Swap the target to ust 2.12 with urcu 0.9
248 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
249 sh "ln -sf \"${TARGETS}/ust-2.12-urcu-0.9\" \"${TARGETS}/${CUR_TARGET}\""
251 // Rebuild the testapps with ust 2.12 urcu 0.9
252 dir("src/tools/stable-2.12/tests") {
254 for dir in utils/testapp regression/tools/filtering regression/ust; do
257 make -j"$(nproc)" V=1
262 // Swap back the target to ust 2.12 with urcu 0.12
263 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
264 sh "ln -sf \"${TARGETS}/ust-2.12-urcu-0.12\" \"${TARGETS}/${CUR_TARGET}\""
269 stage('Run tools 2.12 tests') {
271 timeout(time: 15, unit: 'MINUTES', activity: true)
276 dir("src/tools/stable-2.12") {
278 * This will mark the stage as FAILED if the test suite is not
279 * successful but will continue the execution of the steps.
282 sh "make --keep-going check"
289 dir("src/tools/stable-2.12") {
290 sh 'mkdir -p "${WORKSPACE}/tap/ust-2.12"'
291 sh 'rsync -a --exclude "test-suite.log" --include \'*/\' --include \'*.log\' --exclude=\'*\' tests/ "${WORKSPACE}/tap/ust-2.12"'
293 sh 'mkdir -p "${WORKSPACE}/log/ust-2.12"'
294 sh 'rsync -a --include "test-suite.log" --include \'*/\' --exclude=\'*\' tests/ "${WORKSPACE}/log/ust-2.12"'
300 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
308 recordIssues skipBlames: true, tools: [gcc(id: "gcc-ust-212")]
309 step([$class: 'TapPublisher', testResults: 'tap/**/*.log', verbose: true, failIfNoResults: true, failedTestsMarkBuildAsFailure: true, planRequired: true])
310 archiveArtifacts artifacts: 'tap/**,log/**', fingerprint: false
313 cleanWs cleanWhenFailure: false
318 // Parallel stage for tools 2.13
319 stage('Test tools 2.13') {
320 agent { label 'deb12-amd64' }
323 TARGETS = "${WORKSPACE}/targets"
324 CUR_TARGET = "current"
325 CPPFLAGS = "-I${TARGETS}/${CUR_TARGET}/include"
326 LDFLAGS = "-L${TARGETS}/${CUR_TARGET}/lib"
327 PKG_CONFIG_PATH = "${TARGETS}/${CUR_TARGET}/lib/pkgconfig"
328 CLASSPATH = "/usr/share/java/log4j-1.2.jar:${TARGETS}/${CUR_TARGET}/share/java/*"
329 PYTHONPATH =" ${TARGETS}/${CUR_TARGET}/lib/python2.7/site-packages"
330 LD_LIBRARY_PATH = "${TARGETS}/${CUR_TARGET}/lib"
331 PATH = "$PATH:${TARGETS}/${CUR_TARGET}/bin"
335 stage('Checkout tools 2.13 sources') {
339 dir("src/tools/stable-2.13") {
340 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.13']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.lttng.org/lttng-tools']]])
345 stage('Unstash targets') {
348 unstash name: "ust-2.12-urcu-0.9"
349 unstash name: "ust-2.13"
354 stage('Build tools 2.13') {
356 // Restore the ust-2.13 target
357 sh 'ln -sf "${TARGETS}/ust-2.13" "${TARGETS}/${CUR_TARGET}"'
359 // Disable regression tests that don't apply to ust 2.12
360 dir("src/tools/stable-2.13/tests/regression") {
362 sed -i '/tools\\/notification\\/test_notification_ust_error/d' Makefile.am
363 sed -i '/tools\\/notification\\/test_notification_ust_capture/d' Makefile.am
364 sed -i '/tools\\/notification\\/test_notification_ust_event_rule_condition_exclusion/d' Makefile.am
365 sed -i '/tools\\/notification\\/test_notification_kernel_error/d' Makefile.am
366 sed -i '/tools\\/notification\\/test_notification_kernel_capture/d' Makefile.am
367 sed -i '/tools\\/notification\\/test_notification_kernel_instrumentation/d' Makefile.am
368 sed -i '/tools\\/notification\\/test_notification_kernel_syscall/d' Makefile.am
369 sed -i '/tools\\/notification\\/test_notification_notifier_discarded_count/d' Makefile.am
370 sed -i '/tools\\/notification\\/test_notification_kernel_userspace_probe/d' Makefile.am
371 sed -i '/tools\\/tracker\\/test_event_tracker/d' Makefile.am
372 sed -i '/tools\\/trigger\\/start-stop\\/test_start_stop/d' Makefile.am
373 sed -i '/tools\\/trigger\\/test_add_trigger_cli/d' Makefile.am
374 sed -i '/tools\\/trigger\\/test_list_triggers_cli/d' Makefile.am
375 sed -i '/tools\\/trigger\\/test_remove_trigger_cli/d' Makefile.am
376 sed -i '/tools\\/trigger\\/name\\/test_trigger_name_backwards_compat/d' Makefile.am
377 sed -i '/tools\\/trigger\\/rate-policy\\/test_ust_rate_policy/d' Makefile.am
379 sed -i 's/\\(tools\\/clear\\/test_kernel\\) \\\\/\\1/' Makefile.am
380 sed -i 's/\\(tools\\/relayd-grouping\\/test_ust\\) \\\\/\\1/' Makefile.am
384 // Build tools 2.13 with ust 2.13
385 // --disable-dependency-tracking is important to allow rebuilding only the testapps with ust 2.12
386 dir("src/tools/stable-2.13") {
388 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --enable-test-java-agent-all --enable-python-bindings --disable-dependency-tracking"
389 sh "make -j\"\$(nproc)\" V=1"
392 // Swap the target to ust 2.12
393 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
394 sh "ln -sf \"${TARGETS}/ust-2.12-urcu-0.9\" \"${TARGETS}/${CUR_TARGET}\""
396 // Rebuild the testapps with ust 2.12
397 dir("src/tools/stable-2.13/tests") {
399 for dir in utils/testapp regression/tools/filtering regression/ust; do
401 find . -name Makefile | xargs sed -i "s/-llttng-ust-common//"
403 make -j"$(nproc)" V=1
408 // Add the ust 2.13 runtime to the target
409 sh "cp -dp \"${TARGETS}/ust-2.13/lib/\"liblttng-ust-*.so.1* \"${TARGETS}/${CUR_TARGET}/lib/\""
410 sh "cp -dp \"${TARGETS}/ust-2.13/lib/\"liblttng-ust-ctl.so.5* \"${TARGETS}/${CUR_TARGET}/lib/\""
414 stage('Run tools 2.13 tests') {
416 timeout(time: 15, unit: 'MINUTES', activity: true)
420 // Run the regression tests
421 dir("src/tools/stable-2.13/tests/regression") {
423 * This will mark the stage as FAILED if the test suite is not
424 * successful but will continue the execution of the steps.
427 sh "make --keep-going check"
434 dir("src/tools/stable-2.13") {
435 sh 'mkdir -p "${WORKSPACE}/tap/ust-2.13"'
436 sh 'rsync -a --exclude "test-suite.log" --include \'*/\' --include \'*.log\' --exclude=\'*\' tests/ "${WORKSPACE}/tap/ust-2.13"'
438 sh 'mkdir -p "${WORKSPACE}/log/ust-2.13"'
439 sh 'rsync -a --include "test-suite.log" --include \'*/\' --exclude=\'*\' tests/ "${WORKSPACE}/log/ust-2.13"'
445 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
453 recordIssues skipBlames: true, tools: [gcc(id: "gcc-ust-213")]
454 step([$class: 'TapPublisher', testResults: 'tap/**/*.log', verbose: true, failIfNoResults: true, failedTestsMarkBuildAsFailure: true, planRequired: true])
455 archiveArtifacts artifacts: 'tap/**,log/**', fingerprint: false
459 cleanWs cleanWhenFailure: false