summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/lttng')
-rwxr-xr-xmeta/recipes-kernel/lttng/babeltrace2/run-ptest12
-rw-r--r--meta/recipes-kernel/lttng/babeltrace2_2.0.6.bb (renamed from meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb)12
-rw-r--r--meta/recipes-kernel/lttng/babeltrace_1.5.11.bb (renamed from meta/recipes-kernel/lttng/babeltrace_1.5.8.bb)8
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch93
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch394
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch10
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch132
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch829
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch81
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch57
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules_2.13.12.bb (renamed from meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb)22
-rw-r--r--meta/recipes-kernel/lttng/lttng-platforms.inc4
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/0001-Fix-Tests-race-condition-in-test_event_tracker.patch221
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch56
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch74
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/0001-src-common-correct-header-location.patch41
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch1246
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch9
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch46
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/determinism.patch64
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch34
-rwxr-xr-xmeta/recipes-kernel/lttng/lttng-tools/run-ptest44
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools_2.13.13.bb (renamed from meta/recipes-kernel/lttng/lttng-tools_2.13.0.bb)27
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch12
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch9
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch14
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust_2.13.8.bb (renamed from meta/recipes-kernel/lttng/lttng-ust_2.13.0.bb)4
27 files changed, 1894 insertions, 1661 deletions
diff --git a/meta/recipes-kernel/lttng/babeltrace2/run-ptest b/meta/recipes-kernel/lttng/babeltrace2/run-ptest
index 72fe223436..71a9c81bfb 100755
--- a/meta/recipes-kernel/lttng/babeltrace2/run-ptest
+++ b/meta/recipes-kernel/lttng/babeltrace2/run-ptest
@@ -6,4 +6,14 @@
# test plan to raise ERRORs; this is just noise.
makeargs="LOG_DRIVER_FLAGS=--ignore-exit abs_top_srcdir=$PWD abs_top_builddir=$PWD GREP=grep SED=sed PYTHON=python3"
-exec make -C tests -k -s $makeargs $target 2>/dev/null
+exec 2> error.log
+make -C tests -k -s $makeargs $target
+exitcode=$?
+if [ -e error.log ]; then
+ cat error.log
+fi
+if [ -e tests/test-suite.log ]; then
+ cat tests/test-suite.log
+fi
+
+exit $exitcode \ No newline at end of file
diff --git a/meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb b/meta/recipes-kernel/lttng/babeltrace2_2.0.6.bb
index 2aafe81734..d6c75d7580 100644
--- a/meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb
+++ b/meta/recipes-kernel/lttng/babeltrace2_2.0.6.bb
@@ -2,24 +2,24 @@ SUMMARY = "Babeltrace2 - Trace Format Babel Tower"
DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
HOMEPAGE = "http://babeltrace.org/"
BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
-LICENSE = "MIT & GPLv2 & LGPLv2.1 & BSD-2-Clause"
+LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-only & BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=a6a458c13f18385b7bc5069a6d7b176e"
DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
-SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.0 \
+SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.0;protocol=https \
file://run-ptest \
file://0001-tests-do-not-run-test-applications-from-.libs.patch \
file://0001-Make-manpages-multilib-identical.patch \
"
-SRCREV = "23e8cf4e6fdc1d0b230e964dafac08a57e6228e6"
+SRCREV = "0a6632f77801f3218a288604c646f8a39cb0d2c4"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$"
S = "${WORKDIR}/git"
inherit autotools pkgconfig ptest python3targetconfig
-EXTRA_OECONF = "--disable-debug-info"
+EXTRA_OECONF = "--disable-debug-info --disable-Werror"
PACKAGECONFIG ??= "manpages"
PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native"
@@ -28,8 +28,10 @@ FILES:${PN}-staticdev += "${libdir}/babeltrace2/plugins/*.a"
FILES:${PN} += "${libdir}/babeltrace2/plugins/*.so"
ASNEEDED = ""
+LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd ', '', d)}"
-RDEPENDS:${PN}-ptest += "bash gawk python3"
+# coreutils since we need full mktemp
+RDEPENDS:${PN}-ptest += "bash gawk python3 make grep coreutils findutils"
do_compile_ptest () {
make -C tests all
diff --git a/meta/recipes-kernel/lttng/babeltrace_1.5.8.bb b/meta/recipes-kernel/lttng/babeltrace_1.5.11.bb
index 9f8b035128..f4d9b5e42a 100644
--- a/meta/recipes-kernel/lttng/babeltrace_1.5.8.bb
+++ b/meta/recipes-kernel/lttng/babeltrace_1.5.11.bb
@@ -2,15 +2,15 @@ SUMMARY = "Babeltrace - Trace Format Babel Tower"
DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
HOMEPAGE = "http://babeltrace.org/"
BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
-LICENSE = "MIT & GPLv2 & LGPLv2.1"
+LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
-SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.5 \
+SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.5;protocol=https \
file://run-ptest \
"
-SRCREV = "054a54ae10b01a271afc4f19496c041b10fb414c"
+SRCREV = "91c00f70884887ff5c4849a8e3d47e311a22ba9d"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>1(\.\d+)+)$"
S = "${WORKDIR}/git"
@@ -21,7 +21,7 @@ EXTRA_OECONF = "--disable-debug-info"
ASNEEDED = ""
-RDEPENDS:${PN}-ptest += "bash gawk"
+RDEPENDS:${PN}-ptest += "bash gawk make"
addtask do_patch_ptest_path after do_patch before do_configure
do_patch_ptest_path () {
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch
new file mode 100644
index 0000000000..9d5fd0de60
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch
@@ -0,0 +1,93 @@
+From fec007d9630e010062cf5699a08460f71f46b527 Mon Sep 17 00:00:00 2001
+From: Kienan Stewart <kstewart@efficios.com>
+Date: Mon, 25 Mar 2024 08:54:42 -0400
+Subject: [PATCH 1/4] Fix: ASoC snd_doc_dapm on linux 6.9-rc1
+
+See upstream commit:
+
+ commit 7df3eb4cdb6bbfa482f51548b9fd47c2723c68ba
+ Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
+ Date: Wed Mar 6 10:30:01 2024 +0100
+
+ ASoC: trace: add event to snd_soc_dapm trace events
+
+ Add the event value to the snd_soc_dapm_start and snd_soc_dapm_done trace
+ events to make them more informative.
+
+ Trace before:
+
+ aplay-229 [000] 250.140309: snd_soc_dapm_start: card=vscn-2046
+ aplay-229 [000] 250.167531: snd_soc_dapm_done: card=vscn-2046
+ aplay-229 [000] 251.169588: snd_soc_dapm_start: card=vscn-2046
+ aplay-229 [000] 251.195245: snd_soc_dapm_done: card=vscn-2046
+
+ Trace after:
+
+ aplay-214 [000] 693.290612: snd_soc_dapm_start: card=vscn-2046 event=1
+ aplay-214 [000] 693.315508: snd_soc_dapm_done: card=vscn-2046 event=1
+ aplay-214 [000] 694.537349: snd_soc_dapm_start: card=vscn-2046 event=2
+ aplay-214 [000] 694.563241: snd_soc_dapm_done: card=vscn-2046 event=2
+
+Upstream-Status: Backport [88c4e0fe Fix: ASoC snd_doc_dapm on linux 6.9-rc1]
+
+Change-Id: If0d33544b8dd1dfb3d12ca9390892190fc0444b0
+Signed-off-by: Kienan Stewart <kstewart@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ include/instrumentation/events/asoc.h | 33 +++++++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+diff --git a/include/instrumentation/events/asoc.h b/include/instrumentation/events/asoc.h
+index 21d13a0f..5126d4c1 100644
+--- a/include/instrumentation/events/asoc.h
++++ b/include/instrumentation/events/asoc.h
+@@ -51,6 +51,38 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_done,
+
+ )
+
++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
++LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic,
++
++ TP_PROTO(struct snd_soc_card *card, int event),
++
++ TP_ARGS(card, event),
++
++ TP_FIELDS(
++ ctf_string(name, card->name)
++ ctf_integer(int, event, event)
++ )
++)
++LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_start,
++
++ asoc_snd_soc_dapm_start,
++
++ TP_PROTO(struct snd_soc_card *card, int event),
++
++ TP_ARGS(card, event)
++
++)
++
++LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done,
++
++ asoc_snd_soc_dapm_done,
++
++ TP_PROTO(struct snd_soc_card *card, int event),
++
++ TP_ARGS(card, event)
++
++)
++#else
+ LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic,
+
+ TP_PROTO(struct snd_soc_card *card),
+@@ -81,6 +113,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done,
+ TP_ARGS(card)
+
+ )
++#endif
+
+ LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget,
+
+--
+2.39.2
+
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch
deleted file mode 100644
index 4e52e5f122..0000000000
--- a/meta/recipes-kernel/lttng/lttng-modules/0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch
+++ /dev/null
@@ -1,394 +0,0 @@
-From 8be4c8a38ee1e297578e094a6e4c143ec5259aba Mon Sep 17 00:00:00 2001
-From: Michael Jeanson <mjeanson@efficios.com>
-Date: Mon, 13 Sep 2021 12:00:38 -0400
-Subject: [PATCH 1/2] fix: cpu/hotplug: Remove deprecated CPU-hotplug
- functions. (v5.15)
-
-The CPU-hotplug functions get|put_online_cpus() were deprecated in v4.13
-and removed in v5.15.
-
-See upstream commits :
-
-commit 8c854303ce0e38e5bbedd725ff39da7e235865d8
-Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-Date: Tue Aug 3 16:16:21 2021 +0200
-
- cpu/hotplug: Remove deprecated CPU-hotplug functions.
-
- No users in tree use the deprecated CPU-hotplug functions anymore.
-
- Remove them.
-
-Introduced in v4.13 :
-
- commit 8f553c498e1772cccb39a114da4a498d22992758
- Author: Thomas Gleixner <tglx@linutronix.de>
- Date: Wed May 24 10:15:12 2017 +0200
-
- cpu/hotplug: Provide cpus_read|write_[un]lock()
-
- The counting 'rwsem' hackery of get|put_online_cpus() is going to be
- replaced by percpu rwsem.
-
- Rename the functions to make it clear that it's locking and not some
- refcount style interface. These new functions will be used for the
- preparatory patches which make the code ready for the percpu rwsem
- conversion.
-
- Rename all instances in the cpu hotplug code while at it.
-
-Upstream-Status: backport [https://git.lttng.org/?p=lttng-modules.git;a=commit;h=ffcc873470121ef1ebb110df3d9038a38d9cb7cb]
-
-Change-Id: I5a37cf5afc075a402b7347989fac637dfa60a1ed
-Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
-Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
----
- include/wrapper/cpu.h | 44 +++++++++++++++++++++++
- src/lib/ringbuffer/ring_buffer_backend.c | 8 ++---
- src/lib/ringbuffer/ring_buffer_frontend.c | 17 ++++-----
- src/lib/ringbuffer/ring_buffer_iterator.c | 15 ++++----
- src/lttng-context-perf-counters.c | 11 +++---
- src/lttng-statedump-impl.c | 6 ++--
- 6 files changed, 74 insertions(+), 27 deletions(-)
- create mode 100644 include/wrapper/cpu.h
-
-diff --git a/include/wrapper/cpu.h b/include/wrapper/cpu.h
-new file mode 100644
-index 00000000..cbee1962
---- /dev/null
-+++ b/include/wrapper/cpu.h
-@@ -0,0 +1,44 @@
-+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
-+ *
-+ * wrapper/cpu.h
-+ *
-+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
-+ */
-+
-+#ifndef _LTTNG_WRAPPER_CPU_H
-+#define _LTTNG_WRAPPER_CPU_H
-+
-+#include <linux/cpu.h>
-+#include <lttng/kernel-version.h>
-+
-+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0))
-+
-+static inline
-+void lttng_cpus_read_lock(void)
-+{
-+ cpus_read_lock();
-+}
-+
-+static inline
-+void lttng_cpus_read_unlock(void)
-+{
-+ cpus_read_unlock();
-+}
-+
-+#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0) */
-+
-+static inline
-+void lttng_cpus_read_lock(void)
-+{
-+ get_online_cpus();
-+}
-+
-+static inline
-+void lttng_cpus_read_unlock(void)
-+{
-+ put_online_cpus();
-+}
-+
-+#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0) */
-+
-+#endif /* _LTTNG_WRAPPER_CPU_H */
-diff --git a/src/lib/ringbuffer/ring_buffer_backend.c b/src/lib/ringbuffer/ring_buffer_backend.c
-index 26efb2bc..9a339be0 100644
---- a/src/lib/ringbuffer/ring_buffer_backend.c
-+++ b/src/lib/ringbuffer/ring_buffer_backend.c
-@@ -12,10 +12,10 @@
- #include <linux/delay.h>
- #include <linux/errno.h>
- #include <linux/slab.h>
--#include <linux/cpu.h>
- #include <linux/mm.h>
- #include <linux/vmalloc.h>
-
-+#include <wrapper/cpu.h>
- #include <wrapper/mm.h>
- #include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */
- #include <ringbuffer/config.h>
-@@ -445,14 +445,14 @@ int channel_backend_init(struct channel_backend *chanb,
- chanb->cpu_hp_notifier.priority = 5;
- register_hotcpu_notifier(&chanb->cpu_hp_notifier);
-
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- for_each_online_cpu(i) {
- ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i),
- chanb, i);
- if (ret)
- goto free_bufs; /* cpu hotplug locked */
- }
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- #else
- for_each_possible_cpu(i) {
- ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i),
-@@ -485,7 +485,7 @@ free_bufs:
- */
- #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
- #ifdef CONFIG_HOTPLUG_CPU
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- unregister_hotcpu_notifier(&chanb->cpu_hp_notifier);
- #endif
- #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
-diff --git a/src/lib/ringbuffer/ring_buffer_frontend.c b/src/lib/ringbuffer/ring_buffer_frontend.c
-index e9056118..87a575d0 100644
---- a/src/lib/ringbuffer/ring_buffer_frontend.c
-+++ b/src/lib/ringbuffer/ring_buffer_frontend.c
-@@ -48,6 +48,7 @@
- #include <ringbuffer/iterator.h>
- #include <ringbuffer/nohz.h>
- #include <wrapper/atomic.h>
-+#include <wrapper/cpu.h>
- #include <wrapper/kref.h>
- #include <wrapper/percpu-defs.h>
- #include <wrapper/timer.h>
-@@ -724,7 +725,7 @@ static void channel_unregister_notifiers(struct lttng_kernel_ring_buffer_channel
- int cpu;
-
- #ifdef CONFIG_HOTPLUG_CPU
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- chan->cpu_hp_enable = 0;
- for_each_online_cpu(cpu) {
- struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
-@@ -732,7 +733,7 @@ static void channel_unregister_notifiers(struct lttng_kernel_ring_buffer_channel
- lib_ring_buffer_stop_switch_timer(buf);
- lib_ring_buffer_stop_read_timer(buf);
- }
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- unregister_cpu_notifier(&chan->cpu_hp_notifier);
- #else
- for_each_possible_cpu(cpu) {
-@@ -772,14 +773,14 @@ void lib_ring_buffer_set_quiescent_channel(struct lttng_kernel_ring_buffer_chann
- const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;
-
- if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- for_each_channel_cpu(cpu, chan) {
- struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
- cpu);
-
- lib_ring_buffer_set_quiescent(buf);
- }
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- } else {
- struct lttng_kernel_ring_buffer *buf = chan->backend.buf;
-
-@@ -794,14 +795,14 @@ void lib_ring_buffer_clear_quiescent_channel(struct lttng_kernel_ring_buffer_cha
- const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;
-
- if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- for_each_channel_cpu(cpu, chan) {
- struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
- cpu);
-
- lib_ring_buffer_clear_quiescent(buf);
- }
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- } else {
- struct lttng_kernel_ring_buffer *buf = chan->backend.buf;
-
-@@ -899,7 +900,7 @@ struct lttng_kernel_ring_buffer_channel *channel_create(const struct lttng_kerne
- chan->cpu_hp_notifier.priority = 6;
- register_cpu_notifier(&chan->cpu_hp_notifier);
-
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- for_each_online_cpu(cpu) {
- struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
- cpu);
-@@ -909,7 +910,7 @@ struct lttng_kernel_ring_buffer_channel *channel_create(const struct lttng_kerne
- spin_unlock(&per_cpu(ring_buffer_nohz_lock, cpu));
- }
- chan->cpu_hp_enable = 1;
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- #else
- for_each_possible_cpu(cpu) {
- struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,
-diff --git a/src/lib/ringbuffer/ring_buffer_iterator.c b/src/lib/ringbuffer/ring_buffer_iterator.c
-index 25839af6..60c95ca6 100644
---- a/src/lib/ringbuffer/ring_buffer_iterator.c
-+++ b/src/lib/ringbuffer/ring_buffer_iterator.c
-@@ -10,6 +10,7 @@
- */
-
- #include <ringbuffer/iterator.h>
-+#include <wrapper/cpu.h>
- #include <wrapper/file.h>
- #include <wrapper/uaccess.h>
- #include <linux/jiffies.h>
-@@ -440,13 +441,13 @@ int channel_iterator_init(struct lttng_kernel_ring_buffer_channel *chan)
- chan->hp_iter_notifier.priority = 10;
- register_cpu_notifier(&chan->hp_iter_notifier);
-
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- for_each_online_cpu(cpu) {
- buf = per_cpu_ptr(chan->backend.buf, cpu);
- lib_ring_buffer_iterator_init(chan, buf);
- }
- chan->hp_iter_enable = 1;
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- #else
- for_each_possible_cpu(cpu) {
- buf = per_cpu_ptr(chan->backend.buf, cpu);
-@@ -519,7 +520,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan)
- CHAN_WARN_ON(chan, config->output != RING_BUFFER_ITERATOR);
-
- if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- /* Allow CPU hotplug to keep track of opened reader */
- chan->iter.read_open = 1;
- for_each_channel_cpu(cpu, chan) {
-@@ -529,7 +530,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan)
- goto error;
- buf->iter.read_open = 1;
- }
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- } else {
- buf = channel_get_ring_buffer(config, chan, 0);
- ret = lib_ring_buffer_iterator_open(buf);
-@@ -538,7 +539,7 @@ int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan)
- error:
- /* Error should always happen on CPU 0, hence no close is required. */
- CHAN_WARN_ON(chan, cpu != 0);
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- return ret;
- }
- EXPORT_SYMBOL_GPL(channel_iterator_open);
-@@ -550,7 +551,7 @@ void channel_iterator_release(struct lttng_kernel_ring_buffer_channel *chan)
- int cpu;
-
- if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- for_each_channel_cpu(cpu, chan) {
- buf = channel_get_ring_buffer(config, chan, cpu);
- if (buf->iter.read_open) {
-@@ -559,7 +560,7 @@ void channel_iterator_release(struct lttng_kernel_ring_buffer_channel *chan)
- }
- }
- chan->iter.read_open = 0;
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- } else {
- buf = channel_get_ring_buffer(config, chan, 0);
- lib_ring_buffer_iterator_release(buf);
-diff --git a/src/lttng-context-perf-counters.c b/src/lttng-context-perf-counters.c
-index b0227d47..372f05e0 100644
---- a/src/lttng-context-perf-counters.c
-+++ b/src/lttng-context-perf-counters.c
-@@ -16,6 +16,7 @@
- #include <lttng/events.h>
- #include <lttng/events-internal.h>
- #include <ringbuffer/frontend_types.h>
-+#include <wrapper/cpu.h>
- #include <wrapper/vmalloc.h>
- #include <wrapper/perf.h>
- #include <lttng/tracer.h>
-@@ -97,10 +98,10 @@ void lttng_destroy_perf_counter_ctx_field(void *priv)
- {
- int cpu;
-
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- for_each_online_cpu(cpu)
- perf_event_release_kernel(events[cpu]);
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- #ifdef CONFIG_HOTPLUG_CPU
- unregister_cpu_notifier(&perf_field->nb);
- #endif
-@@ -304,7 +305,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
- perf_field->nb.priority = 0;
- register_cpu_notifier(&perf_field->nb);
- #endif
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- for_each_online_cpu(cpu) {
- events[cpu] = wrapper_perf_event_create_kernel_counter(attr,
- cpu, NULL, overflow_callback);
-@@ -317,7 +318,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
- goto counter_busy;
- }
- }
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- perf_field->hp_enable = 1;
- }
- #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
-@@ -351,7 +352,7 @@ counter_error:
- if (events[cpu] && !IS_ERR(events[cpu]))
- perf_event_release_kernel(events[cpu]);
- }
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- #ifdef CONFIG_HOTPLUG_CPU
- unregister_cpu_notifier(&perf_field->nb);
- #endif
-diff --git a/src/lttng-statedump-impl.c b/src/lttng-statedump-impl.c
-index 4dfbca0b..2b42783a 100644
---- a/src/lttng-statedump-impl.c
-+++ b/src/lttng-statedump-impl.c
-@@ -23,7 +23,6 @@
- #include <linux/file.h>
- #include <linux/interrupt.h>
- #include <linux/irqnr.h>
--#include <linux/cpu.h>
- #include <linux/netdevice.h>
- #include <linux/inetdevice.h>
- #include <linux/mm.h>
-@@ -34,6 +33,7 @@
-
- #include <lttng/events.h>
- #include <lttng/tracer.h>
-+#include <wrapper/cpu.h>
- #include <wrapper/irqdesc.h>
- #include <wrapper/fdtable.h>
- #include <wrapper/namespace.h>
-@@ -770,7 +770,7 @@ int do_lttng_statedump(struct lttng_kernel_session *session)
- * is to guarantee that each CPU has been in a state where is was in
- * syscall mode (i.e. not in a trap, an IRQ or a soft IRQ).
- */
-- get_online_cpus();
-+ lttng_cpus_read_lock();
- atomic_set(&kernel_threads_to_run, num_online_cpus());
- for_each_online_cpu(cpu) {
- INIT_DELAYED_WORK(&cpu_work[cpu], lttng_statedump_work_func);
-@@ -778,7 +778,7 @@ int do_lttng_statedump(struct lttng_kernel_session *session)
- }
- /* Wait for all threads to run */
- __wait_event(statedump_wq, (atomic_read(&kernel_threads_to_run) == 0));
-- put_online_cpus();
-+ lttng_cpus_read_unlock();
- /* Our work is done */
- trace_lttng_statedump_end(session);
- return 0;
---
-2.19.1
-
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch
index 76a5787c37..120528bf9c 100644
--- a/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch
+++ b/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch
@@ -19,10 +19,10 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
src/Kbuild | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
-diff --git a/src/Kbuild b/src/Kbuild
-index 7137874..04eb5c9 100644
---- a/src/Kbuild
-+++ b/src/Kbuild
+Index: lttng-modules-2.13.10/src/Kbuild
+===================================================================
+--- lttng-modules-2.13.10.orig/src/Kbuild
++++ lttng-modules-2.13.10/src/Kbuild
@@ -2,10 +2,13 @@
ifdef CONFIG_LOCALVERSION # Check if dot-config is included.
@@ -38,7 +38,7 @@ index 7137874..04eb5c9 100644
TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
lttng_check_linux_version = $(shell pwd)/include/linux/version.h
-@@ -150,3 +153,5 @@ lttng-statedump-objs := lttng-statedump-impl.o
+@@ -150,3 +153,5 @@ lttng-statedump-objs := lttng-statedump-
obj-$(CONFIG_LTTNG) += probes/
obj-$(CONFIG_LTTNG) += lib/
obj-$(CONFIG_LTTNG) += tests/
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch
new file mode 100644
index 0000000000..6ea10ffc91
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch
@@ -0,0 +1,132 @@
+From d8379ec6365a925db33cae94fb6783cdbdb6a922 Mon Sep 17 00:00:00 2001
+From: Kienan Stewart <kstewart@efficios.com>
+Date: Mon, 25 Mar 2024 09:40:29 -0400
+Subject: [PATCH 2/4] Fix: ASoC add component to set_bias_level events in linux
+ 6.9-rc1
+
+See upstream commit:
+
+ commit 6ef46a69ec32fe1cf56de67742fcd01af4bf48af
+ Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
+ Date: Wed Mar 6 10:30:00 2024 +0100
+
+ ASoC: trace: add component to set_bias_level trace events
+
+ The snd_soc_bias_level_start and snd_soc_bias_level_done trace events
+ currently look like:
+
+ aplay-229 [000] 1250.140778: snd_soc_bias_level_start: card=vscn-2046 val=1
+ aplay-229 [000] 1250.140784: snd_soc_bias_level_done: card=vscn-2046 val=1
+ aplay-229 [000] 1250.140786: snd_soc_bias_level_start: card=vscn-2046 val=2
+ aplay-229 [000] 1250.140788: snd_soc_bias_level_done: card=vscn-2046 val=2
+ kworker/u8:1-21 [000] 1250.140871: snd_soc_bias_level_start: card=vscn-2046 val=1
+ kworker/u8:0-11 [000] 1250.140951: snd_soc_bias_level_start: card=vscn-2046 val=1
+ kworker/u8:0-11 [000] 1250.140956: snd_soc_bias_level_done: card=vscn-2046 val=1
+ kworker/u8:0-11 [000] 1250.140959: snd_soc_bias_level_start: card=vscn-2046 val=2
+ kworker/u8:0-11 [000] 1250.140961: snd_soc_bias_level_done: card=vscn-2046 val=2
+ kworker/u8:1-21 [000] 1250.167219: snd_soc_bias_level_done: card=vscn-2046 val=1
+ kworker/u8:1-21 [000] 1250.167222: snd_soc_bias_level_start: card=vscn-2046 val=2
+ kworker/u8:1-21 [000] 1250.167232: snd_soc_bias_level_done: card=vscn-2046 val=2
+ kworker/u8:0-11 [000] 1250.167440: snd_soc_bias_level_start: card=vscn-2046 val=3
+ kworker/u8:0-11 [000] 1250.167444: snd_soc_bias_level_done: card=vscn-2046 val=3
+ kworker/u8:1-21 [000] 1250.167497: snd_soc_bias_level_start: card=vscn-2046 val=3
+ kworker/u8:1-21 [000] 1250.167506: snd_soc_bias_level_done: card=vscn-2046 val=3
+
+ There are clearly multiple calls, one per component, but they cannot be
+ discriminated from each other.
+
+ Change the ftrace events to also print the component name, to make it clear
+ which part of the code is involved. This requires changing the passed value
+ from a struct snd_soc_card, where the DAPM context is not kwown, to a
+ struct snd_soc_dapm_context where it is obviously known but the a card
+ pointer is also available.
+
+ With this change, the resulting trace becomes:
+
+ aplay-247 [000] 1436.357332: snd_soc_bias_level_start: card=vscn-2046 component=(none) val=1
+ aplay-247 [000] 1436.357338: snd_soc_bias_level_done: card=vscn-2046 component=(none) val=1
+ aplay-247 [000] 1436.357340: snd_soc_bias_level_start: card=vscn-2046 component=(none) val=2
+ aplay-247 [000] 1436.357343: snd_soc_bias_level_done: card=vscn-2046 component=(none) val=2
+ kworker/u8:4-215 [000] 1436.357437: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=1
+ kworker/u8:5-231 [000] 1436.357518: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=1
+ kworker/u8:5-231 [000] 1436.357523: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=1
+ kworker/u8:5-231 [000] 1436.357526: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=2
+ kworker/u8:5-231 [000] 1436.357528: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=2
+ kworker/u8:4-215 [000] 1436.383217: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=1
+ kworker/u8:4-215 [000] 1436.383221: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=2
+ kworker/u8:4-215 [000] 1436.383231: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=2
+ kworker/u8:5-231 [000] 1436.383468: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=3
+ kworker/u8:5-231 [000] 1436.383472: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=3
+ kworker/u8:4-215 [000] 1436.383503: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=3
+ kworker/u8:4-215 [000] 1436.383513: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=3
+
+Upstream-Status: Backport [303434ab Fix: ASoC add component to set_bias_level events in linux 6.9-rc1]
+
+Change-Id: I959f1680c002acdf29828b968d3975247f5433d8
+Signed-off-by: Kienan Stewart <kstewart@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ include/instrumentation/events/asoc.h | 36 +++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+Index: lttng-modules-2.13.12/include/instrumentation/events/asoc.h
+===================================================================
+--- lttng-modules-2.13.12.orig/include/instrumentation/events/asoc.h
++++ lttng-modules-2.13.12/include/instrumentation/events/asoc.h
+@@ -10,6 +10,7 @@
+ #include <lttng/kernel-version.h>
+
+ #define DAPM_DIRECT "(direct)"
++#define DAPM_COMPONENT_NONE "(none)"
+
+ #ifndef _TRACE_ASOC_DEF
+ #define _TRACE_ASOC_DEF
+@@ -119,6 +120,40 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc
+ )
+ #endif
+
++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
++LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_context,
++
++ TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
++
++ TP_ARGS(dapm, val),
++
++ TP_FIELDS(
++ ctf_string(name, dapm->card->name)
++ ctf_string(component, dapm->component ? dapm->component->name : DAPM_COMPONENT_NONE)
++ ctf_integer(int, val, val)
++ )
++)
++
++LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_context, snd_soc_bias_level_start,
++
++ asoc_snd_soc_bias_level_start,
++
++ TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
++
++ TP_ARGS(dapm, val)
++
++)
++
++LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_context, snd_soc_bias_level_done,
++
++ asoc_snd_soc_bias_level_done,
++
++ TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
++
++ TP_ARGS(dapm, val)
++
++)
++#else
+ LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card,
+
+ TP_PROTO(struct snd_soc_card *card, int val),
+@@ -150,6 +185,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc
+ TP_ARGS(card, val)
+
+ )
++#endif
+
+ #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
+ LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic,
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch
deleted file mode 100644
index 5b5edc5319..0000000000
--- a/meta/recipes-kernel/lttng/lttng-modules/0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch
+++ /dev/null
@@ -1,829 +0,0 @@
-From c570be0da77e963d77bac099d468bc0cd5f1bd63 Mon Sep 17 00:00:00 2001
-From: Michael Jeanson <mjeanson@efficios.com>
-Date: Mon, 13 Sep 2021 14:16:22 -0400
-Subject: [PATCH 2/2] fix: Revert "Makefile: Enable -Wimplicit-fallthrough for
- Clang" (v5.15)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Starting with v5.15, "-Wimplicit-fallthrough=5" was added to the build
-flags which requires the use of "__attribute__((__fallthrough__))" to
-annotate fallthrough case statements.
-
-See upstream commit by the man himself:
-
- commit d936eb23874433caa3e3d841cfa16f5434b85dcf
- Author: Linus Torvalds <torvalds@linux-foundation.org>
- Date: Thu Jul 15 18:05:31 2021 -0700
-
- Revert "Makefile: Enable -Wimplicit-fallthrough for Clang"
-
- This reverts commit b7eb335e26a9c7f258c96b3962c283c379d3ede0.
-
- It turns out that the problem with the clang -Wimplicit-fallthrough
- warning is not about the kernel source code, but about clang itself, and
- that the warning is unusable until clang fixes its broken ways.
-
- In particular, when you enable this warning for clang, you not only get
- warnings about implicit fallthroughs. You also get this:
-
- warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough]
-
- which is completely broken becasue it
-
- (a) doesn't even tell you where the problem is (seriously: no line
- numbers, no filename, no nothing).
-
- (b) is fundamentally broken anyway, because there are perfectly valid
- reasons to have a fallthrough statement even if it turns out that
- it can perhaps not be reached.
-
- In the kernel, an example of that second case is code in the scheduler:
-
- switch (state) {
- case cpuset:
- if (IS_ENABLED(CONFIG_CPUSETS)) {
- cpuset_cpus_allowed_fallback(p);
- state = possible;
- break;
- }
- fallthrough;
- case possible:
-
- where if CONFIG_CPUSETS is enabled you actually never hit the
- fallthrough case at all. But that in no way makes the fallthrough
- wrong.
-
- So the warning is completely broken, and enabling it for clang is a very
- bad idea.
-
- In the meantime, we can keep the gcc option enabled, and make the gcc
- build use
-
- -Wimplicit-fallthrough=5
-
- which means that we will at least continue to require a proper
- fallthrough statement, and that gcc won't silently accept the magic
- comment versions. Because gcc does this all correctly, and while the odd
- "=5" part is kind of obscure, it's documented in [1]:
-
- "-Wimplicit-fallthrough=5 doesn’t recognize any comments as
- fallthrough comments, only attributes disable the warning"
-
- so if clang ever fixes its bad behavior we can try enabling it there again.
-
-Upstream-Status: backport [https://git.lttng.org/?p=lttng-modules.git;a=commit;h=c190d76e8c7b44d62b3651ab845b765c1b1f8104]
-
-Change-Id: Iea69849592fb69ac04fb9bb28efcd6b8dce8ba88
-Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
-Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
----
- include/counter/counter-api.h | 4 +-
- include/lttng/events-internal.h | 11 ++-
- include/wrapper/compiler_attributes.h | 34 +++++++
- src/lib/counter/counter.c | 13 ++-
- src/lttng-abi.c | 91 ++++++++++++------
- src/lttng-bytecode-interpreter.c | 4 +-
- src/lttng-bytecode-specialize.c | 5 +-
- src/lttng-events.c | 129 +++++++++++++++++---------
- src/lttng-string-utils.c | 3 +-
- src/probes/lttng-kretprobes.c | 7 +-
- 10 files changed, 215 insertions(+), 86 deletions(-)
- create mode 100644 include/wrapper/compiler_attributes.h
-
-diff --git a/include/counter/counter-api.h b/include/counter/counter-api.h
-index fbc65818..c9f2b141 100644
---- a/include/counter/counter-api.h
-+++ b/include/counter/counter-api.h
-@@ -15,6 +15,7 @@
- #include <linux/bitops.h>
- #include <counter/counter.h>
- #include <counter/counter-internal.h>
-+#include <wrapper/compiler_attributes.h>
- #include <wrapper/limits.h>
-
- /*
-@@ -256,7 +257,8 @@ static __always_inline int lttng_counter_add(const struct lib_counter_config *co
- const size_t *dimension_indexes, int64_t v)
- {
- switch (config->alloc) {
-- case COUNTER_ALLOC_PER_CPU: /* Fallthrough */
-+ case COUNTER_ALLOC_PER_CPU:
-+ lttng_fallthrough;
- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
- return __lttng_counter_add_percpu(config, counter, dimension_indexes, v);
- case COUNTER_ALLOC_GLOBAL:
-diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h
-index cd560de8..ca2190c4 100644
---- a/include/lttng/events-internal.h
-+++ b/include/lttng/events-internal.h
-@@ -8,6 +8,8 @@
- #ifndef _LTTNG_EVENTS_INTERNAL_H
- #define _LTTNG_EVENTS_INTERNAL_H
-
-+#include <wrapper/compiler_attributes.h>
-+
- #include <lttng/events.h>
-
- struct lttng_syscall_filter;
-@@ -561,9 +563,12 @@ static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kern
- if (!type_integer)
- return false;
- switch (type_integer->size) {
-- case 8: /* Fall-through. */
-- case 16: /* Fall-through. */
-- case 32: /* Fall-through. */
-+ case 8:
-+ lttng_fallthrough;
-+ case 16:
-+ lttng_fallthrough;
-+ case 32:
-+ lttng_fallthrough;
- case 64:
- break;
- default:
-diff --git a/include/wrapper/compiler_attributes.h b/include/wrapper/compiler_attributes.h
-new file mode 100644
-index 00000000..c2c96e76
---- /dev/null
-+++ b/include/wrapper/compiler_attributes.h
-@@ -0,0 +1,34 @@
-+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
-+ *
-+ * wrapper/compiler_attributes.h
-+ *
-+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
-+ */
-+
-+#ifndef _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H
-+#define _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H
-+
-+#include <lttng/kernel-version.h>
-+
-+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0))
-+#include <linux/compiler_attributes.h>
-+#endif
-+
-+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0))
-+
-+/*
-+ * Use the kernel provided fallthrough attribute macro.
-+ */
-+#define lttng_fallthrough fallthrough
-+
-+#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */
-+
-+/*
-+ * Fallback to the comment for kernels pre 5.15 that don't build with
-+ * '-Wimplicit-fallthrough=5'.
-+ */
-+#define lttng_fallthrough do {} while (0) /* fallthrough */
-+
-+#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */
-+
-+#endif /* _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H */
-diff --git a/src/lib/counter/counter.c b/src/lib/counter/counter.c
-index a4500a0e..bf038aac 100644
---- a/src/lib/counter/counter.c
-+++ b/src/lib/counter/counter.c
-@@ -11,6 +11,7 @@
- #include <linux/cpumask.h>
- #include <counter/counter.h>
- #include <counter/counter-internal.h>
-+#include <wrapper/compiler_attributes.h>
- #include <wrapper/vmalloc.h>
- #include <wrapper/limits.h>
-
-@@ -324,7 +325,8 @@ int lttng_counter_aggregate(const struct lib_counter_config *config,
- *underflow = false;
-
- switch (config->alloc) {
-- case COUNTER_ALLOC_GLOBAL: /* Fallthrough */
-+ case COUNTER_ALLOC_GLOBAL:
-+ lttng_fallthrough;
- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
- /* Read global counter. */
- ret = lttng_counter_read(config, counter, dimension_indexes,
-@@ -342,7 +344,8 @@ int lttng_counter_aggregate(const struct lib_counter_config *config,
- switch (config->alloc) {
- case COUNTER_ALLOC_GLOBAL:
- break;
-- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: /* Fallthrough */
-+ case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
-+ lttng_fallthrough;
- case COUNTER_ALLOC_PER_CPU:
- //TODO: integrate with CPU hotplug and online cpus
- for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
-@@ -448,7 +451,8 @@ int lttng_counter_clear(const struct lib_counter_config *config,
- int cpu, ret;
-
- switch (config->alloc) {
-- case COUNTER_ALLOC_GLOBAL: /* Fallthrough */
-+ case COUNTER_ALLOC_GLOBAL:
-+ lttng_fallthrough;
- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
- /* Clear global counter. */
- ret = lttng_counter_clear_cpu(config, counter, dimension_indexes, -1);
-@@ -462,7 +466,8 @@ int lttng_counter_clear(const struct lib_counter_config *config,
- switch (config->alloc) {
- case COUNTER_ALLOC_GLOBAL:
- break;
-- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: /* Fallthrough */
-+ case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
-+ lttng_fallthrough;
- case COUNTER_ALLOC_PER_CPU:
- //TODO: integrate with CPU hotplug and online cpus
- for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
-diff --git a/src/lttng-abi.c b/src/lttng-abi.c
-index cc453894..eac1afd1 100644
---- a/src/lttng-abi.c
-+++ b/src/lttng-abi.c
-@@ -34,6 +34,7 @@
- #include <ringbuffer/vfs.h>
- #include <ringbuffer/backend.h>
- #include <ringbuffer/frontend.h>
-+#include <wrapper/compiler_attributes.h>
- #include <wrapper/poll.h>
- #include <wrapper/file.h>
- #include <wrapper/kref.h>
-@@ -1332,7 +1333,8 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
- */
- return -ENOSYS;
- }
-- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
-+ case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
- {
- struct lttng_metadata_stream *stream = filp->private_data;
-@@ -1441,7 +1443,8 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
- */
- return -ENOSYS;
- }
-- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
-+ case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
- {
- struct lttng_metadata_stream *stream = filp->private_data;
-@@ -1758,8 +1761,10 @@ int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param)
- switch (event_param->instrumentation) {
- case LTTNG_KERNEL_ABI_SYSCALL:
- switch (event_param->u.syscall.entryexit) {
-- case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */
-- case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
- break;
- default:
-@@ -1783,20 +1788,26 @@ int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param)
- switch (event_param->u.kretprobe.entryexit) {
- case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
- break;
-- case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */
-- case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
-+ lttng_fallthrough;
- default:
- return -EINVAL;
- }
- break;
-
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_UPROBE:
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- return -EINVAL;
- }
-@@ -1830,18 +1841,23 @@ int lttng_abi_create_event(struct file *channel_file,
- }
-
- switch (event_param->instrumentation) {
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- fops = &lttng_event_recorder_enabler_fops;
- break;
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_UPROBE:
- fops = &lttng_event_recorder_event_fops;
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- return -EINVAL;
- }
-@@ -1867,7 +1883,8 @@ int lttng_abi_create_event(struct file *channel_file,
- goto event_error;
-
- switch (event_param->instrumentation) {
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- {
- struct lttng_event_enabler *event_enabler;
-@@ -1887,8 +1904,10 @@ int lttng_abi_create_event(struct file *channel_file,
- break;
- }
-
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_UPROBE:
- {
- struct lttng_kernel_event_recorder *event;
-@@ -1908,8 +1927,10 @@ int lttng_abi_create_event(struct file *channel_file,
- break;
- }
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- ret = -EINVAL;
- goto event_error;
-@@ -2043,18 +2064,23 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
- }
-
- switch (event_notifier_param->event.instrumentation) {
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- fops = &lttng_event_notifier_enabler_fops;
- break;
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_UPROBE:
- fops = &lttng_event_notifier_event_fops;
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- ret = -EINVAL;
- goto inval_instr;
-@@ -2086,7 +2112,8 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
- goto event_notifier_error;
-
- switch (event_notifier_param->event.instrumentation) {
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- {
- struct lttng_event_notifier_enabler *enabler;
-@@ -2110,8 +2137,10 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
- break;
- }
-
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_UPROBE:
- {
- struct lttng_kernel_event_notifier *event_notifier;
-@@ -2135,8 +2164,10 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
- break;
- }
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- ret = -EINVAL;
- goto event_notifier_error;
-diff --git a/src/lttng-bytecode-interpreter.c b/src/lttng-bytecode-interpreter.c
-index b46a23b7..a2a932c6 100644
---- a/src/lttng-bytecode-interpreter.c
-+++ b/src/lttng-bytecode-interpreter.c
-@@ -7,6 +7,7 @@
- * Copyright (C) 2010-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-+#include <wrapper/compiler_attributes.h>
- #include <wrapper/uaccess.h>
- #include <wrapper/objtool.h>
- #include <wrapper/types.h>
-@@ -421,7 +422,8 @@ static int dynamic_get_index(struct lttng_kernel_probe_ctx *lttng_probe_ctx,
- }
- break;
- case LOAD_ROOT_CONTEXT:
-- case LOAD_ROOT_APP_CONTEXT: /* Fall-through */
-+ lttng_fallthrough;
-+ case LOAD_ROOT_APP_CONTEXT:
- {
- ret = context_get_index(lttng_probe_ctx,
- &stack_top->u.ptr,
-diff --git a/src/lttng-bytecode-specialize.c b/src/lttng-bytecode-specialize.c
-index c4b9d04b..f8b5f19d 100644
---- a/src/lttng-bytecode-specialize.c
-+++ b/src/lttng-bytecode-specialize.c
-@@ -8,6 +8,8 @@
- */
-
- #include <linux/slab.h>
-+#include <wrapper/compiler_attributes.h>
-+
- #include <lttng/lttng-bytecode.h>
- #include <lttng/align.h>
- #include <lttng/events-internal.h>
-@@ -271,7 +273,8 @@ static int specialize_get_index(struct bytecode_runtime *runtime,
- }
- case OBJECT_TYPE_STRUCT:
- /* Only generated by the specialize phase. */
-- case OBJECT_TYPE_VARIANT: /* Fall-through */
-+ case OBJECT_TYPE_VARIANT:
-+ lttng_fallthrough;
- default:
- printk(KERN_WARNING "LTTng: bytecode: Unexpected get index type %d",
- (int) stack_top->load.object_type);
-diff --git a/src/lttng-events.c b/src/lttng-events.c
-index e785fe4d..230e3934 100644
---- a/src/lttng-events.c
-+++ b/src/lttng-events.c
-@@ -28,6 +28,7 @@
- #include <linux/vmalloc.h>
- #include <linux/dmi.h>
-
-+#include <wrapper/compiler_attributes.h>
- #include <wrapper/uuid.h>
- #include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */
- #include <wrapper/random.h>
-@@ -659,12 +660,14 @@ int lttng_event_enable(struct lttng_kernel_event_common *event)
- goto end;
- }
- switch (event->priv->instrumentation) {
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- ret = -EINVAL;
- break;
-
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_UPROBE:
- WRITE_ONCE(event->enabled, 1);
- break;
-@@ -673,8 +676,10 @@ int lttng_event_enable(struct lttng_kernel_event_common *event)
- ret = lttng_kretprobes_event_enable_state(event, 1);
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- ret = -EINVAL;
-@@ -719,12 +724,14 @@ int lttng_event_disable(struct lttng_kernel_event_common *event)
- goto end;
- }
- switch (event->priv->instrumentation) {
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- ret = -EINVAL;
- break;
-
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_UPROBE:
- WRITE_ONCE(event->enabled, 0);
- break;
-@@ -733,8 +740,10 @@ int lttng_event_disable(struct lttng_kernel_event_common *event)
- ret = lttng_kretprobes_event_enable_state(event, 0);
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- ret = -EINVAL;
-@@ -873,15 +882,20 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
- event_name = event_desc->event_name;
- break;
-
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_UPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- event_name = event_param->name;
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- ret = -EINVAL;
-@@ -1093,8 +1107,10 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
- WARN_ON_ONCE(!ret);
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- ret = -EINVAL;
-@@ -1141,15 +1157,20 @@ struct lttng_kernel_event_notifier *_lttng_event_notifier_create(
- event_name = event_desc->event_name;
- break;
-
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_UPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- event_name = event_notifier_param->event.name;
- break;
-
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- ret = -EINVAL;
-@@ -1296,9 +1317,12 @@ struct lttng_kernel_event_notifier *_lttng_event_notifier_create(
- WARN_ON_ONCE(!ret);
- break;
-
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- ret = -EINVAL;
-@@ -1423,14 +1447,18 @@ void register_event(struct lttng_kernel_event_recorder *event_recorder)
- ret = lttng_syscall_filter_enable_event(event_recorder->chan, event_recorder);
- break;
-
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_UPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_KRETPROBE:
- ret = 0;
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- }
-@@ -1481,7 +1509,8 @@ int _lttng_event_unregister(struct lttng_kernel_event_recorder *event_recorder)
- ret = 0;
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- }
-@@ -1512,14 +1541,18 @@ void register_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
- ret = lttng_syscall_filter_enable_event_notifier(event_notifier);
- break;
-
-- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KPROBE:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_UPROBE:
- ret = 0;
- break;
-
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- }
-@@ -1559,9 +1592,12 @@ int _lttng_event_notifier_unregister(
- ret = lttng_syscall_filter_disable_event_notifier(event_notifier);
- break;
-
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- }
-@@ -1614,8 +1650,10 @@ void _lttng_event_destroy(struct lttng_kernel_event_common *event)
- lttng_uprobes_destroy_event_private(event_recorder);
- break;
-
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- }
-@@ -1647,9 +1685,12 @@ void _lttng_event_destroy(struct lttng_kernel_event_common *event)
- lttng_uprobes_destroy_event_notifier_private(event_notifier);
- break;
-
-- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
-- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_KRETPROBE:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_FUNCTION:
-+ lttng_fallthrough;
-+ case LTTNG_KERNEL_ABI_NOOP:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- }
-@@ -2713,7 +2754,8 @@ void lttng_session_sync_event_enablers(struct lttng_kernel_session *session)
- int nr_filters = 0;
-
- switch (event_recorder_priv->parent.instrumentation) {
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- /* Enable events */
- list_for_each_entry(enabler_ref,
-@@ -2807,7 +2849,8 @@ void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group
- int nr_filters = 0, nr_captures = 0;
-
- switch (event_notifier_priv->parent.instrumentation) {
-- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
-+ case LTTNG_KERNEL_ABI_TRACEPOINT:
-+ lttng_fallthrough;
- case LTTNG_KERNEL_ABI_SYSCALL:
- /* Enable event_notifiers */
- list_for_each_entry(enabler_ref,
-@@ -3877,7 +3920,7 @@ int print_escaped_ctf_string(struct lttng_kernel_session *session, const char *s
- if (ret)
- goto error;
- /* We still print the current char */
-- /* Fallthrough */
-+ lttng_fallthrough;
- default:
- ret = lttng_metadata_printf(session, "%c", cur);
- break;
-diff --git a/src/lttng-string-utils.c b/src/lttng-string-utils.c
-index d9447903..65946193 100644
---- a/src/lttng-string-utils.c
-+++ b/src/lttng-string-utils.c
-@@ -4,6 +4,7 @@
- */
-
- #include <linux/types.h>
-+#include <wrapper/compiler_attributes.h>
-
- #include <lttng/string-utils.h>
-
-@@ -302,7 +303,7 @@ retry:
- p = pattern_get_char_at_cb(p_at,
- pattern_get_char_at_cb_data);
-
-- /* Fall-through. */
-+ lttng_fallthrough;
- default:
- /*
- * Default case which will compare the escaped
-diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c
-index 0fa6a1bf..1d0a5ecb 100644
---- a/src/probes/lttng-kretprobes.c
-+++ b/src/probes/lttng-kretprobes.c
-@@ -14,6 +14,7 @@
- #include <lttng/events.h>
- #include <lttng/events-internal.h>
- #include <ringbuffer/frontend_types.h>
-+#include <wrapper/compiler_attributes.h>
- #include <wrapper/vmalloc.h>
- #include <wrapper/irqflags.h>
- #include <lttng/tracer.h>
-@@ -61,7 +62,8 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
- return 0;
- break;
- }
-- case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */
-+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- }
-@@ -90,7 +92,8 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
- chan->ops->event_commit(&ctx);
- break;
- }
-- case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */
-+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
-+ lttng_fallthrough;
- default:
- WARN_ON_ONCE(1);
- }
---
-2.19.1
-
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch
new file mode 100644
index 0000000000..66c48ebe8f
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch
@@ -0,0 +1,81 @@
+From f4a6415f8d5fa447868d1fdc7119e0a328966379 Mon Sep 17 00:00:00 2001
+From: Kienan Stewart <kstewart@efficios.com>
+Date: Mon, 25 Mar 2024 10:30:32 -0400
+Subject: [PATCH 3/4] Fix: mm_compaction_migratepages changed in linux 6.9-rc1
+
+See upstream commit:
+
+ commit ab755bf4249b992fc2140d615ab0a686d50765b4
+ Author: Baolin Wang <baolin.wang@linux.alibaba.com>
+ Date: Tue Feb 20 14:16:31 2024 +0800
+
+ mm: compaction: update the cc->nr_migratepages when allocating or freeing the freepages
+
+ Currently we will use 'cc->nr_freepages >= cc->nr_migratepages' comparison
+ to ensure that enough freepages are isolated in isolate_freepages(),
+ however it just decreases the cc->nr_freepages without updating
+ cc->nr_migratepages in compaction_alloc(), which will waste more CPU
+ cycles and cause too many freepages to be isolated.
+
+ So we should also update the cc->nr_migratepages when allocating or
+ freeing the freepages to avoid isolating excess freepages. And I can see
+ fewer free pages are scanned and isolated when running thpcompact on my
+ Arm64 server:
+
+ k6.7 k6.7_patched
+ Ops Compaction pages isolated 120692036.00 118160797.00
+ Ops Compaction migrate scanned 131210329.00 154093268.00
+ Ops Compaction free scanned 1090587971.00 1080632536.00
+ Ops Compact scan efficiency 12.03 14.26
+
+ Moreover, I did not see an obvious latency improvements, this is likely
+ because isolating freepages is not the bottleneck in the thpcompact test
+ case.
+
+ k6.7 k6.7_patched
+ Amean fault-both-1 1089.76 ( 0.00%) 1080.16 * 0.88%*
+ Amean fault-both-3 1616.48 ( 0.00%) 1636.65 * -1.25%*
+ Amean fault-both-5 2266.66 ( 0.00%) 2219.20 * 2.09%*
+ Amean fault-both-7 2909.84 ( 0.00%) 2801.90 * 3.71%*
+ Amean fault-both-12 4861.26 ( 0.00%) 4733.25 * 2.63%*
+ Amean fault-both-18 7351.11 ( 0.00%) 6950.51 * 5.45%*
+ Amean fault-both-24 9059.30 ( 0.00%) 9159.99 * -1.11%*
+ Amean fault-both-30 10685.68 ( 0.00%) 11399.02 * -6.68%*
+
+Upstream-Status: Backport [175fe77c Fix: mm_compaction_migratepages changed in linux 6.9-rc1]
+
+Change-Id: I103a43fd1b549360b3fc978fd409b7c17ef3e192
+Signed-off-by: Kienan Stewart <kstewart@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ include/instrumentation/events/compaction.h | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+Index: lttng-modules-2.13.12/include/instrumentation/events/compaction.h
+===================================================================
+--- lttng-modules-2.13.12.orig/include/instrumentation/events/compaction.h
++++ lttng-modules-2.13.12/include/instrumentation/events/compaction.h
+@@ -97,7 +97,22 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(comp
+
+ #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */
+
+-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \
++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
++LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages,
++
++ compaction_migratepages,
++
++ TP_PROTO(unsigned int nr_migratepages,
++ unsigned int nr_succeeded),
++
++ TP_ARGS(nr_migratepages, nr_succeeded),
++
++ TP_FIELDS(
++ ctf_integer(unsigned long, nr_migrated, nr_succeeded)
++ ctf_integer(unsigned long, nr_failed, nr_migratepages - nr_succeeded)
++ )
++)
++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \
+ LTTNG_RHEL_KERNEL_RANGE(5,14,0,163,0,0, 5,15,0,0,0,0))
+ LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages,
+
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch
new file mode 100644
index 0000000000..59ef4f9313
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch
@@ -0,0 +1,57 @@
+From 217bc2e4685050dddce9bdd2557b64f6b8c16622 Mon Sep 17 00:00:00 2001
+From: Kienan Stewart <kstewart@efficios.com>
+Date: Mon, 25 Mar 2024 10:53:46 -0400
+Subject: [PATCH 4/4] Fix: dev_base_lock removed in linux 6.9-rc1
+
+See upstream commit:
+
+ commit 1b3ef46cb7f2618cc0b507393220a69810f6da12
+ Author: Eric Dumazet <edumazet@google.com>
+ Date: Tue Feb 13 06:32:45 2024 +0000
+
+ net: remove dev_base_lock
+
+ dev_base_lock is not needed anymore, all remaining users also hold RTNL.
+
+Upstream-Status: Backport [52eb2ee9 Fix: dev_base_lock removed in linux 6.9-rc1]
+
+Change-Id: I6b07e6eed07fd398302ca14d23162ed24d74df15
+Signed-off-by: Kienan Stewart <kstewart@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ src/lttng-statedump-impl.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+Index: lttng-modules-2.13.12/src/lttng-statedump-impl.c
+===================================================================
+--- lttng-modules-2.13.12.orig/src/lttng-statedump-impl.c
++++ lttng-modules-2.13.12/src/lttng-statedump-impl.c
+@@ -392,6 +392,20 @@ void lttng_enumerate_device(struct lttng
+ }
+ }
+
++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
++static
++int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session)
++{
++ struct net_device *dev;
++
++ rtnl_lock();
++ for_each_netdev(&init_net, dev)
++ lttng_enumerate_device(session, dev);
++ rtnl_unlock();
++
++ return 0;
++}
++#else
+ static
+ int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session)
+ {
+@@ -404,6 +418,7 @@ int lttng_enumerate_network_ip_interface
+
+ return 0;
+ }
++#endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) */
+ #else /* CONFIG_INET */
+ static inline
+ int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session)
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.12.bb
index 6dfde8dcad..95d5e2d615 100644
--- a/meta/recipes-kernel/lttng/lttng-modules_2.13.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.12.bb
@@ -2,7 +2,7 @@ SECTION = "devel"
SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
HOMEPAGE = "https://lttng.org/"
-LICENSE = "LGPLv2.1 & GPLv2 & MIT"
+LICENSE = "LGPL-2.1-only & GPL-2.0-only & MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=0464cff101a009c403cd2ed65d01d4c4"
inherit module
@@ -10,13 +10,16 @@ inherit module
include lttng-platforms.inc
SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
- file://0001-fix-cpu-hotplug-Remove-deprecated-CPU-hotplug-functi.patch \
- file://0002-fix-Revert-Makefile-Enable-Wimplicit-fallthrough-for.patch \
- "
+ file://0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch \
+ file://0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch \
+ file://0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch \
+ file://0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch \
+ "
+
# Use :append here so that the patch is applied also when using devupstream
SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch"
-SRC_URI[sha256sum] = "5ebf2b3cd128b3a1c8afaea1e98d5a6f7f0676fd524fcf72361c34d9dc603356"
+SRC_URI[sha256sum] = "d85fcb66c7bd31003ab8735e8c77700e5e4f417b4c22fe1f20112cf435abad79"
export INSTALL_MOD_DIR="kernel/lttng-modules"
@@ -37,11 +40,6 @@ python do_package:prepend() {
}
BBCLASSEXTEND = "devupstream:target"
-LIC_FILES_CHKSUM:class-devupstream = "file://LICENSE;md5=0464cff101a009c403cd2ed65d01d4c4"
-DEFAULT_PREFERENCE:class-devupstream = "-1"
-SRC_URI:class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.13"
-
-SRCREV:class-devupstream = "c570be0da77e963d77bac099d468bc0cd5f1bd63"
-PV:class-devupstream = "2.13.0+git${SRCPV}"
-S:class-devupstream = "${WORKDIR}/git"
+SRC_URI:class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.13;protocol=https"
+SRCREV:class-devupstream = "7584cfc04914cb0842a986e9808686858b9c8630"
SRCREV_FORMAT ?= "lttng_git"
diff --git a/meta/recipes-kernel/lttng/lttng-platforms.inc b/meta/recipes-kernel/lttng/lttng-platforms.inc
index 933c65d85d..900e36df82 100644
--- a/meta/recipes-kernel/lttng/lttng-platforms.inc
+++ b/meta/recipes-kernel/lttng/lttng-platforms.inc
@@ -15,3 +15,7 @@ LTTNGUST:arc = ""
COMPATIBLE_HOST:arc:pn-lttng-ust = "null"
+# Whether the platform supports lttng-tools
+# lttng-tools requires SYS_ppoll and SYS_pselect6 which are not supported on riscv32.
+# It's also turned off for riscv32 in meta-riscv. See https://github.com/riscv/meta-riscv/blob/master/conf/layer.conf
+COMPATIBLE_HOST:riscv32:pn-lttng-tools = "null"
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-Tests-race-condition-in-test_event_tracker.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-Tests-race-condition-in-test_event_tracker.patch
deleted file mode 100644
index 10020e1ecf..0000000000
--- a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-Tests-race-condition-in-test_event_tracker.patch
+++ /dev/null
@@ -1,221 +0,0 @@
-From d3392e4850532c02e53e3c3ff1cc27df7e51c941 Mon Sep 17 00:00:00 2001
-From: Francis Deslauriers <francis.deslauriers@efficios.com>
-Date: Tue, 7 Sep 2021 17:10:31 -0400
-Subject: [PATCH 1/2] Fix: Tests: race condition in test_event_tracker
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Background
-==========
-The `test_event_tracker` file contains test cases when the event
-generating app in executed in two distinct steps. Those two steps are
-preparation and execution.
- 1. the preparation is the launching the app in the background, and
- 2. the execution is actually generating the event that should or
- should not be traced depending on the test case.
-
-This is useful to test the tracker feature since we want to ensure that
-already running apps are notified properly when changing their tracking
-status.
-
-Issue
-=====
-The `test_event_vpid_track_untrack` test case suffers from a race
-condition that is easy to reproduce on Yocto.
-
-The issue is that sometimes events are end up the trace when none is
-expected.
-
-This is due to the absence of synchronization point at the launch of the
-app which leads to the app being scheduled in-between the track-untrack
-calls leading to events being recorded to the trace.
-
-It's easy to reproduce this issue on my machine by adding a `sleep 5`
-between the track and untrack calls and setting the `NR_USEC_WAIT`
-variable to 1.
-
-Fix
-===
-Using the testapp `--sync-before-last-event-touch` flag to make the app
-create a file when all but the last event are executed. We then have the
-app wait until we create a file (`--sync-before-last-event`) to generate
-that last event. This way, we are sure no event will be generated when
-running the track and untrack commands.
-
-Notes
-=====
-- This issue affects other test cases in this file.
-- This commit fixes a typo in the test header.
-- This commit adds `diag` calls to help tracking to what test the output
- relates to when reading the log.
-
-Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
-Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
-Change-Id: Ia2b68128dc9a805526f9748f31ec2c2d95566f31
-Upstream-Status: Backport
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- .../tools/tracker/test_event_tracker | 56 ++++++++++++++-----
- 1 file changed, 42 insertions(+), 14 deletions(-)
-
-diff --git a/tests/regression/tools/tracker/test_event_tracker b/tests/regression/tools/tracker/test_event_tracker
-index feb3787..cc0f698 100755
---- a/tests/regression/tools/tracker/test_event_tracker
-+++ b/tests/regression/tools/tracker/test_event_tracker
-@@ -5,7 +5,7 @@
- #
- # SPDX-License-Identifier: GPL-2.0-only
-
--TEST_DESC="LTTng - Event traker test"
-+TEST_DESC="LTTng - Event tracker test"
-
- CURDIR=$(dirname "$0")/
- TESTDIR="$CURDIR/../../.."
-@@ -15,7 +15,7 @@ TESTAPP_KERNEL_NAME="gen-kernel-test-events"
- TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
- TESTAPP_KERNEL_BIN="$TESTAPP_PATH/$TESTAPP_KERNEL_NAME/$TESTAPP_KERNEL_NAME"
- SESSION_NAME="tracker"
--NR_ITER=100
-+NR_ITER=1
- NUM_GLOBAL_TESTS=2
- NUM_UST_TESTS=283
- NUM_KERNEL_TESTS=462
-@@ -30,27 +30,41 @@ SCRIPT_GROUPNAME="$(id -gn)"
-
- CHILD_PID=-1
- WAIT_PATH=
--AFTER_FIRST_PATH=
--BEFORE_LAST_PATH=
-+TOUCH_BEFORE_LAST_PATH=
-+SYNC_BEFORE_LAST_PATH=
-
- source $TESTDIR/utils/utils.sh
-
-+# Launch the testapp and execute it up until right before the last event. It is
-+# useful to do it in two seperate steps in order to test tracking and
-+# untracking on an active app.
- function prepare_ust_app
- {
-- AFTER_FIRST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX)
-- BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX)
-+ TOUCH_BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_touch_before_last.XXXXXX)
-+ SYNC_BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX)
-+
-+ $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \
-+ --sync-before-last-event-touch "$TOUCH_BEFORE_LAST_PATH" \
-+ --sync-before-last-event "$SYNC_BEFORE_LAST_PATH" &
-
-- $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT -a "$AFTER_FIRST_PATH" -b "$BEFORE_LAST_PATH" &
- CHILD_PID=$!
-+
-+ # Wait for the app to execute all the way to right before the last
-+ # event.
-+ while [ ! -f "${TOUCH_BEFORE_LAST_PATH}" ]; do
-+ sleep 0.5
-+ done
- }
-
-+# Generate the last event.
- function trace_ust_app
- {
-- touch "$BEFORE_LAST_PATH"
-- wait
-+ # Ask the test app to generate the last event.
-+ touch "$SYNC_BEFORE_LAST_PATH"
-+ wait "$CHILD_PID"
- ok $? "Traced application stopped."
-- rm "$BEFORE_LAST_PATH"
-- rm "$AFTER_FIRST_PATH"
-+ rm "$SYNC_BEFORE_LAST_PATH"
-+ rm "$TOUCH_BEFORE_LAST_PATH"
- }
-
- function prepare_kernel_app
-@@ -64,7 +78,7 @@ function prepare_kernel_app
- function trace_kernel_app
- {
- touch "$WAIT_PATH"
-- wait
-+ wait "$CHILD_PID"
- ok $? "Traced application stopped."
- rm "$WAIT_PATH"
- }
-@@ -78,6 +92,8 @@ function test_event_tracker()
- local tracker="$4"
- local channel=''
-
-+ diag "${FUNCNAME[0]} $*"
-+
- trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-
- create_lttng_session_ok $SESSION_NAME "$trace_path"
-@@ -117,6 +133,8 @@ function test_event_vpid_tracker()
- local wildcard="$3"
- local channel=''
-
-+ diag "${FUNCNAME[0]} $*"
-+
- trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-
- create_lttng_session_ok $SESSION_NAME "$trace_path"
-@@ -160,6 +178,8 @@ function test_event_pid_tracker()
- local wildcard="$3"
- local channel=''
-
-+ diag "${FUNCNAME[0]} $*"
-+
- trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-
- create_lttng_session_ok $SESSION_NAME "$trace_path"
-@@ -203,6 +223,8 @@ function test_event_tracker_fail()
- local wildcard="$2"
- local tracker="$3"
-
-+ diag "${FUNCNAME[0]} $*"
-+
- trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-
- create_lttng_session_ok $SESSION_NAME "$trace_path"
-@@ -222,6 +244,8 @@ function test_event_track_untrack()
- local tracker="$4"
- local channel=''
-
-+ diag "${FUNCNAME[0]} $*"
-+
- trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-
- create_lttng_session_ok $SESSION_NAME "$trace_path"
-@@ -262,6 +286,8 @@ function test_event_vpid_track_untrack()
- local wildcard="$3"
- local channel=''
-
-+ diag "${FUNCNAME[0]} $*"
-+
- trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-
- create_lttng_session_ok $SESSION_NAME "$trace_path"
-@@ -302,6 +328,8 @@ function test_event_pid_track_untrack()
- local wildcard="$3"
- local channel=''
-
-+ diag "${FUNCNAME[0]} $*"
-+
- trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-
- create_lttng_session_ok $SESSION_NAME "$trace_path"
-@@ -336,9 +364,9 @@ function test_event_pid_track_untrack()
-
- function test_event_ust_vpid_untrack_snapshot()
- {
-- local trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-+ diag "${FUNCNAME[0]} $*"
-
-- diag "Test_event_ust_vpid_untrack_snapshot"
-+ local trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX)
-
- create_lttng_session_ok $SESSION_NAME "$trace_path" "--snapshot"
-
---
-2.20.1
-
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch
new file mode 100644
index 0000000000..3286dfb5c1
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch
@@ -0,0 +1,56 @@
+From 6b45c5f80d20e7bbf3d98c1fa17d2cf8716af3bb Mon Sep 17 00:00:00 2001
+From: Xiangyu Chen <xiangyu.chen@windriver.com>
+Date: Mon, 25 Mar 2024 18:20:14 +0800
+Subject: [PATCH] Fix: rotation-destroy-flush: fix session daemon abort if no
+ kernel module present
+
+Testing rotation-destroy-flush when no lttng kernel modules present, it would
+be failed with error message:
+
+ Error: Unable to load required module lttng-ring-buffer-client-discard
+ not ok 1 - Start session daemon
+ Failed test 'Start session daemon'
+ not ok 2 - Create session rotation_destroy_flush in -o /tmp/tmp.test_rot ...
+ ...
+
+This because test script that sets the LTTNG_ABORT_ON_ERROR environment
+variable. It's this environment variable that causes the sessiond to handle the
+kernel module loading failure as an abort rather than a warning.
+
+Using "check_skip_kernel_test" to detect whether the kernel module fails to
+load is expected or not. If the failure is expected, the script won't set that
+environment variable any more.
+
+Fixes: 3a174400
+("tests:add check_skip_kernel_test to check root user and lttng kernel modules")
+
+Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/12155]
+
+Change-Id: I371e9ba717613e2940186f710cf3cccd35baed6c
+Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
+---
+ .../ust/rotation-destroy-flush/test_rotation_destroy_flush | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
+index 669bcbc43..64161768f 100755
+--- a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
++++ b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush
+@@ -23,11 +23,11 @@ SIZE_LIMIT=$PAGE_SIZE
+ NR_ITER=10
+ NUM_TESTS=$((15*$NR_ITER))
+
+-# Ensure the daemons invoke abort on error.
+-export LTTNG_ABORT_ON_ERROR=1
+-
+ source $TESTDIR/utils/utils.sh
+
++# Ensure the daemons invoke abort on error.
++check_skip_kernel_test || export LTTNG_ABORT_ON_ERROR=1
++
+ # MUST set TESTDIR before calling those functions
+ function run_app()
+ {
+--
+2.25.1
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch
new file mode 100644
index 0000000000..4e21d1e9f1
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch
@@ -0,0 +1,74 @@
+From 74b3844737b03492756b4f896c938b504b069f14 Mon Sep 17 00:00:00 2001
+From: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+Date: Tue, 17 Jan 2023 16:57:35 -0500
+Subject: [PATCH] compat: off64_t is not defined by musl
+
+This helps compile with latest musl, where off64_t is not defined unless
+_LARGEFILE64_SOURCE is defined. On glibc, _LARGEFILE64_SOURCE is defined
+if _GNU_SOURCE is defined, so the problem is only seen with musl.
+
+Since the project uses AC_SYS_LARGEFILE, which from the autoconf doc:
+"arrange for 64-bit file offsets, known as large-file support."
+
+As such, it is safe to assume off_t is 64-bit wide. This is checked by a
+static_assert to catch any platform where autoconf would let a 32-bit
+off_t slip.
+
+Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/9268]
+Reported-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8
+---
+
+--- a/src/common/compat/compat-fcntl.c
++++ b/src/common/compat/compat-fcntl.c
+@@ -8,14 +8,17 @@
+ #define _LGPL_SOURCE
+ #include <common/compat/fcntl.h>
+ #include <common/macros.h>
++#include <common/bug.h>
++#include <stdint.h>
+ #include <unistd.h>
+
+ #ifdef __linux__
+
+ LTTNG_HIDDEN
+-int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
++int compat_sync_file_range(int fd, off_t offset, off_t nbytes,
+ unsigned int flags)
+ {
++ LTTNG_BUILD_BUG_ON(sizeof(off_t) != sizeof(int64_t));
+ #ifdef HAVE_SYNC_FILE_RANGE
+ return sync_file_range(fd, offset, nbytes, flags);
+ #else
+--- a/src/common/compat/fcntl.h
++++ b/src/common/compat/fcntl.h
+@@ -13,16 +13,12 @@
+
+ #include <common/compat/errno.h>
+
+-#if (defined(__CYGWIN__))
+-typedef long long off64_t;
+-#endif
+-
+ #if (defined(__FreeBSD__) || defined(__sun__))
+ typedef off64_t loff_t;
+ #endif
+
+ #ifdef __linux__
+-extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
++extern int compat_sync_file_range(int fd, off_t offset, off_t nbytes,
+ unsigned int flags);
+ #define lttng_sync_file_range(fd, offset, nbytes, flags) \
+ compat_sync_file_range(fd, offset, nbytes, flags)
+@@ -37,8 +33,8 @@ extern int compat_sync_file_range(int fd
+ #define SYNC_FILE_RANGE_WAIT_BEFORE 0
+ #define SYNC_FILE_RANGE_WRITE 0
+
+-static inline int lttng_sync_file_range(int fd, off64_t offset,
+- off64_t nbytes, unsigned int flags)
++static inline int lttng_sync_file_range(int fd, off_t offset,
++ off_t nbytes, unsigned int flags)
+ {
+ return -ENOSYS;
+ }
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-src-common-correct-header-location.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-src-common-correct-header-location.patch
deleted file mode 100644
index 925b51c3ce..0000000000
--- a/meta/recipes-kernel/lttng/lttng-tools/0001-src-common-correct-header-location.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 790ef313364d1f1efb6f283705bb324eea2979ba Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex@linutronix.de>
-Date: Sun, 5 Sep 2021 10:13:08 +0200
-Subject: [PATCH] src/common: correct header location
-
-sys/unistd.h is not guaranteed to exist, and does not with
-e.g. musl C library.
-
-Upstream-Status: Pending
-Signed-off-by: Alexander Kanavin <alex@linutronix.de>
----
- src/common/kernel-probe.c | 2 +-
- src/common/userspace-probe.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/common/kernel-probe.c b/src/common/kernel-probe.c
-index 2beb53f..44100bc 100644
---- a/src/common/kernel-probe.c
-+++ b/src/common/kernel-probe.c
-@@ -20,7 +20,7 @@
- #include <lttng/kernel-probe.h>
- #include <sys/stat.h>
- #include <sys/types.h>
--#include <sys/unistd.h>
-+#include <unistd.h>
-
- static
- int lttng_kernel_probe_location_address_serialize(
-diff --git a/src/common/userspace-probe.c b/src/common/userspace-probe.c
-index 67b0ee6..66afc6f 100644
---- a/src/common/userspace-probe.c
-+++ b/src/common/userspace-probe.c
-@@ -20,7 +20,7 @@
- #include <lttng/userspace-probe-internal.h>
- #include <sys/stat.h>
- #include <sys/types.h>
--#include <sys/unistd.h>
-+#include <unistd.h>
-
- static
- int lttng_userspace_probe_location_function_set_binary_fd_handle(
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch
new file mode 100644
index 0000000000..2671a1908e
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch
@@ -0,0 +1,1246 @@
+From cf558f802b259a33605fe0ede4d74ae2ff6be699 Mon Sep 17 00:00:00 2001
+From: Xiangyu Chen <xiangyu.chen@windriver.com>
+Date: Mon, 12 Feb 2024 09:23:54 -0500
+Subject: [PATCH] tests: add check_skip_kernel_test to check root user and
+ lttng kernel modules
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The current tests will run both userspace and kernel testing. Some of
+use cases only use lttng for one kind of tracing on an embedded
+device (e.g. userspace), so in this scenario, the kernel modules might
+not install to target rootfs, the test cases would be fail and exit.
+
+Add LTTNG_TOOLS_DISABLE_KERNEL_TESTS to skip the lttng kernel features
+test, this flag can be set via "make":
+
+ make check LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1
+
+When this flag was set, all kernel related testcases would be marked as
+SKIP in result.
+
+Since the the LTTNG_TOOLS_DISABLE_KERNEL_TESTS was checked in function
+check_skip_kernel_test, lots of testcases also need to check root
+permission, so merging the root permission checking into
+check_skip_kernel_test.
+
+Upstream-Status: Backport from
+[https://git.lttng.org/?p=lttng-tools.git;a=commit;h=3a1744008331a0604479d3d7461f77056fad3a64]
+
+Change-Id: I49a1f642a9869c21a69e0186c296fd917bd7b525
+Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
+Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
+Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+---
+ tests/destructive/metadata-regeneration | 8 +----
+ tests/perf/test_perf_raw.in | 8 +----
+ tests/regression/kernel/test_all_events | 8 +----
+ tests/regression/kernel/test_callstack | 8 +----
+ tests/regression/kernel/test_channel | 8 +----
+ tests/regression/kernel/test_clock_override | 8 +----
+ tests/regression/kernel/test_event_basic | 8 +----
+ tests/regression/kernel/test_kernel_function | 8 +----
+ tests/regression/kernel/test_lttng_logger | 8 +----
+ tests/regression/kernel/test_ns_contexts | 8 +----
+ .../regression/kernel/test_ns_contexts_change | 9 +----
+ .../kernel/test_rotation_destroy_flush | 8 +----
+ .../regression/kernel/test_select_poll_epoll | 8 +----
+ tests/regression/kernel/test_syscall | 8 +----
+ tests/regression/kernel/test_userspace_probe | 8 +----
+ tests/regression/tools/clear/test_kernel | 8 +----
+ .../tools/filtering/test_invalid_filter | 8 +----
+ .../tools/filtering/test_unsupported_op | 8 +----
+ .../tools/filtering/test_valid_filter | 8 +----
+ tests/regression/tools/health/test_health.sh | 10 ++----
+ tests/regression/tools/health/test_thread_ok | 9 +----
+ tests/regression/tools/live/test_kernel | 10 +++---
+ tests/regression/tools/live/test_lttng_kernel | 8 +----
+ tests/regression/tools/metadata/test_kernel | 8 +----
+ .../test_notification_kernel_buffer_usage | 36 +++++++++----------
+ .../test_notification_kernel_capture | 23 ++++++------
+ .../test_notification_kernel_error | 23 ++++++------
+ .../test_notification_kernel_instrumentation | 23 ++++++------
+ .../test_notification_kernel_syscall | 19 +++++-----
+ .../test_notification_kernel_userspace_probe | 20 +++++------
+ .../notification/test_notification_multi_app | 14 +++-----
+ ...test_notification_notifier_discarded_count | 9 +++--
+ .../tools/regen-metadata/test_kernel | 8 +----
+ .../tools/regen-statedump/test_kernel | 8 +----
+ tests/regression/tools/rotation/test_kernel | 8 +----
+ tests/regression/tools/snapshots/test_kernel | 8 +----
+ .../tools/snapshots/test_kernel_streaming | 8 +----
+ .../streaming/test_high_throughput_limits | 8 +----
+ tests/regression/tools/streaming/test_kernel | 8 +----
+ .../tools/tracker/test_event_tracker | 8 +----
+ .../tools/trigger/test_add_trigger_cli | 12 ++-----
+ .../tools/trigger/test_list_triggers_cli | 26 +++++---------
+ .../tools/wildcard/test_event_wildcard | 8 +----
+ .../test_relayd_working_directory | 4 +--
+ .../ust/namespaces/test_ns_contexts_change | 7 +---
+ tests/regression/ust/test_event_perf | 8 +----
+ tests/utils/utils.sh | 35 ++++++++++++++++++
+ 47 files changed, 166 insertions(+), 363 deletions(-)
+
+diff --git a/tests/destructive/metadata-regeneration b/tests/destructive/metadata-regeneration
+index b81e7af32..36b130d17 100755
+--- a/tests/destructive/metadata-regeneration
++++ b/tests/destructive/metadata-regeneration
+@@ -185,19 +185,13 @@ function test_ust_streaming ()
+ rm -f ${file_sync_before_last}
+ }
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+ if ! destructive_tests_enabled ; then
+ echo 'You need to set the LTTNG_ENABLE_DESTRUCTIVE_TESTS to "will-break-my-system" as argument to run this test'
+ echo 'Moreover, please make sure that ntp is not running while executing this test'
+ exit 0
+ fi
+
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test $NUM_TESTS "Skipping all tests." ||
+ {
+ start_lttng_relayd "-o $TRACE_PATH"
+ start_lttng_sessiond
+diff --git a/tests/perf/test_perf_raw.in b/tests/perf/test_perf_raw.in
+index f293ccd71..d35529a87 100644
+--- a/tests/perf/test_perf_raw.in
++++ b/tests/perf/test_perf_raw.in
+@@ -137,12 +137,6 @@ function test_kernel_raw()
+ rm -rf $TRACE_PATH
+ }
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+ # MUST set TESTDIR before calling those functions
+ plan_tests $NUM_TESTS
+
+@@ -154,7 +148,7 @@ have_libpfm
+
+ test_ust_raw
+
+-skip $isroot "Root access is needed for kernel testing, skipping." 9 ||
++check_skip_kernel_test 9 ||
+ {
+ modprobe lttng-test
+ test_kernel_raw
+diff --git a/tests/regression/kernel/test_all_events b/tests/regression/kernel/test_all_events
+index 2e20888df..044f9b65f 100755
+--- a/tests/regression/kernel/test_all_events
++++ b/tests/regression/kernel/test_all_events
+@@ -43,13 +43,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ start_lttng_sessiond
+diff --git a/tests/regression/kernel/test_callstack b/tests/regression/kernel/test_callstack
+index a4477fd7c..d8d6b5e0f 100755
+--- a/tests/regression/kernel/test_callstack
++++ b/tests/regression/kernel/test_callstack
+@@ -134,13 +134,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ start_lttng_sessiond
+diff --git a/tests/regression/kernel/test_channel b/tests/regression/kernel/test_channel
+index 9cc74c4e8..4c377bd2a 100755
+--- a/tests/regression/kernel/test_channel
++++ b/tests/regression/kernel/test_channel
+@@ -47,13 +47,7 @@ function test_channel_buffer_too_large()
+ plan_tests $NUM_TESTS
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ start_lttng_sessiond
+
+diff --git a/tests/regression/kernel/test_clock_override b/tests/regression/kernel/test_clock_override
+index 72892898b..48a3f926a 100755
+--- a/tests/regression/kernel/test_clock_override
++++ b/tests/regression/kernel/test_clock_override
+@@ -172,13 +172,7 @@ TESTS=(
+ TEST_COUNT=${#TESTS[@]}
+ i=0
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ trap signal_cleanup SIGTERM SIGINT
+diff --git a/tests/regression/kernel/test_event_basic b/tests/regression/kernel/test_event_basic
+index ac9ec0549..387e2f733 100755
+--- a/tests/regression/kernel/test_event_basic
++++ b/tests/regression/kernel/test_event_basic
+@@ -73,13 +73,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test $NUM_TESTS "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ start_lttng_sessiond
+diff --git a/tests/regression/kernel/test_kernel_function b/tests/regression/kernel/test_kernel_function
+index b1d5491fc..ea16cdeef 100755
+--- a/tests/regression/kernel/test_kernel_function
++++ b/tests/regression/kernel/test_kernel_function
+@@ -43,13 +43,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ start_lttng_sessiond_notap
+ validate_lttng_modules_present
+diff --git a/tests/regression/kernel/test_lttng_logger b/tests/regression/kernel/test_lttng_logger
+index b8f7ded82..00eaae823 100755
+--- a/tests/regression/kernel/test_lttng_logger
++++ b/tests/regression/kernel/test_lttng_logger
+@@ -110,13 +110,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ start_lttng_sessiond
+diff --git a/tests/regression/kernel/test_ns_contexts b/tests/regression/kernel/test_ns_contexts
+index 0c8718d78..59e2568f6 100755
+--- a/tests/regression/kernel/test_ns_contexts
++++ b/tests/regression/kernel/test_ns_contexts
+@@ -108,13 +108,7 @@ plan_tests $NUM_TESTS
+ print_test_banner "$TEST_DESC"
+
+
+-isroot=0
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0
+-
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0
+
+ system_has_ns=0
+ if [ -d "/proc/$$/ns" ]; then
+diff --git a/tests/regression/kernel/test_ns_contexts_change b/tests/regression/kernel/test_ns_contexts_change
+index 42a61276b..3f5e4eeab 100755
+--- a/tests/regression/kernel/test_ns_contexts_change
++++ b/tests/regression/kernel/test_ns_contexts_change
+@@ -162,14 +162,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-
+-isroot=0
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0
+-
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0
+
+ system_has_ns=0
+ if [ -d "/proc/$$/ns" ]; then
+diff --git a/tests/regression/kernel/test_rotation_destroy_flush b/tests/regression/kernel/test_rotation_destroy_flush
+index cb773d7df..0af514b49 100755
+--- a/tests/regression/kernel/test_rotation_destroy_flush
++++ b/tests/regression/kernel/test_rotation_destroy_flush
+@@ -120,13 +120,7 @@ TESTS=(
+ TEST_COUNT=${#TESTS[@]}
+ i=0
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ trap signal_cleanup SIGTERM SIGINT
+diff --git a/tests/regression/kernel/test_select_poll_epoll b/tests/regression/kernel/test_select_poll_epoll
+index d8245a0e7..20f0ef0ae 100755
+--- a/tests/regression/kernel/test_select_poll_epoll
++++ b/tests/regression/kernel/test_select_poll_epoll
+@@ -374,13 +374,7 @@ if test $? != 0; then
+ exit 0
+ fi
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+
+diff --git a/tests/regression/kernel/test_syscall b/tests/regression/kernel/test_syscall
+index 401a18a8d..219d94703 100755
+--- a/tests/regression/kernel/test_syscall
++++ b/tests/regression/kernel/test_syscall
+@@ -664,13 +664,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ start_lttng_sessiond
+diff --git a/tests/regression/kernel/test_userspace_probe b/tests/regression/kernel/test_userspace_probe
+index 1091ee65e..5d984d666 100755
+--- a/tests/regression/kernel/test_userspace_probe
++++ b/tests/regression/kernel/test_userspace_probe
+@@ -815,13 +815,7 @@ fi
+ plan_tests $NUM_TESTS
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ start_lttng_sessiond
+diff --git a/tests/regression/tools/clear/test_kernel b/tests/regression/tools/clear/test_kernel
+index 06fb1c368..48250a742 100755
+--- a/tests/regression/tools/clear/test_kernel
++++ b/tests/regression/tools/clear/test_kernel
+@@ -536,12 +536,6 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+ streaming_tests=(test_kernel_streaming
+ test_kernel_streaming_rotate_clear
+ test_kernel_streaming_clear_rotate
+@@ -563,7 +557,7 @@ snapshot_tests=(test_kernel_streaming_snapshot
+ test_kernel_local_snapshot
+ )
+
+-skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping kernel streaming tests." ||
+ {
+ trap signal_cleanup SIGTERM SIGINT
+
+diff --git a/tests/regression/tools/filtering/test_invalid_filter b/tests/regression/tools/filtering/test_invalid_filter
+index 7d9e524d9..8435e5546 100755
+--- a/tests/regression/tools/filtering/test_invalid_filter
++++ b/tests/regression/tools/filtering/test_invalid_filter
+@@ -168,13 +168,7 @@ done
+
+ test_bytecode_limit -u
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel invalid filter tests." $NUM_KERNEL_TESTS ||
++check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel invalid filter tests." ||
+ {
+ diag "Test kernel filters"
+ i=0
+diff --git a/tests/regression/tools/filtering/test_unsupported_op b/tests/regression/tools/filtering/test_unsupported_op
+index 299247a3c..91eb86d21 100755
+--- a/tests/regression/tools/filtering/test_unsupported_op
++++ b/tests/regression/tools/filtering/test_unsupported_op
+@@ -103,13 +103,7 @@ while [ "$i" -lt "$OP_COUNT" ]; do
+ let "i++"
+ done
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel unsupported filter operations tests." $NUM_KERNEL_TESTS ||
++check_skip_kernel_test $NUM_KERNEL_TESTS "Skipping kernel unsupported filter operations tests." ||
+ {
+ diag "Test kernel unsupported filter operations"
+
+diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter
+index e76ffa25f..1ba7c79bb 100755
+--- a/tests/regression/tools/filtering/test_valid_filter
++++ b/tests/regression/tools/filtering/test_valid_filter
+@@ -1452,13 +1452,7 @@ KERNEL_FILTERS=(
+
+ IFS=$OLDIFS
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel valid filter tests." $NUM_KERNEL_TESTS ||
++check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel valid filter tests." ||
+ {
+ diag "Test kernel valid filters"
+
+diff --git a/tests/regression/tools/health/test_health.sh b/tests/regression/tools/health/test_health.sh
+index b3d6419d2..68716e6b9 100644
+--- a/tests/regression/tools/health/test_health.sh
++++ b/tests/regression/tools/health/test_health.sh
+@@ -82,7 +82,7 @@ function test_health
+ diag "With UST consumer daemons"
+ enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME
+
+- skip $isroot "Root access is needed. Skipping kernel consumer health check test." "1" ||
++ check_skip_kernel_test "1" "Skipping kernel consumer health check test." ||
+ {
+ diag "With kernel consumer daemon"
+ lttng_enable_kernel_event $SESSION_NAME $KERNEL_EVENT_NAME $CHANNEL_NAME
+@@ -113,7 +113,7 @@ function test_health
+
+
+ if [ ${test_needs_root} -eq 1 ]; then
+- skip ${isroot} "Root access needed for test \"${test_thread_name}\"." "1" ||
++ check_skip_kernel_test "1" "Skipping \"${test_thread_name}\"." ||
+ {
+ report_errors "${test_thread_error_string}" "${test_relayd}"
+ }
+@@ -276,12 +276,6 @@ STDERR_PATH=$(mktemp --tmpdir tmp.test_health_stderr_path.XXXXXX)
+ TRACE_PATH=$(mktemp --tmpdir -d tmp.test_health_trace_path.XXXXXX)
+ HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_health_trace_path.XXXXXX)
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+ THREAD_COUNT=${#THREAD[@]}
+ i=0
+ while [ "$i" -lt "$THREAD_COUNT" ]; do
+diff --git a/tests/regression/tools/health/test_thread_ok b/tests/regression/tools/health/test_thread_ok
+index e84adb611..e5e23543f 100755
+--- a/tests/regression/tools/health/test_thread_ok
++++ b/tests/regression/tools/health/test_thread_ok
+@@ -67,7 +67,7 @@ function test_thread_ok
+ $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH}
+ report_errors
+
+- skip $isroot "Root access is needed. Skipping kernel consumer health check test." "5" ||
++ check_skip_kernel_test "5" "Skipping kernel consumer health check test." ||
+ {
+ diag "With kernel consumer daemon"
+ create_lttng_session_no_output $SESSION_NAME
+@@ -115,13 +115,6 @@ STDERR_PATH=$(mktemp --tmpdir tmp.test_thread_ok_stderr_path.XXXXXX)
+ TRACE_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX)
+ HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX)
+
+-# The manage kernel thread is only spawned if we are root
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+ test_thread_ok
+
+ rm -rf ${HEALTH_PATH}
+diff --git a/tests/regression/tools/live/test_kernel b/tests/regression/tools/live/test_kernel
+index b622b5214..fdaa09f0d 100755
+--- a/tests/regression/tools/live/test_kernel
++++ b/tests/regression/tools/live/test_kernel
+@@ -39,13 +39,11 @@ function clean_live_tracing()
+ rm -rf $TRACE_PATH
+ }
+
+-# Need root access for kernel tracing.
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- plan_skip_all "Root access is needed. Skipping all tests."
++check_skip_kernel_test &&
++{
++ plan_skip_all "Skipping all tests."
+ exit 0
+-fi
++}
+
+ modprobe lttng-test
+
+diff --git a/tests/regression/tools/live/test_lttng_kernel b/tests/regression/tools/live/test_lttng_kernel
+index a23d9373a..1b933648f 100755
+--- a/tests/regression/tools/live/test_lttng_kernel
++++ b/tests/regression/tools/live/test_lttng_kernel
+@@ -45,13 +45,7 @@ function clean_live_tracing()
+ }
+
+ # Need root access for kernel tracing.
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ modprobe lttng-test
+
+diff --git a/tests/regression/tools/metadata/test_kernel b/tests/regression/tools/metadata/test_kernel
+index 57cace6ea..26e95d93a 100755
+--- a/tests/regression/tools/metadata/test_kernel
++++ b/tests/regression/tools/metadata/test_kernel
+@@ -91,13 +91,7 @@ plan_tests $NUM_TESTS
+ print_test_banner "$TEST_DESC"
+
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel metadata tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping kernel metadata tests." ||
+ {
+ validate_lttng_modules_present
+ modprobe lttng-test
+diff --git a/tests/regression/tools/notification/test_notification_kernel_buffer_usage b/tests/regression/tools/notification/test_notification_kernel_buffer_usage
+index 76e69a77e..8fdaabb3e 100755
+--- a/tests/regression/tools/notification/test_notification_kernel_buffer_usage
++++ b/tests/regression/tools/notification/test_notification_kernel_buffer_usage
+@@ -60,29 +60,27 @@ function test_buffer_usage_notification
+ wait $APP_PID 2> /dev/null
+ }
+
+-if [ "$(id -u)" == "0" ]; then
+-
+- validate_lttng_modules_present
+-
++check_skip_kernel_test &&
++{
++ plan_skip_all "Skipping all tests."
++ rm -rf "$TEST_TMPDIR"
++ exit 0
++}
+
+- modprobe lttng-test
++validate_lttng_modules_present
+
+- # Used on sessiond launch.
+- LTTNG_SESSIOND_ENV_VARS="LTTNG_TESTPOINT_ENABLE=1 \
+- CONSUMER_PAUSE_PIPE_PATH=${TESTPOINT_PIPE_PATH} \
+- LD_PRELOAD=${TESTPOINT}"
+- start_lttng_sessiond_notap
++modprobe lttng-test
+
+- test_buffer_usage_notification
++# Used on sessiond launch.
++LTTNG_SESSIOND_ENV_VARS="LTTNG_TESTPOINT_ENABLE=1 \
++ CONSUMER_PAUSE_PIPE_PATH=${TESTPOINT_PIPE_PATH} \
++ LD_PRELOAD=${TESTPOINT}"
++start_lttng_sessiond_notap
+
+- stop_lttng_sessiond_notap
+- rmmod lttng-test
++test_buffer_usage_notification
+
+- rm -rf "${consumerd_pipe[@]}" 2> /dev/null
+-else
+- # Kernel tests are skipped.
+- plan_tests $NUM_TESTS
+- skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
+-fi
++stop_lttng_sessiond_notap
++rmmod lttng-test
+
++rm -rf "${consumerd_pipe[@]}" 2> /dev/null
+ rm -rf "$TEST_TMPDIR"
+diff --git a/tests/regression/tools/notification/test_notification_kernel_capture b/tests/regression/tools/notification/test_notification_kernel_capture
+index 88f123d3d..0f8a2bc6f 100755
+--- a/tests/regression/tools/notification/test_notification_kernel_capture
++++ b/tests/regression/tools/notification/test_notification_kernel_capture
+@@ -31,22 +31,21 @@ function test_basic_error_path
+ }
+
+
+-if [ "$(id -u)" == "0" ]; then
+- validate_lttng_modules_present
++check_skip_kernel_test &&
++{
++ plan_skip_all "Skipping all tests."
++ exit 0
++}
+
+- modprobe lttng-test
++validate_lttng_modules_present
+
+- start_lttng_sessiond_notap
++modprobe lttng-test
+
+- test_basic_error_path
++start_lttng_sessiond_notap
+
+- stop_lttng_sessiond_notap
+- rmmod lttng-test
++test_basic_error_path
+
+-else
+- # Kernel tests are skipped.
+- plan_tests $NUM_TESTS
+- skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
+-fi
++stop_lttng_sessiond_notap
++rmmod lttng-test
+
+ rm -f "$TESTAPP_STATE_PATH"
+diff --git a/tests/regression/tools/notification/test_notification_kernel_error b/tests/regression/tools/notification/test_notification_kernel_error
+index 80fe6e5b5..b757ec2b4 100755
+--- a/tests/regression/tools/notification/test_notification_kernel_error
++++ b/tests/regression/tools/notification/test_notification_kernel_error
+@@ -30,23 +30,22 @@ function test_basic_error_path
+ wait $APP_PID 2> /dev/null
+ }
+
++check_skip_kernel_test &&
++{
++ plan_skip_all "Skipping all tests."
++ exit 0
++}
+
+-if [ "$(id -u)" == "0" ]; then
+- validate_lttng_modules_present
++validate_lttng_modules_present
+
+- modprobe lttng-test
++modprobe lttng-test
+
+- start_lttng_sessiond_notap
++start_lttng_sessiond_notap
+
+- test_basic_error_path
++test_basic_error_path
+
+- stop_lttng_sessiond_notap
+- rmmod lttng-test
++stop_lttng_sessiond_notap
++rmmod lttng-test
+
+-else
+- # Kernel tests are skipped.
+- plan_tests $NUM_TESTS
+- skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
+-fi
+
+ rm -f "$TESTAPP_STATE_PATH"
+diff --git a/tests/regression/tools/notification/test_notification_kernel_instrumentation b/tests/regression/tools/notification/test_notification_kernel_instrumentation
+index 90545a541..705f7703d 100755
+--- a/tests/regression/tools/notification/test_notification_kernel_instrumentation
++++ b/tests/regression/tools/notification/test_notification_kernel_instrumentation
+@@ -28,22 +28,21 @@ function test_kernel_instrumentation_notification
+ wait $APP_PID 2> /dev/null
+ }
+
+-if [ "$(id -u)" == "0" ]; then
+- validate_lttng_modules_present
++check_skip_kernel_test &&
++{
++ plan_skip_all "Skipping all tests."
++ exit 0
++}
+
+- modprobe lttng-test
++validate_lttng_modules_present
+
+- start_lttng_sessiond_notap
++modprobe lttng-test
+
+- test_kernel_instrumentation_notification
++start_lttng_sessiond_notap
+
+- stop_lttng_sessiond_notap
+- rmmod lttng-test
++test_kernel_instrumentation_notification
+
+-else
+- # Kernel tests are skipped.
+- plan_tests $NUM_TESTS
+- skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
+-fi
++stop_lttng_sessiond_notap
++rmmod lttng-test
+
+ rm -f "$TESTAPP_STATE_PATH"
+diff --git a/tests/regression/tools/notification/test_notification_kernel_syscall b/tests/regression/tools/notification/test_notification_kernel_syscall
+index d273cb55d..7fa235388 100755
+--- a/tests/regression/tools/notification/test_notification_kernel_syscall
++++ b/tests/regression/tools/notification/test_notification_kernel_syscall
+@@ -31,19 +31,18 @@ function test_kernel_syscall_notification
+ wait $APP_PID 2> /dev/null
+ }
+
+-if [ "$(id -u)" == "0" ]; then
+- validate_lttng_modules_present
++check_skip_kernel_test &&
++{
++ plan_skip_all "Skipping all tests."
++ exit 0
++}
+
+- start_lttng_sessiond_notap
++validate_lttng_modules_present
+
+- test_kernel_syscall_notification
++start_lttng_sessiond_notap
+
+- stop_lttng_sessiond_notap
++test_kernel_syscall_notification
+
+-else
+- # Kernel tests are skipped.
+- plan_tests $NUM_TESTS
+- skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
+-fi
++stop_lttng_sessiond_notap
+
+ rm -f "$TESTAPP_STATE_PATH"
+diff --git a/tests/regression/tools/notification/test_notification_kernel_userspace_probe b/tests/regression/tools/notification/test_notification_kernel_userspace_probe
+index 8ef8d708d..abddd9be7 100755
+--- a/tests/regression/tools/notification/test_notification_kernel_userspace_probe
++++ b/tests/regression/tools/notification/test_notification_kernel_userspace_probe
+@@ -29,18 +29,18 @@ function test_kernel_userspace_probe_notification
+ wait $APP_PID 2> /dev/null
+ }
+
+-if [ "$(id -u)" == "0" ]; then
+- validate_lttng_modules_present
++check_skip_kernel_test &&
++{
++ plan_skip_all "Skipping all tests."
++ exit 0
++}
++
++validate_lttng_modules_present
+
+- start_lttng_sessiond_notap
++start_lttng_sessiond_notap
+
+- test_kernel_userspace_probe_notification
++test_kernel_userspace_probe_notification
+
+- stop_lttng_sessiond_notap
+-else
+- # Kernel tests are skipped.
+- plan_tests $NUM_TESTS
+- skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
+-fi
++stop_lttng_sessiond_notap
+
+ rm -f "$TESTAPP_STATE_PATH"
+diff --git a/tests/regression/tools/notification/test_notification_multi_app b/tests/regression/tools/notification/test_notification_multi_app
+index d8b639225..61891b56f 100755
+--- a/tests/regression/tools/notification/test_notification_multi_app
++++ b/tests/regression/tools/notification/test_notification_multi_app
+@@ -411,22 +411,18 @@ function test_on_register_evaluation ()
+ rm -rf "$output_dir"
+ }
+
+-
+ TESTS=(
+ test_multi_app_ust
+ test_on_register_evaluation_ust
+ )
+
+-if [ "$(id -u)" == "0" ]; then
++check_skip_kernel_test "$NUM_TEST_KERNEL" "Skipping kernel multi-app notification tests." || {
+ validate_lttng_modules_present
+ TESTS+=(
+- test_multi_app_kernel
+- test_on_register_evaluation_kernel
+-)
+-else
+- skip 0 "Root access is needed. Skipping all kernel multi-app notification tests." $NUM_TEST_KERNEL
+-fi
+-
++ test_multi_app_kernel
++ test_on_register_evaluation_kernel
++ )
++}
+
+ for fct_test in ${TESTS[@]};
+ do
+diff --git a/tests/regression/tools/notification/test_notification_notifier_discarded_count b/tests/regression/tools/notification/test_notification_notifier_discarded_count
+index c9235393e..a6c31a728 100755
+--- a/tests/regression/tools/notification/test_notification_notifier_discarded_count
++++ b/tests/regression/tools/notification/test_notification_notifier_discarded_count
+@@ -391,7 +391,8 @@ function test_ust_notifier_discarded_regardless_trigger_owner
+ test_ust_notifier_discarded_count
+ test_ust_notifier_discarded_count_max_bucket
+
+-if [ "$(id -u)" == "0" ]; then
++check_skip_kernel_test "$KERNEL_NUM_TESTS" "Skipping kernel notification tests." ||
++{
+
+ validate_lttng_modules_present
+
+@@ -413,9 +414,7 @@ if [ "$(id -u)" == "0" ]; then
+ modprobe --remove lttng-test
+
+ rm -rf "${sessiond_pipe[@]}" 2> /dev/null
+-else
+- # Kernel tests are skipped.
+- skip 0 "Root access is needed. Skipping all kernel notification tests." $KERNEL_NUM_TESTS
+-fi
++
++}
+
+ rm -rf "$TEST_TMPDIR"
+diff --git a/tests/regression/tools/regen-metadata/test_kernel b/tests/regression/tools/regen-metadata/test_kernel
+index 49eea32a7..555a4e2ce 100755
+--- a/tests/regression/tools/regen-metadata/test_kernel
++++ b/tests/regression/tools/regen-metadata/test_kernel
+@@ -99,13 +99,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+
+diff --git a/tests/regression/tools/regen-statedump/test_kernel b/tests/regression/tools/regen-statedump/test_kernel
+index 8a261355d..bbbac3942 100755
+--- a/tests/regression/tools/regen-statedump/test_kernel
++++ b/tests/regression/tools/regen-statedump/test_kernel
+@@ -39,13 +39,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+ start_lttng_sessiond
+diff --git a/tests/regression/tools/rotation/test_kernel b/tests/regression/tools/rotation/test_kernel
+index f5f1f5553..efe3fd359 100755
+--- a/tests/regression/tools/rotation/test_kernel
++++ b/tests/regression/tools/rotation/test_kernel
+@@ -82,13 +82,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+
+diff --git a/tests/regression/tools/snapshots/test_kernel b/tests/regression/tools/snapshots/test_kernel
+index abb243563..d91876867 100755
+--- a/tests/regression/tools/snapshots/test_kernel
++++ b/tests/regression/tools/snapshots/test_kernel
+@@ -217,13 +217,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel snapshot tests" $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+
+ validate_lttng_modules_present
+diff --git a/tests/regression/tools/snapshots/test_kernel_streaming b/tests/regression/tools/snapshots/test_kernel_streaming
+index 0c92dc710..dd965afee 100755
+--- a/tests/regression/tools/snapshots/test_kernel_streaming
++++ b/tests/regression/tools/snapshots/test_kernel_streaming
+@@ -145,13 +145,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel streaming tests" $NUM_TESTS ||
++check_skip_kernel_test $NUM_TESTS "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+
+diff --git a/tests/regression/tools/streaming/test_high_throughput_limits b/tests/regression/tools/streaming/test_high_throughput_limits
+index 2b9e3ad39..c55d51098 100755
+--- a/tests/regression/tools/streaming/test_high_throughput_limits
++++ b/tests/regression/tools/streaming/test_high_throughput_limits
+@@ -170,13 +170,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed to set bandwith limits. Skipping all tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+
+ # Catch sigint and try to cleanup limits
+diff --git a/tests/regression/tools/streaming/test_kernel b/tests/regression/tools/streaming/test_kernel
+index 33334229f..113eea7bf 100755
+--- a/tests/regression/tools/streaming/test_kernel
++++ b/tests/regression/tools/streaming/test_kernel
+@@ -47,13 +47,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS ||
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
+ {
+ validate_lttng_modules_present
+
+diff --git a/tests/regression/tools/tracker/test_event_tracker b/tests/regression/tools/tracker/test_event_tracker
+index cc0f698d2..de0c79d36 100755
+--- a/tests/regression/tools/tracker/test_event_tracker
++++ b/tests/regression/tools/tracker/test_event_tracker
+@@ -466,13 +466,7 @@ test_event_track_untrack ust 0 "${EVENT_NAME}" "--pid --all" # backward compat
+ test_event_tracker ust 1 "${EVENT_NAME}" "--pid --all" # backward compat
+ test_event_pid_tracker ust 1 "${EVENT_NAME}"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel tracker tests." $NUM_KERNEL_TESTS ||
++check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel tracker tests." ||
+ {
+ diag "Test kernel tracker"
+
+diff --git a/tests/regression/tools/trigger/test_add_trigger_cli b/tests/regression/tools/trigger/test_add_trigger_cli
+index 98ecf6272..d1763aa2e 100755
+--- a/tests/regression/tools/trigger/test_add_trigger_cli
++++ b/tests/regression/tools/trigger/test_add_trigger_cli
+@@ -34,12 +34,6 @@ tmp_stdout=$(mktemp --tmpdir -t test_parse_cli_trigger_stdout.XXXXXX)
+ tmp_stderr=$(mktemp --tmpdir -t test_parse_cli_trigger_stderr.XXXXXX)
+ uprobe_elf_binary="${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary"
+
+-if [ "$(id -u)" == "0" ]; then
+- ist_root=1
+-else
+- ist_root=0
+-fi
+-
+ function test_success ()
+ {
+ local test_name="$1"
+@@ -223,7 +217,7 @@ test_success "--exclude-name two" "trigger5" \
+ --condition event-rule-matches --type=user --name='jean-*' --exclude-name jean-chretien -x jean-charest \
+ --action notify
+
+-skip $ist_root "non-root user: skipping kprobe tests" 18 || {
++check_skip_kernel_test 18 "Skipping kprobe tests." || {
+ i=0
+
+ for type in kprobe kernel:kprobe; do
+@@ -262,7 +256,7 @@ skip $ist_root "non-root user: skipping kprobe tests" 18 || {
+ done
+ }
+
+-skip $ist_root "non-root user: skipping uprobe tests" 6 || {
++check_skip_kernel_test 6 "Skipping uprobe tests." || {
+ test_success "--condition event-rule-matches uprobe" "uprobe-trigger-0" \
+ --name="uprobe-trigger-0" \
+ --condition event-rule-matches --type=kernel:uprobe --location=${uprobe_elf_binary}:test_function --event-name=ma-probe \
+@@ -274,7 +268,7 @@ skip $ist_root "non-root user: skipping uprobe tests" 6 || {
+ --action notify
+ }
+
+-skip $ist_root "non-root user: skipping syscall tests" 30 || {
++check_skip_kernel_test 30 "Skipping syscall tests." || {
+ test_success "--condition event-rule-matches one syscall" "syscall-trigger-0" \
+ --name="syscall-trigger-0" \
+ --condition event-rule-matches --type=syscall --name=open \
+diff --git a/tests/regression/tools/trigger/test_list_triggers_cli b/tests/regression/tools/trigger/test_list_triggers_cli
+index a04018013..02c3de3e9 100755
+--- a/tests/regression/tools/trigger/test_list_triggers_cli
++++ b/tests/regression/tools/trigger/test_list_triggers_cli
+@@ -36,22 +36,12 @@ uprobe_sdt_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-sdt-binar
+ register_some_triggers_bin=$(realpath "${CURDIR}/utils/register-some-triggers")
+
+ uid=$(id --user)
+-gid=$(id --group)
+
+-if [ "$uid" == "0" ]; then
+- ist_root=1
+- ls "$uprobe_sdt_binary" >/dev/null 2>&1
+- if test $? == 0; then
+- hast_sdt_binary=1
+- else
+- hast_sdt_binary=0
+- fi
+-else
+- ist_root=0
+- hast_sdt_binary=0
++sdt_binary_present=0
++if [ -f "$uprobe_sdt_binary" ]; then
++ sdt_binary_present=1
+ fi
+
+-
+ test_top_level_options ()
+ {
+ diag "Listing top level options"
+@@ -2695,10 +2685,12 @@ start_lttng_sessiond_notap
+
+ test_top_level_options
+ test_event_rule_matches_tracepoint
+-skip $ist_root "non-root user: skipping kprobe tests" 13 || test_event_rule_matches_probe
+-skip $ist_root "non-root user: skipping uprobe tests" 9 || test_event_rule_matches_userspace_probe_elf
+-skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt
+-skip $ist_root "non-root user: skipping syscall tests" 17 || test_event_rule_matches_syscall
++check_skip_kernel_test 48 "Skipping kprobe, uprobe, SDT and syscall tests." || {
++ test_event_rule_matches_probe
++ test_event_rule_matches_userspace_probe_elf
++ skip $sdt_binary_present "No SDT binary. Skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt
++ test_event_rule_matches_syscall
++}
+ test_session_consumed_size_condition
+ test_buffer_usage_conditions
+ test_session_rotation_conditions
+diff --git a/tests/regression/tools/wildcard/test_event_wildcard b/tests/regression/tools/wildcard/test_event_wildcard
+index f69baffc4..14d9bb88a 100755
+--- a/tests/regression/tools/wildcard/test_event_wildcard
++++ b/tests/regression/tools/wildcard/test_event_wildcard
+@@ -124,13 +124,7 @@ test_event_wildcard ust 1 'tp*tptest'
+ test_event_wildcard ust 1 'tp**tptest'
+ test_event_wildcard ust 1 'tp*test'
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all kernel wildcard tests." $NUM_KERNEL_TESTS ||
++check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel wildcard tests." ||
+ {
+ diag "Test kernel wildcards"
+
+diff --git a/tests/regression/tools/working-directory/test_relayd_working_directory b/tests/regression/tools/working-directory/test_relayd_working_directory
+index c7e784cca..6bd1e504a 100755
+--- a/tests/regression/tools/working-directory/test_relayd_working_directory
++++ b/tests/regression/tools/working-directory/test_relayd_working_directory
+@@ -145,9 +145,9 @@ function test_relayd_debug_permission()
+ diag "Test lttng-relayd change working directory on non writable directory"
+
+ if [ "$(id -u)" == "0" ]; then
+- is_user=0
++ is_user=0
+ else
+- is_user=1
++ is_user=1
+ fi
+
+ skip $is_user "Skipping permission debug output test; operation can't fail as root" 6 ||
+diff --git a/tests/regression/ust/namespaces/test_ns_contexts_change b/tests/regression/ust/namespaces/test_ns_contexts_change
+index 8a4b62ce3..622241f7b 100755
+--- a/tests/regression/ust/namespaces/test_ns_contexts_change
++++ b/tests/regression/ust/namespaces/test_ns_contexts_change
+@@ -101,12 +101,7 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-isroot=0
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-fi
+-
+-skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0
++check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0
+
+ system_has_ns=0
+ if [ -d "/proc/$$/ns" ]; then
+diff --git a/tests/regression/ust/test_event_perf b/tests/regression/ust/test_event_perf
+index 33aab2981..178959a19 100755
+--- a/tests/regression/ust/test_event_perf
++++ b/tests/regression/ust/test_event_perf
+@@ -119,17 +119,11 @@ plan_tests $NUM_TESTS
+
+ print_test_banner "$TEST_DESC"
+
+-if [ "$(id -u)" == "0" ]; then
+- isroot=1
+-else
+- isroot=0
+-fi
+-
+ start_lttng_sessiond
+
+ test_parsing_raw
+
+-skip $isroot "Root access is needed. Skipping UST perf tests." 8 ||
++check_skip_kernel_test 8 "Skipping UST perf tests." ||
+ {
+ test_event_basic
+ }
+diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh
+index faa87e783..da0e0569d 100644
+--- a/tests/utils/utils.sh
++++ b/tests/utils/utils.sh
+@@ -318,6 +318,41 @@ function conf_proc_count()
+ echo
+ }
+
++# Usage:
++# check_skip_kernel_test [NB_TESTS] [SKIP_MESSAGE]
++# Return 0 if LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set or the current user is not a root user
++# If NB_TESTS is set, call skip() to skip number of tests.
++# If NB_TESTS is empty, just output a reason with diag.
++# An optional message can be added.
++
++function check_skip_kernel_test ()
++{
++ local num_tests="$1"
++ local skip_message="$2"
++
++ # Check for skip test kernel flag
++ if [ "$LTTNG_TOOLS_DISABLE_KERNEL_TESTS" == "1" ]; then
++ if ! test -z "$num_tests"; then
++ skip 0 "LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set.${skip_message+ }${skip_message}" "$num_tests"
++ else
++ diag "LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set.${skip_message+ }${skip_message}"
++ fi
++ return 0
++ fi
++
++ # Check if we are running as root
++ if [ "$(id -u)" != "0" ]; then
++ if ! test -z "$num_tests"; then
++ skip 0 "Root access is needed for kernel testing.${skip_message+ }${skip_message}" "$num_tests"
++ else
++ diag "Root access is needed for kernel testing.${skip_message+ }${skip_message}"
++ fi
++ return 0
++ fi
++
++ return 1
++}
++
+ # Check if base lttng-modules are present.
+ # Bail out on failure
+ function validate_lttng_modules_present ()
+--
+2.25.1
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch
index 2d08b08879..2f95889c4b 100644
--- a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch
+++ b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch
@@ -1,4 +1,4 @@
-From ab238c213fac190972f55e73cf3e0bb1c7846eb8 Mon Sep 17 00:00:00 2001
+From 2237748af00467ad8250a7ccd944200f811db69a Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Thu, 12 Dec 2019 16:52:07 +0100
Subject: [PATCH] tests: do not strip a helper library
@@ -10,10 +10,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
-index 03f5d5a..d12c343 100644
+index 836f13e..e19a554 100644
--- a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
+++ b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
-@@ -12,7 +12,7 @@ userspace_probe_elf_binary_LDADD = libfoo.la
+@@ -14,7 +14,7 @@ userspace_probe_elf_binary_LDADD = libfoo.la
libfoo.strip: libfoo.la
$(OBJCOPY) --strip-all .libs/libfoo.so
@@ -22,6 +22,3 @@ index 03f5d5a..d12c343 100644
@if [ x"$(srcdir)" != x"$(builddir)" ]; then \
for script in $(EXTRA_DIST); do \
cp -f $(srcdir)/$$script $(builddir); \
---
-2.17.1
-
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch b/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch
deleted file mode 100644
index a8d983105a..0000000000
--- a/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From d284752e616dfc4c9288be3bb21c04ea78cdd967 Mon Sep 17 00:00:00 2001
-From: Francis Deslauriers <francis.deslauriers@efficios.com>
-Date: Wed, 8 Sep 2021 10:16:23 -0400
-Subject: [PATCH 2/2] Fix: Tests: race condition in test_ns_contexts_change
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Issue
-=====
-The test script doesn't wait for the test application to complete before
-stopping the tracing session. The race is that depending on the
-scheduling the application is not always done generating events when the
-session is stopped.
-
-Fix
-===
-Make the test script wait for the termination of the test app before
-stopping the session.
-
-Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
-Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
-Change-Id: I29d9b41d2a2ed60a6c42020509c2067442ae332c
-Upstream-Status: Backport
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- tests/regression/ust/namespaces/test_ns_contexts_change | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/tests/regression/ust/namespaces/test_ns_contexts_change b/tests/regression/ust/namespaces/test_ns_contexts_change
-index c0af15e..8a4b62c 100755
---- a/tests/regression/ust/namespaces/test_ns_contexts_change
-+++ b/tests/regression/ust/namespaces/test_ns_contexts_change
-@@ -79,6 +79,9 @@ function test_ns()
-
- touch "$file_sync_before_last"
-
-+ # Wait for the test app to generate all expected events and exit.
-+ wait $app_pid
-+
- # stop and destroy
- stop_lttng_tracing_ok "$session_name"
- destroy_lttng_session_ok "$session_name"
---
-2.20.1
-
diff --git a/meta/recipes-kernel/lttng/lttng-tools/determinism.patch b/meta/recipes-kernel/lttng/lttng-tools/determinism.patch
deleted file mode 100644
index b2ab880bd6..0000000000
--- a/meta/recipes-kernel/lttng/lttng-tools/determinism.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-This is a bit ugly. Specifing abs_builddir as an RPATH is plain wrong when
-cross compiling. Sadly, removing the rpath makes libtool/automake do
-weird things and breaks the build as shared libs are no longer generated.
-
-We already try and delete the RPATH at do_install with chrpath however
-that does leave the path in the string table so it doesn't help us
-with reproducibility.
-
-Instead, hack in a bogus but harmless path, then delete it later in
-our do_install. Ultimately we may want to pass a specific path to use
-to configure if we really do need to set an RPATH at all. It is unclear
-to me whether the tests need that or not.
-
-Fixes reproducibility issues for lttng-tools.
-
-Upstream-Status: Pending [needs discussion with upstream about the correct solution]
-RP 2021/3/1
-
-Index: lttng-tools-2.12.2/tests/regression/ust/ust-dl/Makefile.am
-===================================================================
---- lttng-tools-2.12.2.orig/tests/regression/ust/ust-dl/Makefile.am
-+++ lttng-tools-2.12.2/tests/regression/ust/ust-dl/Makefile.am
-@@ -27,16 +27,16 @@ noinst_LTLIBRARIES = libzzz.la libbar.la
-
- libzzz_la_SOURCES = libzzz.c libzzz.h
- libzzz_la_LDFLAGS = -module -shared -avoid-version \
-- -rpath $(abs_builddir)
-+ -rpath /usr/lib
-
- libbar_la_SOURCES = libbar.c libbar.h
- libbar_la_LDFLAGS = -module -shared -avoid-version \
-- -rpath $(abs_builddir)
-+ -rpath /usr/lib
- libbar_la_LIBADD = libzzz.la
-
- libfoo_la_SOURCES = libfoo.c libfoo.h
- libfoo_la_LDFLAGS = -module -shared -avoid-version \
-- -rpath $(abs_builddir)
-+ -rpath /usr/lib
- libfoo_la_LIBADD = libbar.la
-
- CLEANFILES = libfoo.so libfoo.so.debug libbar.so libbar.so.debug \
-@@ -44,7 +44,7 @@ CLEANFILES = libfoo.so libfoo.so.debug l
-
- libtp_la_SOURCES = libbar-tp.h libbar-tp.c libfoo-tp.h libfoo-tp.c \
- libzzz-tp.h libzzz-tp.c
--libtp_la_LDFLAGS = -module -shared -rpath $(abs_builddir)
-+libtp_la_LDFLAGS = -module -shared -rpath /usr/lib
-
- # Extract debug symbols
- libfoo.so.debug: libfoo.la
-Index: lttng-tools-2.12.2/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
-===================================================================
---- lttng-tools-2.12.2.orig/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
-+++ lttng-tools-2.12.2/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am
-@@ -5,7 +5,7 @@ AM_CFLAGS += -O0
- noinst_LTLIBRARIES = libfoo.la
-
- libfoo_la_SOURCES = foo.c foo.h
--libfoo_la_LDFLAGS = -shared -module -avoid-version -rpath $(abs_builddir)/.libs/
-+libfoo_la_LDFLAGS = -shared -module -avoid-version -rpath /usr/lib
-
- noinst_PROGRAMS = userspace-probe-elf-binary
- userspace_probe_elf_binary_SOURCES = userspace-probe-elf-binary.c
diff --git a/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch b/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch
new file mode 100644
index 0000000000..3a77ea2e43
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Inappropriate [need to root cause the test hangs]
+
+We keep seeing hangs in the tools/notifications tests on x86 and arm for
+a variety of distros. Exclude them for now to work out if this is the
+only place we see them and give SWAT/triage a break from the stream
+of them.
+
+https://bugzilla.yoctoproject.org/show_bug.cgi?id=14263
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: lttng-tools-2.13.1/tests/regression/Makefile.am
+===================================================================
+--- lttng-tools-2.13.1.orig/tests/regression/Makefile.am
++++ lttng-tools-2.13.1/tests/regression/Makefile.am
+@@ -29,18 +29,6 @@ TESTS = tools/base-path/test_ust \
+ tools/crash/test_crash \
+ tools/regen-metadata/test_ust \
+ tools/regen-statedump/test_ust \
+- tools/notification/test_notification_ust_error \
+- tools/notification/test_notification_ust_buffer_usage \
+- tools/notification/test_notification_ust_capture \
+- tools/notification/test_notification_ust_event_rule_condition_exclusion \
+- tools/notification/test_notification_kernel_error \
+- tools/notification/test_notification_kernel_buffer_usage \
+- tools/notification/test_notification_kernel_capture \
+- tools/notification/test_notification_kernel_instrumentation \
+- tools/notification/test_notification_kernel_syscall \
+- tools/notification/test_notification_notifier_discarded_count \
+- tools/notification/test_notification_kernel_userspace_probe \
+- tools/notification/test_notification_multi_app \
+ tools/rotation/test_ust \
+ tools/rotation/test_kernel \
+ tools/rotation/test_save_load_mi \
diff --git a/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
index c4dbe50f21..39d93e2bbf 100755
--- a/meta/recipes-kernel/lttng/lttng-tools/run-ptest
+++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
@@ -1,7 +1,45 @@
#!/bin/sh
# Without --ignore-exit, the tap harness causes any FAILs within a
# test plan to raise ERRORs; this is just noise.
+
+#Detecting whether current system has lttng kernel modules
+LTTNG_KMOD_PATH=/lib/modules/$(uname -r)/kernel/lttng-modules/lttng-tracer.ko
+function validate_lttng_modules_present()
+{
+ # Check for loadable modules.
+ if [ -f "$LTTNG_KMOD_PATH" ]; then
+ return 0
+ fi
+
+ # Check for builtin modules.
+ ls /proc/lttng > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ return 0
+ fi
+
+ return 1
+}
+
export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs
-makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD"
-make -k -t all >/dev/null 2>&1
-exec make -k -s $makeargs check 2>/dev/null | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g'
+makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=FIXMEPTESTPATH top_builddir=FIXMEPTESTPATH"
+
+#If current system doesn't have lttng kernel modules, disable lttng kernel related tests.
+validate_lttng_modules_present || {
+ makeargs="$makeargs LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1"
+}
+
+make -k -t all >error.log 2>&1
+# Can specify a test e.g.:
+# -C tests/regression/ check TESTS='kernel/test_callstack'
+make -k -s $makeargs check 2>error.log | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g'
+exitcode=$?
+if [ -e error.log ]; then
+ cat error.log
+fi
+if [ -e tests/unit/test-suite.log ]; then
+ cat tests/unit/test-suite.log
+fi
+if [ -e tests/regression/test-suite.log ]; then
+ cat tests/regression/test-suite.log
+fi
+exit $exitcode
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.13.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.13.13.bb
index 1491aff618..e73dd4801a 100644
--- a/meta/recipes-kernel/lttng/lttng-tools_2.13.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.13.13.bb
@@ -5,7 +5,7 @@ to extract program execution details from the Linux operating system \
and interpret them."
HOMEPAGE = "https://github.com/lttng/lttng-tools"
-LICENSE = "GPLv2 & LGPLv2.1"
+LICENSE = "GPL-2.0-only & LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \
file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \
file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95"
@@ -15,7 +15,7 @@ include lttng-platforms.inc
DEPENDS = "liburcu popt libxml2 util-linux bison-native"
RDEPENDS:${PN} = "libgcc"
RRECOMMENDS:${PN} += "${LTTNGMODULES}"
-RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep"
+RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep binutils"
RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils"
RDEPENDS:${PN}-ptest:append:libc-musl = " musl-utils"
# babelstats.pl wants getopt-long
@@ -35,13 +35,13 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
file://0001-tests-do-not-strip-a-helper-library.patch \
file://run-ptest \
file://lttng-sessiond.service \
- file://determinism.patch \
- file://0001-src-common-correct-header-location.patch \
- file://0001-Fix-Tests-race-condition-in-test_event_tracker.patch \
- file://0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch \
+ file://disable-tests.patch \
+ file://0001-compat-Define-off64_t-as-off_t-on-linux.patch \
+ file://0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch \
+ file://0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch \
"
-SRC_URI[sha256sum] = "8dc894f9a7a840e943c1c344345c75f001a9529daa9157f1a0e6175c081c29e6"
+SRC_URI[sha256sum] = "ff5f4f00b081dac66092afe8e72b7c790670931cf1c1ee0deaa7f80fbc53883e"
inherit autotools ptest pkgconfig useradd python3-dir manpages systemd
@@ -69,7 +69,7 @@ PRIVATE_LIBS:${PN}-ptest = "libfoo.so"
do_install:append () {
# install systemd unit file
install -d ${D}${systemd_system_unitdir}
- install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_system_unitdir}
+ install -m 0644 ${UNPACKDIR}/lttng-sessiond.service ${D}${systemd_system_unitdir}
}
do_install_ptest () {
@@ -86,7 +86,7 @@ do_install_ptest () {
done
# Patch in the correct path for the custom libraries a helper executable needs
- sed -i -e 's!FIXMEPTESTPATH!${PTEST_PATH}!' "${D}${PTEST_PATH}/run-ptest"
+ sed -i -e 's!FIXMEPTESTPATH!${PTEST_PATH}!g' "${D}${PTEST_PATH}/run-ptest"
# Prevent 'make check' from recursing into non-test subdirectories.
sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile"
@@ -115,7 +115,7 @@ do_install_ptest () {
for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
case $f in
- *.so|userspace-probe-elf-binary)
+ *.so|userspace-probe-elf-*)
install -d ${D}${PTEST_PATH}/tests/$d/
ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f
# Remove any rpath/runpath to pass QA check.
@@ -126,6 +126,7 @@ do_install_ptest () {
done
chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary
+ chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary
chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libbar.so
chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libfoo.so
@@ -187,4 +188,10 @@ do_install_ptest () {
INHIBIT_PACKAGE_STRIP_FILES = "\
${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary \
${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary \
+ ${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary \
+ ${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/.libs/userspace-probe-elf-cxx-binary \
+ ${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events/gen-syscall-events \
+ ${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events/.libs/gen-syscall-events \
+ ${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack \
+ ${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events-callstack/.libs/gen-syscall-events-callstack \
"
diff --git a/meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch b/meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch
index cbbf1df812..6aca8f85fa 100644
--- a/meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch
+++ b/meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch
@@ -1,4 +1,4 @@
-From 06279f50e924d1d55b43eb3b299f6633ecb1f7a4 Mon Sep 17 00:00:00 2001
+From 7d053804ab3823d40ae10d90f4efc49dbfb4cb66 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Wed, 22 Sep 2021 16:33:10 +0800
Subject: [PATCH] Makefile.am: update rpath link
@@ -13,15 +13,16 @@ ld: warning: liblttng-ust-tracepoint.so.1, needed by ../../../src/lib/lttng-ust/
Upstream-Status: Submitted [https://github.com/lttng/lttng-ust/pull/61]
Signed-off-by: Changqing Li <changqing.li@windriver.com>
+
---
doc/examples/Makefile.am | 2 +-
- 1 file changed, 1 insertions(+), 1 deletions(-)
+ 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
-index 8ee0564..20d246c 100644
+index 57782cc..d46caa6 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
-@@ -142,7 +142,7 @@ all-local:
+@@ -167,7 +167,7 @@ all-local:
CFLAGS='$(CFLAGS)' \
AM_CFLAGS='$(AM_CFLAGS)' \
LDFLAGS="$(LDFLAGS)" \
@@ -30,6 +31,3 @@ index 8ee0564..20d246c 100644
LTTNG_GEN_TP_PATH="$$rel_src_subdir$(top_srcdir)/tools/" \
AM_V_P="$(AM_V_P)" \
AM_V_at="$(AM_V_at)" \
---
-2.17.1
-
diff --git a/meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch b/meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch
index 2d61dfa525..e85dbdb439 100644
--- a/meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch
+++ b/meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch
@@ -1,21 +1,22 @@
-From 2058584b7e87d6bd9d1765577766e0df7752232c Mon Sep 17 00:00:00 2001
+From 27402453f25fbdb5a9fb1a1b88d1c4d9852187d2 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Sun, 5 Sep 2021 10:44:19 +0200
Subject: [PATCH] lttng-ust-common: link with liburcu explicitly
Otherwise linking errors are seen on x86-32.
-Upstream-Status: Pending
+Upstream-Status: Submitted [by email to lttng-dev, Francis, Jonathan]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+
---
src/lib/lttng-ust-common/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lib/lttng-ust-common/Makefile.am b/src/lib/lttng-ust-common/Makefile.am
-index caeea2b..30febf0 100644
+index 1ccc290..6531fa0 100644
--- a/src/lib/lttng-ust-common/Makefile.am
+++ b/src/lib/lttng-ust-common/Makefile.am
-@@ -15,6 +15,7 @@ liblttng_ust_common_la_SOURCES = \
+@@ -16,6 +16,7 @@ liblttng_ust_common_la_SOURCES = \
liblttng_ust_common_la_LIBADD = \
$(top_builddir)/src/common/libcommon.la \
diff --git a/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch b/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch
index fd9b6ea7ff..7c49583e0d 100644
--- a/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch
+++ b/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch
@@ -1,6 +1,6 @@
-From dd1fdc841d069dbd4e284f430a88af79de951124 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Thu, 26 Sep 2019 17:54:00 +0800
+From f65efd963e52de51d35e2e03fb773f33dd64f565 Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Tue, 20 Feb 2024 12:19:06 +0000
Subject: [PATCH] python-lttngust/Makefile.am: Add --install-lib to setup.py
Otherwise it may install to /usr/lib, but should be /usr/lib64 when cross
@@ -15,15 +15,15 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/python-lttngust/Makefile.am b/src/python-lttngust/Makefile.am
-index f95482d..f76d95b 100644
+index d53e21d..283901e 100644
--- a/src/python-lttngust/Makefile.am
+++ b/src/python-lttngust/Makefile.am
-@@ -32,7 +32,7 @@ install-exec-local: build-python-bindings.stamp
+@@ -45,7 +45,7 @@ install-exec-local: build-python-bindings.stamp
if [ "$(DESTDIR)" != "" ]; then \
opts="$$opts --root=$(DESTDIR)"; \
fi; \
-- $(PYTHON) $(builddir)/setup.py install $$opts;
-+ $(PYTHON) $(builddir)/setup.py install $$opts --install-lib=$(pythondir);
+- $(PYTHON) $(builddir)/setup.py install $(PY_INSTALL_OPTS) $$opts;
++ $(PYTHON) $(builddir)/setup.py install $(PY_INSTALL_OPTS) $$opts --install-lib=$(pythondir);
clean-local:
rm -rf $(builddir)/build
diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.13.0.bb b/meta/recipes-kernel/lttng/lttng-ust_2.13.8.bb
index 7c6a0743e1..dddd3a5004 100644
--- a/meta/recipes-kernel/lttng/lttng-ust_2.13.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-ust_2.13.8.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library t
HOMEPAGE = "http://lttng.org/ust"
BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust"
-LICENSE = "LGPLv2.1+ & MIT & GPLv2"
+LICENSE = "LGPL-2.1-or-later & MIT & GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=a46577a38ad0c36ff6ff43ccf40c480f"
PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
@@ -34,7 +34,7 @@ SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \
file://0001-Makefile.am-update-rpath-link.patch \
"
-SRC_URI[sha256sum] = "54e4c933679cf6a07971dc5861ce57fc4876ab740ab612407b30b5fc85371750"
+SRC_URI[sha256sum] = "d4ef98dab9a37ad4f524ccafdfd50af4f266039b528dd5afabce78e49024d937"
CVE_PRODUCT = "ust"