diff options
Diffstat (limited to 'meta/recipes-kernel/lttng')
49 files changed, 2517 insertions, 3042 deletions
diff --git a/meta/recipes-kernel/lttng/babeltrace/run-ptest b/meta/recipes-kernel/lttng/babeltrace/run-ptest new file mode 100755 index 0000000000..f4b7ce11e2 --- /dev/null +++ b/meta/recipes-kernel/lttng/babeltrace/run-ptest @@ -0,0 +1,9 @@ +#!/bin/sh +# use target=recheck if you want to recheck failing tests +[ "$target" = "" ] && target=check + +# Without --ignore-exit, the tap harness causes any FAILs within a +# test plan to raise ERRORs; this is just noise. +makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD" + +exec make -C tests -k -s $makeargs $target 2>/dev/null diff --git a/meta/recipes-kernel/lttng/babeltrace2/0001-Make-manpages-multilib-identical.patch b/meta/recipes-kernel/lttng/babeltrace2/0001-Make-manpages-multilib-identical.patch new file mode 100644 index 0000000000..2401b176e6 --- /dev/null +++ b/meta/recipes-kernel/lttng/babeltrace2/0001-Make-manpages-multilib-identical.patch @@ -0,0 +1,28 @@ +From 56986190e4b0c10945ce6aaa7ca10d6bd8a26a39 Mon Sep 17 00:00:00 2001 +From: Jeremy Puhlman <jpuhlman@mvista.com> +Date: Mon, 9 Mar 2020 21:10:35 +0000 +Subject: [PATCH] Make manpages multilib identical + +Upstream-Status: Pending +Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com> +--- + doc/man/asciidoc-attrs.conf.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/doc/man/asciidoc-attrs.conf.in b/doc/man/asciidoc-attrs.conf.in +index ad1183f1..e11c7031 100644 +--- a/doc/man/asciidoc-attrs.conf.in ++++ b/doc/man/asciidoc-attrs.conf.in +@@ -1,7 +1,7 @@ + [attributes] + # default values +-system_plugin_path="@LIBDIR@/babeltrace2/plugins" +-system_plugin_provider_path="@LIBDIR@/babeltrace2/plugin-providers" ++system_plugin_path="@prefix@/lib*/babeltrace2/plugins" ++system_plugin_provider_path="@prefix@/lib*/babeltrace2/plugin-providers" + babeltrace_version="@PACKAGE_VERSION@" + enable_debug_info="@ENABLE_DEBUG_INFO_VAL@" + defrdport=5344 +-- +2.24.1 + diff --git a/meta/recipes-kernel/lttng/babeltrace2/0001-tests-do-not-run-test-applications-from-.libs.patch b/meta/recipes-kernel/lttng/babeltrace2/0001-tests-do-not-run-test-applications-from-.libs.patch new file mode 100644 index 0000000000..805dde8064 --- /dev/null +++ b/meta/recipes-kernel/lttng/babeltrace2/0001-tests-do-not-run-test-applications-from-.libs.patch @@ -0,0 +1,28 @@ +From 582713cc9a013481eeef253195d644020f637ec4 Mon Sep 17 00:00:00 2001 +Message-Id: <582713cc9a013481eeef253195d644020f637ec4.1583403622.git.wallinux@gmail.com> +From: Anders Wallin <wallinux@gmail.com> +Date: Thu, 5 Mar 2020 11:20:04 +0100 +Subject: [PATCH] tests: do not run test applications from .libs + +Cross compile specific change + +Upstream-Status: Inappropriate [oe-core specific] + +Signed-off-by: Anders Wallin <wallinux@gmail.com> +--- + tests/lib/test_plugin | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/lib/test_plugin b/tests/lib/test_plugin +index 652c90cc..1f817c50 100755 +--- a/tests/lib/test_plugin ++++ b/tests/lib/test_plugin +@@ -26,4 +26,4 @@ fi + # shellcheck source=../utils/utils.sh + source "$UTILSSH" + +-"${BT_TESTS_BUILDDIR}/lib/plugin" "${BT_TESTS_BUILDDIR}/lib/test-plugin-plugins/.libs" ++"${BT_TESTS_BUILDDIR}/lib/plugin" "${BT_TESTS_BUILDDIR}/lib/test-plugin-plugins" +-- +2.25.1 + diff --git a/meta/recipes-kernel/lttng/babeltrace2/run-ptest b/meta/recipes-kernel/lttng/babeltrace2/run-ptest new file mode 100755 index 0000000000..71a9c81bfb --- /dev/null +++ b/meta/recipes-kernel/lttng/babeltrace2/run-ptest @@ -0,0 +1,19 @@ +#!/bin/sh +# use target=recheck if you want to recheck failing tests +[ "$target" = "" ] && target=check + +# Without --ignore-exit, the tap harness causes any FAILs within a +# 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 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.6.bb b/meta/recipes-kernel/lttng/babeltrace2_2.0.6.bb new file mode 100644 index 0000000000..a50ba8fcdf --- /dev/null +++ b/meta/recipes-kernel/lttng/babeltrace2_2.0.6.bb @@ -0,0 +1,95 @@ +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 & 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;protocol=https \ + file://run-ptest \ + file://0001-tests-do-not-run-test-applications-from-.libs.patch \ + file://0001-Make-manpages-multilib-identical.patch \ + " +SRCREV = "0a6632f77801f3218a288604c646f8a39cb0d2c4" +UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig ptest python3targetconfig + +EXTRA_OECONF = "--disable-debug-info --disable-Werror" + +PACKAGECONFIG ??= "manpages" +PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native" + +FILES:${PN}-staticdev += "${libdir}/babeltrace2/plugins/*.a" +FILES:${PN} += "${libdir}/babeltrace2/plugins/*.so" + +ASNEEDED = "" +LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', '-fuse-ld=bfd ', '', d)}" + +# coreutils since we need full mktemp +RDEPENDS:${PN}-ptest += "bash gawk python3 make grep coreutils findutils" + +do_compile_ptest () { + make -C tests all +} + +do_install_ptest () { + install -d "${D}${PTEST_PATH}/tests" + + # Copy required files from source directory + for d in $(find "${S}/tests" -type d -printf '%P ') ; do + install -d "${D}${PTEST_PATH}/tests/$d" + find "${S}/tests/$d" -maxdepth 1 -executable -type f \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + + find "${S}/tests/$d" -maxdepth 1 -name *.sh \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \; + find "${S}/tests/$d" -maxdepth 1 -name *.py \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \; + find "${S}/tests/$d" -maxdepth 1 -name *.expect \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \; + done + install -d "${D}${PTEST_PATH}/tests/data/ctf-traces/" + cp -a ${S}/tests/data/ctf-traces/* ${D}${PTEST_PATH}/tests/data/ctf-traces/ + + # Copy the tests directory tree and the executables and + # Makefiles found within. + install -D "${B}/tests/Makefile" "${D}${PTEST_PATH}/tests/" + for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do + install -d "${D}${PTEST_PATH}/tests/$d" + find "${B}/tests/$d" -maxdepth 1 -executable -type f \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + + test -r "${B}/tests/$d/Makefile" && \ + install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile" + find "${B}/tests/$d" -maxdepth 1 -name *.sh \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \; + done + + for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do + 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 + done + done + + # Prevent attempts to update Makefiles during test runs, and + # silence "Making check in $SUBDIR" messages. + find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ + sed -i \ + -e '/Makefile:/,/^$/d' \ + -e '/%: %.in/,/^$/d' \ + -e '/echo "Making $$target in $$subdir"; \\/d' \ + -e 's/^srcdir = \(.*\)/srcdir = ./' \ + -e 's/^builddir = \(.*\)/builddir = ./' \ + -e 's/^all-am:.*/all-am:/' \ + {} + + + # Substitute links to installed binaries. + install -d "${D}${PTEST_PATH}/src/cli/" + ln -s "${bindir}/babeltrace2" ${D}${PTEST_PATH}/src/cli/ + + # Remove architechture specific testfiles + rm -rf ${D}${PTEST_PATH}/tests/data/plugins/flt.lttng-utils.debug-info/* +} diff --git a/meta/recipes-kernel/lttng/babeltrace_1.5.11.bb b/meta/recipes-kernel/lttng/babeltrace_1.5.11.bb new file mode 100644 index 0000000000..f4d9b5e42a --- /dev/null +++ b/meta/recipes-kernel/lttng/babeltrace_1.5.11.bb @@ -0,0 +1,98 @@ +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 & 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;protocol=https \ + file://run-ptest \ + " +SRCREV = "91c00f70884887ff5c4849a8e3d47e311a22ba9d" +UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>1(\.\d+)+)$" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig ptest + +EXTRA_OECONF = "--disable-debug-info" + +ASNEEDED = "" + +RDEPENDS:${PN}-ptest += "bash gawk make" + +addtask do_patch_ptest_path after do_patch before do_configure +do_patch_ptest_path () { + for f in $(grep -l -r abs_top_srcdir ${S}/tests); do + sed -i 's:\@abs_top_srcdir\@:${PTEST_PATH}:' ${f} + done + + for f in $(grep -l -r abs_top_builddir ${S}/tests); do + sed -i 's:\@abs_top_builddir\@:${PTEST_PATH}:' ${f} + done + for f in $(grep -l -r GREP ${S}/tests); do + sed -i 's:\@GREP\@:grep:' ${f} + done + + for f in $(grep -l -r SED ${S}/tests); do + sed -i 's:\@SED\@:sed:' ${f} + done +} + +do_compile_ptest () { + make -C tests all +} + +do_install_ptest () { + # Copy required files from source directory + for f in config/tap-driver.sh config/test-driver; do + install -D "${S}/$f" "${D}${PTEST_PATH}/$f" + done + install -d "$f" "${D}${PTEST_PATH}/tests/ctf-traces/" + cp -a ${S}/tests/ctf-traces/* ${D}${PTEST_PATH}/tests/ctf-traces/ + + # Copy the tests directory tree and the executables and + # Makefiles found within. + install -D "${B}/tests/Makefile" "${D}${PTEST_PATH}/tests/" + for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do + install -d "${D}${PTEST_PATH}/tests/$d" + find "${B}/tests/$d" -maxdepth 1 -executable -type f \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + + test -r "${B}/tests/$d/Makefile" && \ + install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile" + find "${B}/tests/$d" -maxdepth 1 -name *.sh \ + -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \; + done + + for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do + 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 + done + done + + install -D ${B}/formats/ctf/metadata/.libs/ctf-parser-test \ + ${D}${PTEST_PATH}/formats/ctf/metadata/ctf-parser-test + + # Prevent attempts to update Makefiles during test runs, and + # silence "Making check in $SUBDIR" messages. + find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ + sed -i \ + -e '/Makefile:/,/^$/d' \ + -e '/$(check_SCRIPTS)/s/^/#/' \ + -e '/%: %.in/,/^$/d' \ + -e '/echo "Making $$target in $$subdir"; \\/d' \ + -e 's/^srcdir = \(.*\)/srcdir = ./' \ + -e 's/^builddir = \(.*\)/builddir = ./' \ + -e 's/^all-am:.*/all-am:/' \ + {} + + + # Remove path to babeltrace. + for f in $(grep -l -r "^BABELTRACE_BIN" ${D}${PTEST_PATH}); do + sed -i 's:^BABELTRACE_BIN.*:BABELTRACE_BIN=/usr/bin/babeltrace:' ${f} + done + for f in $(grep -l -r "^BTBIN" ${D}${PTEST_PATH}); do + sed -i 's:^BTBIN.*:BTBIN=/usr/bin/babeltrace:' ${f} + done +} diff --git a/meta/recipes-kernel/lttng/babeltrace_1.5.6.bb b/meta/recipes-kernel/lttng/babeltrace_1.5.6.bb deleted file mode 100644 index f5c31c4463..0000000000 --- a/meta/recipes-kernel/lttng/babeltrace_1.5.6.bb +++ /dev/null @@ -1,20 +0,0 @@ -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://www.efficios.com/babeltrace/" -BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace" -LICENSE = "MIT & GPLv2" -LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa" - -DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" - -SRC_URI = "git://git.linuxfoundation.org/diamon/babeltrace.git;branch=stable-1.5" -SRCREV = "4f10a4adabee5ca61c27ba399b3438505e0cd6de" -UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)$" - -S = "${WORKDIR}/git" - -inherit autotools pkgconfig - -EXTRA_OECONF = "--disable-debug-info" - -ASNEEDED = "" diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-kfree_skb-changed-in-6.11-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-kfree_skb-changed-in-6.11-rc1.patch new file mode 100644 index 0000000000..36bf697c51 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-kfree_skb-changed-in-6.11-rc1.patch @@ -0,0 +1,62 @@ +From a06c63b0360cbe1a7c8073461b9cf088234875f7 Mon Sep 17 00:00:00 2001 +From: Kienan Stewart <kstewart@efficios.com> +Date: Mon, 29 Jul 2024 14:01:18 +0000 +Subject: [PATCH] Fix: kfree_skb changed in 6.11-rc1 + +See upstream commit: + + commit c53795d48ee8f385c6a9e394651e7ee914baaeba + Author: Yan Zhai <yan@cloudflare.com> + Date: Mon Jun 17 11:09:04 2024 -0700 + + net: add rx_sk to trace_kfree_skb + + skb does not include enough information to find out receiving + sockets/services and netns/containers on packet drops. In theory + skb->dev tells about netns, but it can get cleared/reused, e.g. by TCP + stack for OOO packet lookup. Similarly, skb->sk often identifies a local + sender, and tells nothing about a receiver. + + Allow passing an extra receiving socket to the tracepoint to improve + the visibility on receiving drops. + +Upstream-Status: Backport + +Change-Id: I33c8ce1a48006456f198ab1592f733b55be01016 +Signed-off-by: Kienan Stewart <kstewart@efficios.com> +Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> +--- + include/instrumentation/events/skb.h | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/include/instrumentation/events/skb.h b/include/instrumentation/events/skb.h +index 9f1047c..5556ab6 100644 +--- a/include/instrumentation/events/skb.h ++++ b/include/instrumentation/events/skb.h +@@ -40,7 +40,25 @@ LTTNG_TRACEPOINT_ENUM(skb_drop_reason, + ) + #endif + +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,11,0)) ++LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb, ++ ++ skb_kfree, ++ ++ TP_PROTO(struct sk_buff *skb, void *location, ++ enum skb_drop_reason reason, struct sock *rx_sk), ++ ++ TP_ARGS(skb, location, reason, rx_sk), ++ ++ TP_FIELDS( ++ ctf_integer_hex(void *, skbaddr, skb) ++ ctf_integer_hex(void *, location, location) ++ ctf_integer_network(unsigned short, protocol, skb->protocol) ++ ctf_enum(skb_drop_reason, uint8_t, reason, reason) ++ ctf_integer_hex(void *, rx_skaddr, rx_sk) ++ ) ++) ++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ + || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0) \ + || LTTNG_RHEL_KERNEL_RANGE(5,14,0,70,0,0, 5,15,0,0,0,0) \ + || LTTNG_RHEL_KERNEL_RANGE(4,18,0,477,10,1, 4,19,0,0,0,0)) diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-signal-Distinguish-between-kernel_siginfo-and-si.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-signal-Distinguish-between-kernel_siginfo-and-si.patch deleted file mode 100644 index 351184dabb..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-signal-Distinguish-between-kernel_siginfo-and-si.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 0a0d736ec89dffdbc83e7181166a99d5563acfe8 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Mon, 5 Nov 2018 11:35:52 -0500 -Subject: [PATCH 1/9] Fix: signal: Distinguish between kernel_siginfo and - siginfo (v4.20) - -See upstream commit : - - commit ae7795bc6187a15ec51cf258abae656a625f9980 - Author: Eric W. Biederman <ebiederm@xmission.com> - Date: Tue Sep 25 11:27:20 2018 +0200 - - signal: Distinguish between kernel_siginfo and siginfo - - Linus recently observed that if we did not worry about the padding - member in struct siginfo it is only about 48 bytes, and 48 bytes is - much nicer than 128 bytes for allocating on the stack and copying - around in the kernel. - - The obvious thing of only adding the padding when userspace is - including siginfo.h won't work as there are sigframe definitions in - the kernel that embed struct siginfo. - - So split siginfo in two; kernel_siginfo and siginfo. Keeping the - traditional name for the userspace definition. While the version that - is used internally to the kernel and ultimately will not be padded to - 128 bytes is called kernel_siginfo. - - The definition of struct kernel_siginfo I have put in include/signal_types.h - - A set of buildtime checks has been added to verify the two structures have - the same field offsets. - - To make it easy to verify the change kernel_siginfo retains the same - size as siginfo. The reduction in size comes in a following change. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/0a0d736ec89dffdbc83e7181166a99d5563acfe8 - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - instrumentation/events/lttng-module/signal.h | 41 ++++++++++++++++++-- - 1 file changed, 37 insertions(+), 4 deletions(-) - -diff --git a/instrumentation/events/lttng-module/signal.h b/instrumentation/events/lttng-module/signal.h -index b3c9126..8783b52 100644 ---- a/instrumentation/events/lttng-module/signal.h -+++ b/instrumentation/events/lttng-module/signal.h -@@ -35,21 +35,24 @@ - * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV - * means that si_code is SI_KERNEL. - */ --#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) - LTTNG_TRACEPOINT_EVENT(signal_generate, - -- TP_PROTO(int sig, struct siginfo *info, struct task_struct *task), -+ TP_PROTO(int sig, struct kernel_siginfo *info, struct task_struct *task, -+ int group, int result), - -- TP_ARGS(sig, info, task), -+ TP_ARGS(sig, info, task, group, result), - - TP_FIELDS( - ctf_integer(int, sig, sig) - LTTNG_FIELDS_SIGINFO(info) - ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) - ctf_integer(pid_t, pid, task->pid) -+ ctf_integer(int, group, group) -+ ctf_integer(int, result, result) - ) - ) --#else -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) - LTTNG_TRACEPOINT_EVENT(signal_generate, - - TP_PROTO(int sig, struct siginfo *info, struct task_struct *task, -@@ -66,6 +69,20 @@ LTTNG_TRACEPOINT_EVENT(signal_generate, - ctf_integer(int, result, result) - ) - ) -+#else -+LTTNG_TRACEPOINT_EVENT(signal_generate, -+ -+ TP_PROTO(int sig, struct siginfo *info, struct task_struct *task), -+ -+ TP_ARGS(sig, info, task), -+ -+ TP_FIELDS( -+ ctf_integer(int, sig, sig) -+ LTTNG_FIELDS_SIGINFO(info) -+ ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) -+ ctf_integer(pid_t, pid, task->pid) -+ ) -+) - #endif - - /** -@@ -82,6 +99,21 @@ LTTNG_TRACEPOINT_EVENT(signal_generate, - * This means, this can show which signals are actually delivered, but - * matching generated signals and delivered signals may not be correct. - */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) -+LTTNG_TRACEPOINT_EVENT(signal_deliver, -+ -+ TP_PROTO(int sig, struct kernel_siginfo *info, struct k_sigaction *ka), -+ -+ TP_ARGS(sig, info, ka), -+ -+ TP_FIELDS( -+ ctf_integer(int, sig, sig) -+ LTTNG_FIELDS_SIGINFO(info) -+ ctf_integer(unsigned long, sa_handler, (unsigned long) ka->sa.sa_handler) -+ ctf_integer(unsigned long, sa_flags, ka->sa.sa_flags) -+ ) -+) -+#else - LTTNG_TRACEPOINT_EVENT(signal_deliver, - - TP_PROTO(int sig, struct siginfo *info, struct k_sigaction *ka), -@@ -95,6 +127,7 @@ LTTNG_TRACEPOINT_EVENT(signal_deliver, - ctf_integer(unsigned long, sa_flags, ka->sa.sa_flags) - ) - ) -+#endif - - #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) - LTTNG_TRACEPOINT_EVENT_CLASS(signal_queue_overflow, --- -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 new file mode 100644 index 0000000000..4911982461 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch @@ -0,0 +1,46 @@ +From 60d423945bd4f4c4b7bfc6f29da9231152d05690 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Sat, 15 May 2021 10:26:38 -0400 +Subject: [PATCH] src/Kbuild: change missing CONFIG_TRACEPOINTS to warning + +Taken from a previous patch to the main lttng-modules Makefile, by +Otavio Salvador: + + The lttng-modules are being pulled by the tools-profile image feature, + however, not every kernel has the CONFIG_TRACEPOINTS feature enabled. + + This change makes the build do not fail when CONFIG_TRACEPOINTS is not + available, allowing it to be kept being pulled by default. + +Upstream-Status: Inappropriate [embedded specific] + +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 +@@ -2,10 +2,13 @@ + + ifdef CONFIG_LOCALVERSION # Check if dot-config is included. + ifeq ($(CONFIG_TRACEPOINTS),) +- $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) ++ $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) ++ DISABLE_MODULE = y + endif # CONFIG_TRACEPOINTS + endif # ifdef CONFIG_LOCALVERSION + ++ifneq ($(DISABLE_MODULE),y) ++ + 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 + obj-$(CONFIG_LTTNG) += probes/ + obj-$(CONFIG_LTTNG) += lib/ + obj-$(CONFIG_LTTNG) += tests/ ++ ++endif # DISABLE_MODULE diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ext4_da_reserve_space-changed-in-6.11-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ext4_da_reserve_space-changed-in-6.11-rc1.patch new file mode 100644 index 0000000000..e62717baeb --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ext4_da_reserve_space-changed-in-6.11-rc1.patch @@ -0,0 +1,55 @@ +From bfb177d2745d19cb56a27c438f4925d6397fbf0b Mon Sep 17 00:00:00 2001 +From: Kienan Stewart <kstewart@efficios.com> +Date: Mon, 29 Jul 2024 14:08:32 +0000 +Subject: [PATCH] Fix: ext4_da_reserve_space changed in 6.11-rc1 + +See upstream commit: + + commit 0d66b23d79c750276f791411d81a524549a64852 + Author: Zhang Yi <yi.zhang@huawei.com> + Date: Fri May 17 20:40:02 2024 +0800 + + ext4: make ext4_da_reserve_space() reserve multi-clusters + + Add 'nr_resv' parameter to ext4_da_reserve_space(), which indicates the + number of clusters wants to reserve, make it reserve multiple clusters + at a time. + +Upstream-Status: Backport + +Change-Id: Ib1ce8c3023d53a6d22ec444a435fdb3c871f64c5 +Signed-off-by: Kienan Stewart <kstewart@efficios.com> +Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> +--- + include/instrumentation/events/ext4.h | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/include/instrumentation/events/ext4.h b/include/instrumentation/events/ext4.h +index 4131803..9f1d4b1 100644 +--- a/include/instrumentation/events/ext4.h ++++ b/include/instrumentation/events/ext4.h +@@ -821,7 +821,23 @@ LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, + ) + #endif + +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,11,0)) ++LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, ++ TP_PROTO(struct inode *inode, int nr_resv), ++ ++ TP_ARGS(inode, nr_resv), ++ ++ TP_FIELDS( ++ ctf_integer(dev_t, dev, inode->i_sb->s_dev) ++ ctf_integer(ino_t, ino, inode->i_ino) ++ ctf_integer(__u64, i_blocks, inode->i_blocks) ++ ctf_integer(__u64, nr_resv, nr_resv) ++ ctf_integer(int, reserved_data_blocks, ++ EXT4_I(inode)->i_reserved_data_blocks) ++ ctf_integer(TP_MODE_T, mode, inode->i_mode) ++ ) ++) ++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) + LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, + TP_PROTO(struct inode *inode), + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-signal-Remove-SEND_SIG_FORCED-v4.20.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-signal-Remove-SEND_SIG_FORCED-v4.20.patch deleted file mode 100644 index 905b68165b..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-signal-Remove-SEND_SIG_FORCED-v4.20.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 26bc064a4d4c85e6000393aadb38659f99b59162 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Mon, 5 Nov 2018 11:35:53 -0500 -Subject: [PATCH 2/9] Fix: signal: Remove SEND_SIG_FORCED (v4.20) - -See upstream commit : - - commit 4ff4c31a6e85f4c49fbeebeaa28018d002884b5a - Author: Eric W. Biederman <ebiederm@xmission.com> - Date: Mon Sep 3 10:39:04 2018 +0200 - - signal: Remove SEND_SIG_FORCED - - There are no more users of SEND_SIG_FORCED so it may be safely removed. - - Remove the definition of SEND_SIG_FORCED, it's use in is_si_special, - it's use in TP_STORE_SIGINFO, and it's use in __send_signal as without - any users the uses of SEND_SIG_FORCED are now unncessary. - - This makes the code simpler, easier to understand and use. Users of - signal sending functions now no longer need to ask themselves do I - need to use SEND_SIG_FORCED. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/26bc064a4d4c85e6000393aadb38659f99b59162 - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> - ---- - instrumentation/events/lttng-module/signal.h | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/instrumentation/events/lttng-module/signal.h b/instrumentation/events/lttng-module/signal.h -index 8783b52..ad8fe69 100644 ---- a/instrumentation/events/lttng-module/signal.h -+++ b/instrumentation/events/lttng-module/signal.h -@@ -12,6 +12,17 @@ - #include <linux/signal.h> - #include <linux/sched.h> - #undef LTTNG_FIELDS_SIGINFO -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) -+#define LTTNG_FIELDS_SIGINFO(info) \ -+ ctf_integer(int, errno, \ -+ (info == SEND_SIG_NOINFO || info == SEND_SIG_PRIV) ? \ -+ 0 : \ -+ info->si_errno) \ -+ ctf_integer(int, code, \ -+ (info == SEND_SIG_NOINFO) ? \ -+ SI_USER : \ -+ ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) -+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ - #define LTTNG_FIELDS_SIGINFO(info) \ - ctf_integer(int, errno, \ - (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED || info == SEND_SIG_PRIV) ? \ -@@ -21,6 +32,7 @@ - (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED) ? \ - SI_USER : \ - ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ - #endif /* _TRACE_SIGNAL_DEF */ - - /** --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-ext4-adjust-reserved-cluster-count-when-removing.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-ext4-adjust-reserved-cluster-count-when-removing.patch deleted file mode 100644 index 7edffee542..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-ext4-adjust-reserved-cluster-count-when-removing.patch +++ /dev/null @@ -1,149 +0,0 @@ -From cb9f1a821bcf55cecf3813195fd6d4eff8070927 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Mon, 5 Nov 2018 11:35:54 -0500 -Subject: [PATCH 3/9] Fix: ext4: adjust reserved cluster count when removing - extents (v4.20) - -See upstream commit : - - commit 9fe671496b6c286f9033aedfc1718d67721da0ae - Author: Eric Whitney <enwlinux@gmail.com> - Date: Mon Oct 1 14:25:08 2018 -0400 - - ext4: adjust reserved cluster count when removing extents - - Modify ext4_ext_remove_space() and the code it calls to correct the - reserved cluster count for pending reservations (delayed allocated - clusters shared with allocated blocks) when a block range is removed - from the extent tree. Pending reservations may be found for the clusters - at the ends of written or unwritten extents when a block range is removed. - If a physical cluster at the end of an extent is freed, it's necessary - to increment the reserved cluster count to maintain correct accounting - if the corresponding logical cluster is shared with at least one - delayed and unwritten extent as found in the extents status tree. - - Add a new function, ext4_rereserve_cluster(), to reapply a reservation - on a delayed allocated cluster sharing blocks with a freed allocated - cluster. To avoid ENOSPC on reservation, a flag is applied to - ext4_free_blocks() to briefly defer updating the freeclusters counter - when an allocated cluster is freed. This prevents another thread - from allocating the freed block before the reservation can be reapplied. - - Redefine the partial cluster object as a struct to carry more state - information and to clarify the code using it. - - Adjust the conditional code structure in ext4_ext_remove_space to - reduce the indentation level in the main body of the code to improve - readability. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/cb9f1a821bcf55cecf3813195fd6d4eff8070927 - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> - ---- - instrumentation/events/lttng-module/ext4.h | 72 +++++++++++++++++++++- - 1 file changed, 69 insertions(+), 3 deletions(-) - -diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h -index fe6f802..83a80ba 100644 ---- a/instrumentation/events/lttng-module/ext4.h -+++ b/instrumentation/events/lttng-module/ext4.h -@@ -1602,7 +1602,30 @@ LTTNG_TRACEPOINT_EVENT(ext4_ext_show_extent, - ) - ) - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) -+ -+LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, -+ TP_PROTO(struct inode *inode, struct ext4_extent *ex, -+ ext4_lblk_t from, ext4_fsblk_t to, -+ struct partial_cluster *pc), -+ -+ TP_ARGS(inode, ex, from, to, pc), -+ -+ TP_FIELDS( -+ ctf_integer(dev_t, dev, inode->i_sb->s_dev) -+ ctf_integer(ino_t, ino, inode->i_ino) -+ ctf_integer(ext4_lblk_t, from, from) -+ ctf_integer(ext4_lblk_t, to, to) -+ ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) -+ ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) -+ ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex)) -+ ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) -+ ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) -+ ctf_integer(int, pc_state, pc->state) -+ ) -+) -+ -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - - LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, - TP_PROTO(struct inode *inode, struct ext4_extent *ex, -@@ -1646,7 +1669,29 @@ LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, - - #endif - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) -+ -+LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, -+ TP_PROTO(struct inode *inode, ext4_lblk_t start, -+ struct ext4_extent *ex, -+ struct partial_cluster *pc), -+ -+ TP_ARGS(inode, start, ex, pc), -+ -+ TP_FIELDS( -+ ctf_integer(dev_t, dev, inode->i_sb->s_dev) -+ ctf_integer(ino_t, ino, inode->i_ino) -+ ctf_integer(ext4_lblk_t, start, start) -+ ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) -+ ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) -+ ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex)) -+ ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) -+ ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) -+ ctf_integer(int, pc_state, pc->state) -+ ) -+) -+ -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - - LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, - TP_PROTO(struct inode *inode, ext4_lblk_t start, -@@ -1733,7 +1778,28 @@ LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space, - - #endif - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) -+ -+LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, -+ TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, -+ int depth, struct partial_cluster *pc, __le16 eh_entries), -+ -+ TP_ARGS(inode, start, end, depth, pc, eh_entries), -+ -+ TP_FIELDS( -+ ctf_integer(dev_t, dev, inode->i_sb->s_dev) -+ ctf_integer(ino_t, ino, inode->i_ino) -+ ctf_integer(ext4_lblk_t, start, start) -+ ctf_integer(ext4_lblk_t, end, end) -+ ctf_integer(int, depth, depth) -+ ctf_integer(unsigned short, eh_entries, le16_to_cpu(eh_entries)) -+ ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) -+ ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) -+ ctf_integer(int, pc_state, pc->state) -+ ) -+) -+ -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - - LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, - TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-orig_start-removed-from-btrfs_get_extent-in-6.11.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-orig_start-removed-from-btrfs_get_extent-in-6.11.patch new file mode 100644 index 0000000000..4d06ec76e7 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-orig_start-removed-from-btrfs_get_extent-in-6.11.patch @@ -0,0 +1,64 @@ +From 1e4cc8d271117af9262e28a5dd19790a0917818c Mon Sep 17 00:00:00 2001 +From: Kienan Stewart <kstewart@efficios.com> +Date: Mon, 29 Jul 2024 14:11:36 +0000 +Subject: [PATCH] Fix: orig_start removed from btrfs_get_extent in 6.11-rc1 + +See upstream commit: + + commit 4aa7b5d1784f510c0f42afc1d74efb41947221d7 + Author: Qu Wenruo <wqu@suse.com> + Date: Tue Apr 30 07:53:04 2024 +0930 + + btrfs: remove extent_map::orig_start member + + Since we have extent_map::offset, the old extent_map::orig_start is just + extent_map::start - extent_map::offset for non-hole/inline extents. + + And since the new extent_map::offset is already verified by + validate_extent_map() while the old orig_start is not, let's just remove + the old member from all call sites. + +Upstream-Status: Backport + +Change-Id: I025a30d49b3e3ddc37d7846acc191ebbdf2ff19e +Signed-off-by: Kienan Stewart <kstewart@efficios.com> +Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> +--- + include/instrumentation/events/btrfs.h | 24 +++++++++++++++++++++++- + 1 file changed, 23 insertions(+), 1 deletion(-) + +diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h +index c0c746e..dfad19c 100644 +--- a/include/instrumentation/events/btrfs.h ++++ b/include/instrumentation/events/btrfs.h +@@ -177,7 +177,29 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, + ) + #endif + +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0)) ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,11,0)) ++ ++LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, ++ ++ TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode, ++ const struct extent_map *map), ++ ++ TP_ARGS(root, inode, map), ++ ++ TP_FIELDS( ++ ctf_integer(u64, root_objectid, root->root_key.objectid) ++ ctf_integer(u64, ino, btrfs_ino(inode)) ++ ctf_integer(u64, start, map->start) ++ ctf_integer(u64, len, map->len) ++ ctf_integer(u64, block_start, map->block_start) ++ ctf_integer(u64, block_len, map->block_len) ++ ctf_integer(unsigned int, flags, map->flags) ++ ctf_integer(int, refs, refcount_read(&map->refs)) ++ ctf_integer(unsigned int, compress_type, extent_map_compression(map)) ++ ) ++) ++ ++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0)) + + LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-block_len-removed-frmo-btrfs_get_extent-in-6.11-.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-block_len-removed-frmo-btrfs_get_extent-in-6.11-.patch new file mode 100644 index 0000000000..c9f48e2f2b --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-block_len-removed-frmo-btrfs_get_extent-in-6.11-.patch @@ -0,0 +1,44 @@ +From 974125ab11a7f0b4df5658cdac26dc5cf9fdbc87 Mon Sep 17 00:00:00 2001 +From: Kienan Stewart <kstewart@efficios.com> +Date: Mon, 29 Jul 2024 14:12:47 +0000 +Subject: [PATCH] Fix: block_len removed frmo btrfs_get_extent in 6.11-rc1 + +See upstream commit: + + commit e28b851ed9b232c3b84cb8d0fedbdfa8ca881386 + Author: Qu Wenruo <wqu@suse.com> + Date: Tue Apr 30 07:53:05 2024 +0930 + + btrfs: remove extent_map::block_len member + + The extent_map::block_len is either extent_map::len (non-compressed + extent) or extent_map::disk_num_bytes (compressed extent). + + Since we already have sanity checks to do the cross-checks between the + new and old members, we can drop the old extent_map::block_len now. + + For most call sites, they can manually select extent_map::len or + extent_map::disk_num_bytes, since most if not all of them have checked + if the extent is compressed. + +Upstream-Status: Backport + +Change-Id: Ib03fc685b4e876bf4e53afdd28ca9826342a0e4e +Signed-off-by: Kienan Stewart <kstewart@efficios.com> +Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> +--- + include/instrumentation/events/btrfs.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h +index dfad19c..28320d8 100644 +--- a/include/instrumentation/events/btrfs.h ++++ b/include/instrumentation/events/btrfs.h +@@ -192,7 +192,6 @@ LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + ctf_integer(u64, start, map->start) + ctf_integer(u64, len, map->len) + ctf_integer(u64, block_start, map->block_start) +- ctf_integer(u64, block_len, map->block_len) + ctf_integer(unsigned int, flags, map->flags) + ctf_integer(int, refs, refcount_read(&map->refs)) + ctf_integer(unsigned int, compress_type, extent_map_compression(map)) diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-timer-instrumentation-for-RHEL-7.6.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-timer-instrumentation-for-RHEL-7.6.patch deleted file mode 100644 index b5d50dba1c..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-timer-instrumentation-for-RHEL-7.6.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4eaeb54a27fbf701c2a4908a6e90a978b93deb06 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Thu, 6 Dec 2018 11:31:51 -0500 -Subject: [PATCH 4/9] Fix: timer instrumentation for RHEL 7.6 - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/4eaeb54a27fbf701c2a4908a6e90a978b93deb06 - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - instrumentation/events/lttng-module/timer.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/instrumentation/events/lttng-module/timer.h b/instrumentation/events/lttng-module/timer.h -index 6f0cb7f..8807ad5 100644 ---- a/instrumentation/events/lttng-module/timer.h -+++ b/instrumentation/events/lttng-module/timer.h -@@ -44,7 +44,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_init, - TP_ARGS(timer) - ) - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) || \ -+ LTTNG_RHEL_KERNEL_RANGE(3,10,0,957,0,0, 3,11,0,0,0,0)) - /** - * timer_start - called when the timer is started - * @timer: pointer to struct timer_list --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-type-argument-from-access_ok-function-v5..patch b/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-type-argument-from-access_ok-function-v5..patch deleted file mode 100644 index 2266bbd9e0..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-Remove-type-argument-from-access_ok-function-v5..patch +++ /dev/null @@ -1,204 +0,0 @@ -From 0039dbe9891cfdf2c0d04691f83c2f342993dfd7 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Wed, 9 Jan 2019 14:59:15 -0500 -Subject: [PATCH 5/9] Fix: Remove 'type' argument from access_ok() function - (v5.0) - -See upstream commit : - - commit 96d4f267e40f9509e8a66e2b39e8b95655617693 - Author: Linus Torvalds <torvalds@linux-foundation.org> - Date: Thu Jan 3 18:57:57 2019 -0800 - - Remove 'type' argument from access_ok() function - - Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument - of the user address range verification function since we got rid of the - old racy i386-only code to walk page tables by hand. - - It existed because the original 80386 would not honor the write protect - bit when in kernel mode, so you had to do COW by hand before doing any - user access. But we haven't supported that in a long time, and these - days the 'type' argument is a purely historical artifact. - - A discussion about extending 'user_access_begin()' to do the range - checking resulted this patch, because there is no way we're going to - move the old VERIFY_xyz interface to that model. And it's best done at - the end of the merge window when I've done most of my merges, so let's - just get this done once and for all. - - This patch was mostly done with a sed-script, with manual fix-ups for - the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form. - - There were a couple of notable cases: - - - csky still had the old "verify_area()" name as an alias. - - - the iter_iov code had magical hardcoded knowledge of the actual - values of VERIFY_{READ,WRITE} (not that they mattered, since nothing - really used it) - - - microblaze used the type argument for a debug printout - - but other than those oddities this should be a total no-op patch. - - I tried to fix up all architectures, did fairly extensive grepping for - access_ok() uses, and the changes are trivial, but I may have missed - something. Any missed conversion should be trivially fixable, though. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/0039dbe9891cfdf2c0d04691f83c2f342993dfd7 - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - lib/ringbuffer/backend.h | 8 ++++---- - lib/ringbuffer/ring_buffer_iterator.c | 3 ++- - lttng-filter-interpreter.c | 4 ++-- - probes/lttng-probe-user.c | 3 ++- - wrapper/uaccess.h | 28 +++++++++++++++++++++++++++ - 5 files changed, 38 insertions(+), 8 deletions(-) - create mode 100644 wrapper/uaccess.h - -diff --git a/lib/ringbuffer/backend.h b/lib/ringbuffer/backend.h -index 0b75de8..3f8c108 100644 ---- a/lib/ringbuffer/backend.h -+++ b/lib/ringbuffer/backend.h -@@ -34,7 +34,7 @@ - #include <linux/list.h> - #include <linux/fs.h> - #include <linux/mm.h> --#include <linux/uaccess.h> -+#include <wrapper/uaccess.h> - - /* Internal helpers */ - #include <wrapper/ringbuffer/backend_internal.h> -@@ -302,7 +302,7 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config - - set_fs(KERNEL_DS); - pagefault_disable(); -- if (unlikely(!access_ok(VERIFY_READ, src, len))) -+ if (unlikely(!lttng_access_ok(VERIFY_READ, src, len))) - goto fill_buffer; - - if (likely(pagecpy == len)) { -@@ -372,7 +372,7 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf - - set_fs(KERNEL_DS); - pagefault_disable(); -- if (unlikely(!access_ok(VERIFY_READ, src, len))) -+ if (unlikely(!lttng_access_ok(VERIFY_READ, src, len))) - goto fill_buffer; - - if (likely(pagecpy == len)) { -@@ -462,7 +462,7 @@ unsigned long lib_ring_buffer_copy_from_user_check_nofault(void *dest, - unsigned long ret; - mm_segment_t old_fs; - -- if (!access_ok(VERIFY_READ, src, len)) -+ if (!lttng_access_ok(VERIFY_READ, src, len)) - return 1; - old_fs = get_fs(); - set_fs(KERNEL_DS); -diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c -index 61eaa5b..9645946 100644 ---- a/lib/ringbuffer/ring_buffer_iterator.c -+++ b/lib/ringbuffer/ring_buffer_iterator.c -@@ -27,6 +27,7 @@ - - #include <wrapper/ringbuffer/iterator.h> - #include <wrapper/file.h> -+#include <wrapper/uaccess.h> - #include <linux/jiffies.h> - #include <linux/delay.h> - #include <linux/module.h> -@@ -621,7 +622,7 @@ ssize_t channel_ring_buffer_file_read(struct file *filp, - ssize_t len; - - might_sleep(); -- if (!access_ok(VERIFY_WRITE, user_buf, count)) -+ if (!lttng_access_ok(VERIFY_WRITE, user_buf, count)) - return -EFAULT; - - /* Finish copy of previous record */ -diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c -index e131462..bee2918 100644 ---- a/lttng-filter-interpreter.c -+++ b/lttng-filter-interpreter.c -@@ -24,7 +24,7 @@ - * SOFTWARE. - */ - --#include <linux/uaccess.h> -+#include <wrapper/uaccess.h> - #include <wrapper/frame.h> - #include <wrapper/types.h> - -@@ -46,7 +46,7 @@ char get_char(struct estack_entry *reg, size_t offset) - char c; - - /* Handle invalid access as end of string. */ -- if (unlikely(!access_ok(VERIFY_READ, -+ if (unlikely(!lttng_access_ok(VERIFY_READ, - reg->u.s.user_str + offset, - sizeof(c)))) - return '\0'; -diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c -index 099a66b..ed566dd 100644 ---- a/probes/lttng-probe-user.c -+++ b/probes/lttng-probe-user.c -@@ -20,6 +20,7 @@ - - #include <linux/uaccess.h> - #include <linux/module.h> -+#include <wrapper/uaccess.h> - #include <probes/lttng-probe-user.h> - - /* -@@ -43,7 +44,7 @@ long lttng_strlen_user_inatomic(const char *addr) - char v; - unsigned long ret; - -- if (unlikely(!access_ok(VERIFY_READ, -+ if (unlikely(!lttng_access_ok(VERIFY_READ, - (__force const char __user *) addr, - sizeof(v)))) - break; -diff --git a/wrapper/uaccess.h b/wrapper/uaccess.h -new file mode 100644 -index 0000000..c56427c ---- /dev/null -+++ b/wrapper/uaccess.h -@@ -0,0 +1,28 @@ -+/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) -+ * -+ * wrapper/uaccess.h -+ * -+ * wrapper around linux/uaccess.h. -+ * -+ * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com> -+ */ -+ -+#ifndef _LTTNG_WRAPPER_UACCESS_H -+#define _LTTNG_WRAPPER_UACCESS_H -+ -+#include <linux/uaccess.h> -+#include <lttng-kernel-version.h> -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) -+ -+#define VERIFY_READ 0 -+#define VERIFY_WRITE 1 -+#define lttng_access_ok(type, addr, size) access_ok(addr, size) -+ -+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */ -+ -+#define lttng_access_ok(type, addr, size) access_ok(type, addr, size) -+ -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */ -+ -+#endif /* _LTTNG_WRAPPER_UACCESS_H */ --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-block_start-removed-from-btrfs_get_extent-in-6.1.patch b/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-block_start-removed-from-btrfs_get_extent-in-6.1.patch new file mode 100644 index 0000000000..86c72cc650 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-block_start-removed-from-btrfs_get_extent-in-6.1.patch @@ -0,0 +1,50 @@ +From b845e79532c9c28c0108bf556171093236460251 Mon Sep 17 00:00:00 2001 +From: Kienan Stewart <kstewart@efficios.com> +Date: Mon, 29 Jul 2024 14:14:24 +0000 +Subject: [PATCH] Fix: block_start removed from btrfs_get_extent in 6.11-rc1 + +See upstream commit: + + commit c77a8c61002e91d859e118008fd495efbe1d9373 + Author: Qu Wenruo <wqu@suse.com> + Date: Tue Apr 30 07:53:06 2024 +0930 + + btrfs: remove extent_map::block_start member + + The member extent_map::block_start can be calculated from + extent_map::disk_bytenr + extent_map::offset for regular extents. + And otherwise just extent_map::disk_bytenr. + + And this is already validated by the validate_extent_map(). Now we can + remove the member. + + However there is a special case in btrfs_create_dio_extent() where we + for NOCOW/PREALLOC ordered extents cannot directly use the resulting + btrfs_file_extent, as btrfs_split_ordered_extent() cannot handle them + yet. + + So for that call site, we pass file_extent->disk_bytenr + + file_extent->num_bytes as disk_bytenr for the ordered extent, and 0 for + offset. + +Upstream-Status: Backport + +Change-Id: I2e3245bb0d1f5263e902659aa05848d5e231909b +Signed-off-by: Kienan Stewart <kstewart@efficios.com> +Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> +--- + include/instrumentation/events/btrfs.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h +index 28320d8..8fb6866 100644 +--- a/include/instrumentation/events/btrfs.h ++++ b/include/instrumentation/events/btrfs.h +@@ -191,7 +191,6 @@ LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + ctf_integer(u64, ino, btrfs_ino(inode)) + ctf_integer(u64, start, map->start) + ctf_integer(u64, len, map->len) +- ctf_integer(u64, block_start, map->block_start) + ctf_integer(unsigned int, flags, map->flags) + ctf_integer(int, refs, refcount_read(&map->refs)) + ctf_integer(unsigned int, compress_type, extent_map_compression(map)) diff --git a/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-Replace-pointer-values-with-task-tk_pid-and-rpc_.patch b/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-Replace-pointer-values-with-task-tk_pid-and-rpc_.patch deleted file mode 100644 index 089486f51b..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-Replace-pointer-values-with-task-tk_pid-and-rpc_.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 89f0be35e1baf411df6852014013ac64ad1bbcf8 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Wed, 9 Jan 2019 14:59:16 -0500 -Subject: [PATCH 6/9] Fix: Replace pointer values with task->tk_pid and - rpc_clnt->cl_clid - -Introduced in v3.12. - -See upstream commit : - - commit 92cb6c5be8134db6f7c38f25f6afd13e444cebaf - Author: Trond Myklebust <Trond.Myklebust@netapp.com> - Date: Wed Sep 4 22:09:50 2013 -0400 - - SUNRPC: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid - - Instead of the pointer values, use the task and client identifier values - for tracing purposes. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/89f0be35e1baf411df6852014013ac64ad1bbcf8 - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - instrumentation/events/lttng-module/rpc.h | 108 ++++++++++++++++++++-- - 1 file changed, 102 insertions(+), 6 deletions(-) - -diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h -index b9e45fe..a4ac557 100644 ---- a/instrumentation/events/lttng-module/rpc.h -+++ b/instrumentation/events/lttng-module/rpc.h -@@ -8,6 +8,20 @@ - #include <linux/sunrpc/sched.h> - #include <linux/sunrpc/clnt.h> - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -+LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, -+ -+ TP_PROTO(struct rpc_task *task), -+ -+ TP_ARGS(task), -+ -+ TP_FIELDS( -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) -+ ctf_integer(int, status, task->tk_status) -+ ) -+) -+#else - LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - - TP_PROTO(struct rpc_task *task), -@@ -20,6 +34,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - ctf_integer(int, status, task->tk_status) - ) - ) -+#endif - - LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, - TP_PROTO(struct rpc_task *task), -@@ -40,8 +55,8 @@ LTTNG_TRACEPOINT_EVENT(rpc_connect_status, - TP_ARGS(task), - - TP_FIELDS( -- ctf_integer_hex(const struct rpc_task *, task, task) -- ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) - ctf_integer(int, status, task->tk_status) - ) - ) -@@ -53,8 +68,8 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, - TP_ARGS(task, action), - - TP_FIELDS( -- ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) -- ctf_integer_hex(const struct rpc_task *, task, task) -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) - ctf_integer_hex(const void *, action, action) - ctf_integer(unsigned long, runstate, task->tk_runstate) - ctf_integer(int, status, task->tk_status) -@@ -90,8 +105,8 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, - TP_ARGS(task, q), - - TP_FIELDS( -- ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) -- ctf_integer_hex(const struct rpc_task *, task, task) -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) - ctf_integer(unsigned long, timeout, task->tk_timeout) - ctf_integer(unsigned long, runstate, task->tk_runstate) - ctf_integer(int, status, task->tk_status) -@@ -114,6 +129,87 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, - TP_ARGS(task, q) - ) - -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -+LTTNG_TRACEPOINT_EVENT(rpc_connect_status, -+ TP_PROTO(struct rpc_task *task, int status), -+ -+ TP_ARGS(task, status), -+ -+ TP_FIELDS( -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) -+ ctf_integer(int, status, status) -+ ) -+) -+ -+LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, -+ -+ TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), -+ -+ TP_ARGS(clnt, task, action), -+ -+ TP_FIELDS( -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) -+ ctf_integer_hex(const void *, action, action) -+ ctf_integer(unsigned long, runstate, task->tk_runstate) -+ ctf_integer(int, status, task->tk_status) -+ ctf_integer(unsigned short, flags, task->tk_flags) -+ ) -+) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, -+ -+ TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), -+ -+ TP_ARGS(clnt, task, action) -+) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, -+ -+ TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), -+ -+ TP_ARGS(clnt, task, action) -+) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, -+ -+ TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), -+ -+ TP_ARGS(clnt, task, action) -+) -+ -+LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, -+ -+ TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), -+ -+ TP_ARGS(clnt, task, q), -+ -+ TP_FIELDS( -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) -+ ctf_integer(unsigned long, timeout, task->tk_timeout) -+ ctf_integer(unsigned long, runstate, task->tk_runstate) -+ ctf_integer(int, status, task->tk_status) -+ ctf_integer(unsigned short, flags, task->tk_flags) -+ ctf_string(q_name, rpc_qname(q)) -+ ) -+) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, -+ -+ TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), -+ -+ TP_ARGS(clnt, task, q) -+) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, -+ -+ TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), -+ -+ TP_ARGS(clnt, task, q) -+) -+ - #else - LTTNG_TRACEPOINT_EVENT(rpc_connect_status, - TP_PROTO(struct rpc_task *task, int status), --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-scsi-sd-Atomic-write-support-added-in-6.11-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-scsi-sd-Atomic-write-support-added-in-6.11-rc1.patch new file mode 100644 index 0000000000..2745e6444a --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-scsi-sd-Atomic-write-support-added-in-6.11-rc1.patch @@ -0,0 +1,200 @@ +From d0797fe4bce357d419d2f1f8a3cfe2f8e71ebfdb Mon Sep 17 00:00:00 2001 +From: Kienan Stewart <kstewart@efficios.com> +Date: Mon, 29 Jul 2024 14:23:02 +0000 +Subject: [PATCH] Fix: scsi: sd: Atomic write support added in 6.11-rc1 + +See upstream commit: + + commit bf4ae8f2e6407a779c0368eb0f3e047a8333be17 + Author: John Garry <john.g.garry@oracle.com> + Date: Thu Jun 20 12:53:57 2024 +0000 + + scsi: sd: Atomic write support + + Support is divided into two main areas: + - reading VPD pages and setting sdev request_queue limits + - support WRITE ATOMIC (16) command and tracing + + The relevant block limits VPD page need to be read to allow the block layer + request_queue atomic write limits to be set. These VPD page limits are + described in sbc4r22 section 6.6.4 - Block limits VPD page. + + There are five limits of interest: + - MAXIMUM ATOMIC TRANSFER LENGTH + - ATOMIC ALIGNMENT + - ATOMIC TRANSFER LENGTH GRANULARITY + - MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY + - MAXIMUM ATOMIC BOUNDARY SIZE + + MAXIMUM ATOMIC TRANSFER LENGTH is the maximum length for a WRITE ATOMIC + (16) command. It will not be greater than the device MAXIMUM TRANSFER + LENGTH. + + ATOMIC ALIGNMENT and ATOMIC TRANSFER LENGTH GRANULARITY are the minimum + alignment and length values for an atomic write in terms of logical blocks. + + Unlike NVMe, SCSI does not specify an LBA space boundary, but does specify + a per-IO boundary granularity. The maximum boundary size is specified in + MAXIMUM ATOMIC BOUNDARY SIZE. When used, this boundary value is set in the + WRITE ATOMIC (16) ATOMIC BOUNDARY field - layout for the WRITE_ATOMIC_16 + command can be found in sbc4r22 section 5.48. This boundary value is the + granularity size at which the device may atomically write the data. A value + of zero in WRITE ATOMIC (16) ATOMIC BOUNDARY field means that all data must + be atomically written together. + + MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY is the maximum atomic write + length if a non-zero boundary value is set. + + For atomic write support, the WRITE ATOMIC (16) boundary is not of much + interest, as the block layer expects each request submitted to be executed + be atomically written together. + + MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY is the maximum atomic write + length if a non-zero boundary value is set. + + For atomic write support, the WRITE ATOMIC (16) boundary is not of much + interest, as the block layer expects each request submitted to be executed + atomically. However, the SCSI spec does leave itself open to a quirky + scenario where MAXIMUM ATOMIC TRANSFER LENGTH is zero, yet MAXIMUM ATOMIC + TRANSFER LENGTH WITH BOUNDARY and MAXIMUM ATOMIC BOUNDARY SIZE are both + non-zero. This case will be supported. + + To set the block layer request_queue atomic write capabilities, sanitize + the VPD page limits and set limits as follows: + - atomic_write_unit_min is derived from granularity and alignment values. + If no granularity value is not set, use physical block size + - atomic_write_unit_max is derived from MAXIMUM ATOMIC TRANSFER LENGTH. In + the scenario where MAXIMUM ATOMIC TRANSFER LENGTH is zero and boundary + limits are non-zero, use MAXIMUM ATOMIC BOUNDARY SIZE for + atomic_write_unit_max. New flag scsi_disk.use_atomic_write_boundary is + set for this scenario. + - atomic_write_boundary_bytes is set to zero always + + SCSI also supports a WRITE ATOMIC (32) command, which is for type 2 + protection enabled. This is not going to be supported now, so check for + T10_PI_TYPE2_PROTECTION when setting any request_queue limits. + + To handle an atomic write request, add support for WRITE ATOMIC (16) + command in handler sd_setup_atomic_cmnd(). Flag use_atomic_write_boundary + is checked here for encoding ATOMIC BOUNDARY field. + + Trace info is also added for WRITE_ATOMIC_16 command. + +Upstream-Status: Backport + +Change-Id: Ie072002fe2184615c72531ac081a324ef18cfb03 +Signed-off-by: Kienan Stewart <kstewart@efficios.com> +Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> +--- + include/instrumentation/events/scsi.h | 98 ++++++++++++++++++++++++++- + 1 file changed, 97 insertions(+), 1 deletion(-) + +diff --git a/include/instrumentation/events/scsi.h b/include/instrumentation/events/scsi.h +index 52c0ebd..54ba3ee 100644 +--- a/include/instrumentation/events/scsi.h ++++ b/include/instrumentation/events/scsi.h +@@ -16,7 +16,103 @@ + + #define scsi_opcode_name(opcode) { opcode, #opcode } + +-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,7,0) \ ++#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,11,0)) ++ ++#define show_opcode_name(val) \ ++ __print_symbolic(val, \ ++ scsi_opcode_name(TEST_UNIT_READY), \ ++ scsi_opcode_name(REZERO_UNIT), \ ++ scsi_opcode_name(REQUEST_SENSE), \ ++ scsi_opcode_name(FORMAT_UNIT), \ ++ scsi_opcode_name(READ_BLOCK_LIMITS), \ ++ scsi_opcode_name(REASSIGN_BLOCKS), \ ++ scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ ++ scsi_opcode_name(READ_6), \ ++ scsi_opcode_name(WRITE_6), \ ++ scsi_opcode_name(SEEK_6), \ ++ scsi_opcode_name(READ_REVERSE), \ ++ scsi_opcode_name(WRITE_FILEMARKS), \ ++ scsi_opcode_name(SPACE), \ ++ scsi_opcode_name(INQUIRY), \ ++ scsi_opcode_name(RECOVER_BUFFERED_DATA), \ ++ scsi_opcode_name(MODE_SELECT), \ ++ scsi_opcode_name(RESERVE), \ ++ scsi_opcode_name(RELEASE), \ ++ scsi_opcode_name(COPY), \ ++ scsi_opcode_name(ERASE), \ ++ scsi_opcode_name(MODE_SENSE), \ ++ scsi_opcode_name(START_STOP), \ ++ scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ ++ scsi_opcode_name(SEND_DIAGNOSTIC), \ ++ scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ ++ scsi_opcode_name(SET_WINDOW), \ ++ scsi_opcode_name(READ_CAPACITY), \ ++ scsi_opcode_name(READ_10), \ ++ scsi_opcode_name(WRITE_10), \ ++ scsi_opcode_name(SEEK_10), \ ++ scsi_opcode_name(POSITION_TO_ELEMENT), \ ++ scsi_opcode_name(WRITE_VERIFY), \ ++ scsi_opcode_name(VERIFY), \ ++ scsi_opcode_name(SEARCH_HIGH), \ ++ scsi_opcode_name(SEARCH_EQUAL), \ ++ scsi_opcode_name(SEARCH_LOW), \ ++ scsi_opcode_name(SET_LIMITS), \ ++ scsi_opcode_name(PRE_FETCH), \ ++ scsi_opcode_name(READ_POSITION), \ ++ scsi_opcode_name(SYNCHRONIZE_CACHE), \ ++ scsi_opcode_name(LOCK_UNLOCK_CACHE), \ ++ scsi_opcode_name(READ_DEFECT_DATA), \ ++ scsi_opcode_name(MEDIUM_SCAN), \ ++ scsi_opcode_name(COMPARE), \ ++ scsi_opcode_name(COPY_VERIFY), \ ++ scsi_opcode_name(WRITE_BUFFER), \ ++ scsi_opcode_name(READ_BUFFER), \ ++ scsi_opcode_name(UPDATE_BLOCK), \ ++ scsi_opcode_name(READ_LONG), \ ++ scsi_opcode_name(WRITE_LONG), \ ++ scsi_opcode_name(CHANGE_DEFINITION), \ ++ scsi_opcode_name(WRITE_SAME), \ ++ scsi_opcode_name(UNMAP), \ ++ scsi_opcode_name(READ_TOC), \ ++ scsi_opcode_name(LOG_SELECT), \ ++ scsi_opcode_name(LOG_SENSE), \ ++ scsi_opcode_name(XDWRITEREAD_10), \ ++ scsi_opcode_name(MODE_SELECT_10), \ ++ scsi_opcode_name(RESERVE_10), \ ++ scsi_opcode_name(RELEASE_10), \ ++ scsi_opcode_name(MODE_SENSE_10), \ ++ scsi_opcode_name(PERSISTENT_RESERVE_IN), \ ++ scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ ++ scsi_opcode_name(VARIABLE_LENGTH_CMD), \ ++ scsi_opcode_name(REPORT_LUNS), \ ++ scsi_opcode_name(MAINTENANCE_IN), \ ++ scsi_opcode_name(MAINTENANCE_OUT), \ ++ scsi_opcode_name(MOVE_MEDIUM), \ ++ scsi_opcode_name(EXCHANGE_MEDIUM), \ ++ scsi_opcode_name(READ_12), \ ++ scsi_opcode_name(WRITE_12), \ ++ scsi_opcode_name(WRITE_VERIFY_12), \ ++ scsi_opcode_name(SEARCH_HIGH_12), \ ++ scsi_opcode_name(SEARCH_EQUAL_12), \ ++ scsi_opcode_name(SEARCH_LOW_12), \ ++ scsi_opcode_name(READ_ELEMENT_STATUS), \ ++ scsi_opcode_name(SEND_VOLUME_TAG), \ ++ scsi_opcode_name(WRITE_LONG_2), \ ++ scsi_opcode_name(READ_16), \ ++ scsi_opcode_name(WRITE_16), \ ++ scsi_opcode_name(VERIFY_16), \ ++ scsi_opcode_name(WRITE_SAME_16), \ ++ scsi_opcode_name(ZBC_OUT), \ ++ scsi_opcode_name(ZBC_IN), \ ++ scsi_opcode_name(SERVICE_ACTION_IN_16), \ ++ scsi_opcode_name(READ_32), \ ++ scsi_opcode_name(WRITE_32), \ ++ scsi_opcode_name(WRITE_SAME_32), \ ++ scsi_opcode_name(ATA_16), \ ++ scsi_opcode_name(WRITE_ATOMIC_16), \ ++ scsi_opcode_name(ATA_12)) ++ ++#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,7,0) \ + || LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0, 4,5,0,0,0,0)) + + #define show_opcode_name(val) \ diff --git a/meta/recipes-kernel/lttng/lttng-modules/0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch b/meta/recipes-kernel/lttng/lttng-modules/0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch deleted file mode 100644 index f3673301de..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch +++ /dev/null @@ -1,183 +0,0 @@ -From d11b568681f87c2df6ecb0516d3f16d153f24bd2 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Wed, 9 Jan 2019 14:59:17 -0500 -Subject: [PATCH 7/9] Fix: SUNRPC: Simplify defining common RPC trace events - (v5.0) - -See upstream commit : - - commit dc5820bd21d84ee34770b0a1e2fca9378f8f7456 - Author: Chuck Lever <chuck.lever@oracle.com> - Date: Wed Dec 19 11:00:16 2018 -0500 - - SUNRPC: Simplify defining common RPC trace events - - Clean up, no functional change is expected. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/d11b568681f87c2df6ecb0516d3f16d153f24bd2 - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - instrumentation/events/lttng-module/rpc.h | 99 ++++++++++++++++------- - 1 file changed, 72 insertions(+), 27 deletions(-) - -diff --git a/instrumentation/events/lttng-module/rpc.h b/instrumentation/events/lttng-module/rpc.h -index a4ac557..4239280 100644 ---- a/instrumentation/events/lttng-module/rpc.h -+++ b/instrumentation/events/lttng-module/rpc.h -@@ -8,7 +8,32 @@ - #include <linux/sunrpc/sched.h> - #include <linux/sunrpc/clnt.h> - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) -+LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, -+ -+ TP_PROTO(const struct rpc_task *task), -+ -+ TP_ARGS(task), -+ -+ TP_FIELDS( -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) -+ ctf_integer(int, status, task->tk_status) -+ ) -+) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, -+ TP_PROTO(const struct rpc_task *task), -+ -+ TP_ARGS(task) -+) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, -+ TP_PROTO(const struct rpc_task *task), -+ -+ TP_ARGS(task) -+) -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - - TP_PROTO(struct rpc_task *task), -@@ -21,6 +46,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - ctf_integer(int, status, task->tk_status) - ) - ) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, -+ TP_PROTO(struct rpc_task *task), -+ -+ TP_ARGS(task) -+) -+ -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, -+ TP_PROTO(struct rpc_task *task), -+ -+ TP_ARGS(task) -+) - #else - LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - -@@ -34,7 +71,6 @@ LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - ctf_integer(int, status, task->tk_status) - ) - ) --#endif - - LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, - TP_PROTO(struct rpc_task *task), -@@ -47,8 +83,15 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, - - TP_ARGS(task) - ) -+#endif - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) -+LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status, -+ TP_PROTO(const struct rpc_task *task), -+ -+ TP_ARGS(task) -+) -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) - LTTNG_TRACEPOINT_EVENT(rpc_connect_status, - TP_PROTO(const struct rpc_task *task), - -@@ -60,7 +103,33 @@ LTTNG_TRACEPOINT_EVENT(rpc_connect_status, - ctf_integer(int, status, task->tk_status) - ) - ) -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -+LTTNG_TRACEPOINT_EVENT(rpc_connect_status, -+ TP_PROTO(struct rpc_task *task, int status), -+ -+ TP_ARGS(task, status), -+ -+ TP_FIELDS( -+ ctf_integer(unsigned int, task_id, task->tk_pid) -+ ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) -+ ctf_integer(int, status, status) -+ ) -+) -+#else -+LTTNG_TRACEPOINT_EVENT(rpc_connect_status, -+ TP_PROTO(struct rpc_task *task, int status), -+ -+ TP_ARGS(task, status), -+ -+ TP_FIELDS( -+ ctf_integer_hex(const struct rpc_task *, task, task) -+ ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) -+ ctf_integer(int, status, status) -+ ) -+) -+#endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) - LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, - - TP_PROTO(const struct rpc_task *task, const void *action), -@@ -130,18 +199,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, - ) - - #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) --LTTNG_TRACEPOINT_EVENT(rpc_connect_status, -- TP_PROTO(struct rpc_task *task, int status), -- -- TP_ARGS(task, status), -- -- TP_FIELDS( -- ctf_integer(unsigned int, task_id, task->tk_pid) -- ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) -- ctf_integer(int, status, status) -- ) --) -- - LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), -@@ -211,18 +268,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, - ) - - #else --LTTNG_TRACEPOINT_EVENT(rpc_connect_status, -- TP_PROTO(struct rpc_task *task, int status), -- -- TP_ARGS(task, status), -- -- TP_FIELDS( -- ctf_integer_hex(const struct rpc_task *, task, task) -- ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) -- ctf_integer(int, status, status) -- ) --) -- - LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/0008-Fix-btrfs-Remove-fsid-metadata_fsid-fields-from-btrf.patch b/meta/recipes-kernel/lttng/lttng-modules/0008-Fix-btrfs-Remove-fsid-metadata_fsid-fields-from-btrf.patch deleted file mode 100644 index 5f12989956..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0008-Fix-btrfs-Remove-fsid-metadata_fsid-fields-from-btrf.patch +++ /dev/null @@ -1,341 +0,0 @@ -From 8af8245f6f86370d01cc4acaabafb90de45e143f Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Thu, 10 Jan 2019 14:56:15 -0500 -Subject: [PATCH 8/9] Fix: btrfs: Remove fsid/metadata_fsid fields from - btrfs_info - -Introduced in v5.0. - -See upstream commit : - - commit de37aa513105f864d3c21105bf5542d498f21ca2 - Author: Nikolay Borisov <nborisov@suse.com> - Date: Tue Oct 30 16:43:24 2018 +0200 - - btrfs: Remove fsid/metadata_fsid fields from btrfs_info - - Currently btrfs_fs_info structure contains a copy of the - fsid/metadata_uuid fields. Same values are also contained in the - btrfs_fs_devices structure which fs_info has a reference to. Let's - reduce duplication by removing the fields from fs_info and always refer - to the ones in fs_devices. No functional changes. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/8af8245f6f86370d01cc4acaabafb90de45e143f - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - instrumentation/events/lttng-module/btrfs.h | 100 +++++++++++--------- - 1 file changed, 53 insertions(+), 47 deletions(-) - -diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h -index 4dfbf5b..ec45a1e 100644 ---- a/instrumentation/events/lttng-module/btrfs.h -+++ b/instrumentation/events/lttng-module/btrfs.h -@@ -32,6 +32,12 @@ struct extent_state; - - #define BTRFS_UUID_SIZE 16 - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) -+#define lttng_fs_info_fsid fs_info->fs_devices->fsid -+#else -+#define lttng_fs_info_fsid fs_info->fsid -+#endif -+ - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ -@@ -629,7 +635,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, - TP_ARGS(fs_info, block_group, create), - - TP_FIELDS( -- ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, offset, block_group->key.objectid) - ctf_integer(u64, size, block_group->key.offset) - ctf_integer(u64, flags, block_group->flags) -@@ -647,7 +653,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, - TP_ARGS(fs_info, block_group, create), - - TP_FIELDS( -- ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, offset, block_group->key.objectid) - ctf_integer(u64, size, block_group->key.offset) - ctf_integer(u64, flags, block_group->flags) -@@ -1015,18 +1021,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, - -- TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map, -+ TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, - u64 offset, u64 size), - -- TP_ARGS(info, map, offset, size) -+ TP_ARGS(fs_info, map, offset, size) - ) - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, - -- TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map, -+ TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, - u64 offset, u64 size), - -- TP_ARGS(info, map, offset, size) -+ TP_ARGS(fs_info, map, offset, size) - ) - - #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) -@@ -1050,18 +1056,18 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, - -- TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map, -+ TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, - u64 offset, u64 size), - -- TP_ARGS(info, map, offset, size) -+ TP_ARGS(fs_info, map, offset, size) - ) - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, - -- TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map, -+ TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, - u64 offset, u64 size), - -- TP_ARGS(info, map, offset, size) -+ TP_ARGS(fs_info, map, offset, size) - ) - - #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ -@@ -1192,7 +1198,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, - TP_ARGS(fs_info, type, val, bytes, reserve), - - TP_FIELDS( -- ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_string(type, type) - ctf_integer(u64, val, val) - ctf_integer(u64, bytes, bytes) -@@ -1208,7 +1214,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, - TP_ARGS(fs_info, type, val, bytes, reserve), - - TP_FIELDS( -- ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_string(type, type) - ctf_integer(u64, val, val) - ctf_integer(u64, bytes, bytes) -@@ -1221,9 +1227,9 @@ LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, - - LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, - -- TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), -+ TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), - -- TP_ARGS(info, start, len), -+ TP_ARGS(fs_info, start, len), - - TP_FIELDS( - ctf_integer(u64, start, start) -@@ -1233,25 +1239,25 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, - -- TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), -+ TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), - -- TP_ARGS(info, start, len) -+ TP_ARGS(fs_info, start, len) - ) - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, - -- TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len), -+ TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), - -- TP_ARGS(info, start, len) -+ TP_ARGS(fs_info, start, len) - ) - - #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) - - LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, - -- TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), -+ TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), - -- TP_ARGS(info, start, len), -+ TP_ARGS(fs_info, start, len), - - TP_FIELDS( - ctf_integer(u64, start, start) -@@ -1261,16 +1267,16 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, - -- TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), -+ TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), - -- TP_ARGS(info, start, len) -+ TP_ARGS(fs_info, start, len) - ) - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, - -- TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len), -+ TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), - -- TP_ARGS(info, start, len) -+ TP_ARGS(fs_info, start, len) - ) - - #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ -@@ -1341,13 +1347,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - -- TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, -+ TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, - u64 data), - -- TP_ARGS(info, num_bytes, empty_size, data), -+ TP_ARGS(fs_info, num_bytes, empty_size, data), - - TP_FIELDS( -- ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) -@@ -1362,7 +1368,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - TP_ARGS(block_group, start, len), - - TP_FIELDS( -- ctf_array(u8, fsid, block_group->fs_info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) -@@ -1391,13 +1397,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - -- TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, -+ TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, - u64 data), - -- TP_ARGS(info, num_bytes, empty_size, data), -+ TP_ARGS(fs_info, num_bytes, empty_size, data), - - TP_FIELDS( -- ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) -@@ -1406,14 +1412,14 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - -- TP_PROTO(const struct btrfs_fs_info *info, -+ TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - -- TP_ARGS(info, block_group, start, len), -+ TP_ARGS(fs_info, block_group, start, len), - - TP_FIELDS( -- ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) -@@ -1423,20 +1429,20 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, - -- TP_PROTO(const struct btrfs_fs_info *info, -+ TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - -- TP_ARGS(info, block_group, start, len) -+ TP_ARGS(fs_info, block_group, start, len) - ) - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, - -- TP_PROTO(const struct btrfs_fs_info *info, -+ TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - -- TP_ARGS(info, block_group, start, len) -+ TP_ARGS(fs_info, block_group, start, len) - ) - - #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) -@@ -1445,13 +1451,13 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - -- TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size, -+ TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, - u64 data), - -- TP_ARGS(info, num_bytes, empty_size, data), -+ TP_ARGS(fs_info, num_bytes, empty_size, data), - - TP_FIELDS( -- ctf_array(u8, fsid, info->fsid, BTRFS_UUID_SIZE) -+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) -@@ -1460,11 +1466,11 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - -- TP_PROTO(struct btrfs_fs_info *info, -+ TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - -- TP_ARGS(info, block_group, start, len), -+ TP_ARGS(fs_info, block_group, start, len), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->key.objectid) -@@ -1476,20 +1482,20 @@ LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, - -- TP_PROTO(struct btrfs_fs_info *info, -+ TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - -- TP_ARGS(info, block_group, start, len) -+ TP_ARGS(fs_info, block_group, start, len) - ) - - LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, - -- TP_PROTO(struct btrfs_fs_info *info, -+ TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - -- TP_ARGS(info, block_group, start, len) -+ TP_ARGS(fs_info, block_group, start, len) - ) - #elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/0009-Cleanup-tp-mempool-Remove-logically-dead-code.patch b/meta/recipes-kernel/lttng/lttng-modules/0009-Cleanup-tp-mempool-Remove-logically-dead-code.patch deleted file mode 100644 index 4ffe488677..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0009-Cleanup-tp-mempool-Remove-logically-dead-code.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 416cee8707053a9015dfec8332e12f8c263098e3 Mon Sep 17 00:00:00 2001 -From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> -Date: Thu, 14 Feb 2019 11:40:50 -0500 -Subject: [PATCH 9/9] Cleanup: tp mempool: Remove logically dead code - -Found by Coverity: -CID 1391045 (#1 of 1): Logically dead code (DEADCODE) - -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - -Upstream-Status: backport https://github.com/lttng/lttng-modules/commit/416cee8707053a9015dfec8332e12f8c263098e3 - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - lttng-tp-mempool.c | 11 ++--------- - 1 file changed, 2 insertions(+), 9 deletions(-) - -diff --git a/lttng-tp-mempool.c b/lttng-tp-mempool.c -index d984bd4..21e8376 100644 ---- a/lttng-tp-mempool.c -+++ b/lttng-tp-mempool.c -@@ -151,19 +151,12 @@ void lttng_tp_mempool_free(void *ptr) - struct lttng_tp_buf_entry *entry; - struct per_cpu_buf *cpu_buf; - -- if (!ptr) { -+ if (!ptr) - goto end; -- } -- - entry = container_of(ptr, struct lttng_tp_buf_entry, buf); -- if (!entry) { -- goto end; -- } -- - cpu_buf = per_cpu_ptr(pool, entry->cpu); -- if (!cpu_buf) { -+ if (!cpu_buf) - goto end; -- } - /* Add it to the free list. */ - list_add_tail(&entry->list, &cpu_buf->free_list); - --- -2.19.1 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch b/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch deleted file mode 100644 index 76063607a8..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch +++ /dev/null @@ -1,43 +0,0 @@ -From ab07574ef90fa510f293c37897d577066a88fe0d Mon Sep 17 00:00:00 2001 -From: Nathan Lynch <nathan_lynch@mentor.com> -Date: Tue, 25 Apr 2017 16:26:57 -0500 -Subject: [PATCH] BUILD_RUNTIME_BUG_ON vs gcc7 - -Avoid using LTTng's BUILD_RUNTIME_BUG_ON macro, as it appears to run -into a similar problem as Linux experienced with ilog2. - -See: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=474c90156c8dcc2fa815e6716cc9394d7930cb9c -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785 - -Upstream-Status: Pending -Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com> ---- - lib/align.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/align.h b/lib/align.h -index 5b91ae87410b..5e134cd485fe 100644 ---- a/lib/align.h -+++ b/lib/align.h -@@ -48,7 +48,7 @@ - */ - #define offset_align(align_drift, alignment) \ - ({ \ -- BUILD_RUNTIME_BUG_ON((alignment) == 0 \ -+ BUG_ON((alignment) == 0 \ - || ((alignment) & ((alignment) - 1))); \ - (((alignment) - (align_drift)) & ((alignment) - 1)); \ - }) -@@ -63,7 +63,7 @@ - */ - #define offset_align_floor(align_drift, alignment) \ - ({ \ -- BUILD_RUNTIME_BUG_ON((alignment) == 0 \ -+ BUG_ON((alignment) == 0 \ - || ((alignment) & ((alignment) - 1))); \ - (((align_drift) - (alignment)) & ((alignment) - 1)); \ - }) --- -2.9.3 - diff --git a/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch b/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch deleted file mode 100644 index e411242272..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 1b0e574d680101105a6c1e8931c78824f5a97a42 Mon Sep 17 00:00:00 2001 -From: Otavio Salvador <otavio@ossystems.com.br> -Date: Mon, 5 Sep 2016 17:08:56 +0000 -Subject: [PATCH] Makefile: Do not fail if CONFIG_TRACEPOINTS is not enabled -Organization: O.S. Systems Software LTDA. - -The lttng-modules are being pulled by the tools-profile image feature, -however, not every kernel has the CONFIG_TRACEPOINTS feature enabled. - -This change makes the build do not fail when CONFIG_TRACEPOINTS is not -available, allowing it to be kept being pulled by default. - -Upstream-Status: Inappropriate [embedded specific] - -Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> ---- - Makefile | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/Makefile b/Makefile -index 8602649..75550cc 100644 ---- a/Makefile -+++ b/Makefile -@@ -8,10 +8,7 @@ ifneq ($(KERNELRELEASE),) - # and defines the modules to be built. - - ifdef CONFIG_LOCALVERSION # Check if dot-config is included. -- ifeq ($(CONFIG_TRACEPOINTS),) -- $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) -- endif # CONFIG_TRACEPOINTS -- endif # ifdef CONFIG_LOCALVERSION -+ ifneq ($(CONFIG_TRACEPOINTS),) - - TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST))) - -@@ -94,6 +91,10 @@ ifneq ($(KERNELRELEASE),) - obj-$(CONFIG_LTTNG) += lib/ - obj-$(CONFIG_LTTNG) += tests/ - -+ else -+ $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) -+ endif # CONFIG_TRACEPOINTS -+ endif # ifdef CONFIG_LOCALVERSION - else # KERNELRELEASE - - # This part of the Makefile is used when the 'make' command is runned in the --- -2.1.4 - diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.10.8.bb b/meta/recipes-kernel/lttng/lttng-modules_2.10.8.bb deleted file mode 100644 index 15e75e51c9..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules_2.10.8.bb +++ /dev/null @@ -1,45 +0,0 @@ -SECTION = "devel" -SUMMARY = "Linux Trace Toolkit KERNEL MODULE" -DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules" -LICENSE = "LGPLv2.1 & GPLv2 & MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=c4613d1f8a9587bd7b366191830364b3 \ - file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \ - file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad \ - " - -inherit module - -COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm|riscv).*-linux' - -#https://lttng.org/files/lttng-modules/lttng-modules-2.10.7.tar.bz2 -SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ - file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ - file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \ - file://0001-Fix-signal-Distinguish-between-kernel_siginfo-and-si.patch \ - file://0002-Fix-signal-Remove-SEND_SIG_FORCED-v4.20.patch \ - file://0003-Fix-ext4-adjust-reserved-cluster-count-when-removing.patch \ - file://0004-Fix-timer-instrumentation-for-RHEL-7.6.patch \ - file://0005-Fix-Remove-type-argument-from-access_ok-function-v5..patch \ - file://0006-Fix-Replace-pointer-values-with-task-tk_pid-and-rpc_.patch \ - file://0007-Fix-SUNRPC-Simplify-defining-common-RPC-trace-events.patch \ - file://0008-Fix-btrfs-Remove-fsid-metadata_fsid-fields-from-btrf.patch \ - file://0009-Cleanup-tp-mempool-Remove-logically-dead-code.patch \ - " - -SRC_URI[md5sum] = "54bd9fca61487bbec1b3fca2f2213c98" -SRC_URI[sha256sum] = "fe1d269bca723e8948af871c322c37d3900e647cdc5eb3efbe821e434beee44c" - -export INSTALL_MOD_DIR="kernel/lttng-modules" - -EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'" - -do_install_append() { - # Delete empty directories to avoid QA failures if no modules were built - find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \; -} - -python do_package_prepend() { - if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')): - bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN')) -} - diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.14.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.14.bb new file mode 100644 index 0000000000..5b1e61f3be --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.14.bb @@ -0,0 +1,47 @@ +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 = "LGPL-2.1-only & GPL-2.0-only & MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=8d0d9f08888046474772a5d745d89d6a" + +inherit module + +include lttng-platforms.inc + +SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ + file://0001-Fix-kfree_skb-changed-in-6.11-rc1.patch \ + file://0002-Fix-ext4_da_reserve_space-changed-in-6.11-rc1.patch \ + file://0003-Fix-orig_start-removed-from-btrfs_get_extent-in-6.11.patch \ + file://0004-Fix-block_len-removed-frmo-btrfs_get_extent-in-6.11-.patch \ + file://0005-Fix-block_start-removed-from-btrfs_get_extent-in-6.1.patch \ + file://0006-Fix-scsi-sd-Atomic-write-support-added-in-6.11-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] = "c6449f7ff12ab644a630692a556304e51525ca37d98aebf826796918be0f5da6" + +export INSTALL_MOD_DIR="kernel/lttng-modules" + +EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'" + +MODULES_MODULE_SYMVERS_LOCATION = "src" + +do_install:append() { + # Delete empty directories to avoid QA failures if no modules were built + if [ -d ${D}/${nonarch_base_libdir} ]; then + find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \; + fi +} + +python do_package:prepend() { + if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')): + bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN')) +} + +BBCLASSEXTEND = "devupstream:target" +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 new file mode 100644 index 0000000000..900e36df82 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-platforms.inc @@ -0,0 +1,21 @@ +# +# Whether the platform supports kernel tracing +# +LTTNGMODULES = "lttng-modules" +LTTNGMODULES:arc = "" +LTTNGMODULES:riscv64 = "" + +COMPATIBLE_HOST:riscv64:pn-lttng-modules = "null" +COMPATIBLE_HOST:arc:pn-lttng-modules = "null" + +# Whether the platform supports userspace tracing +# lttng-ust uses sched_getcpu() which is not there on for some platforms. +LTTNGUST = "lttng-ust" +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-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-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch deleted file mode 100644 index df18dc842b..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 7244eac44be929fabd6ed1333f96929ef8da564f Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Tue, 19 Mar 2019 17:56:49 +0000 -Subject: [PATCH] fix: tests: link libpause_consumer on liblttng-ctl - -This preload test library uses symbols from liblttng-ctl which are -resolved when preloaded by GLIBC but not by MUSL. - -Upstream-Status: Accepted [f667fbd7f8b9512f9943edb2597c226fcc424ee9] -Backported to 2.11 and 2.10. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> ---- - tests/regression/tools/notification/Makefile.am | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/tests/regression/tools/notification/Makefile.am b/tests/regression/tools/notification/Makefile.am -index 41adc69..a352bb8 100644 ---- a/tests/regression/tools/notification/Makefile.am -+++ b/tests/regression/tools/notification/Makefile.am -@@ -20,7 +20,10 @@ FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ - -rpath $(abs_builddir) - - libpause_consumer_la_SOURCES = consumer_testpoints.c --libpause_consumer_la_LIBADD = $(top_builddir)/src/common/libcommon.la $(DL_LIBS) -+libpause_consumer_la_LIBADD = \ -+ $(top_builddir)/src/common/libcommon.la \ -+ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ -+ $(DL_LIBS) - libpause_consumer_la_LDFLAGS = $(FORCE_SHARED_LIB_OPTIONS) - noinst_LTLIBRARIES = libpause_consumer.la - --- -2.17.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-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 new file mode 100644 index 0000000000..2f95889c4b --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch @@ -0,0 +1,24 @@ +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 + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | 2 +- + 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 836f13e..e19a554 100644 +--- a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am ++++ b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am +@@ -14,7 +14,7 @@ userspace_probe_elf_binary_LDADD = libfoo.la + libfoo.strip: libfoo.la + $(OBJCOPY) --strip-all .libs/libfoo.so + +-all-local: libfoo.strip ++all-local: + @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ + for script in $(EXTRA_DIST); do \ + cp -f $(srcdir)/$$script $(builddir); \ diff --git a/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch b/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch deleted file mode 100644 index 5bb88d21e5..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch +++ /dev/null @@ -1,52 +0,0 @@ -From e7db27668a9d7fd279d45bc43f3a2d5847374e7b Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Tue, 12 Mar 2019 12:04:58 -0400 -Subject: [PATCH lttng-tools 1/2] Fix: test: skip test_getcpu_override on - single thread system - -There is no value in performing this test on single thread system -since the only valid value for the cpu field is 0. - -This test currently fails on single thread system (i.e yocto runquemu) -on the test_getcpu_override_fail test case. - -Upstream-Status: Accepted [f87d0ca370c17b597762f5ee218f0e821ed2452d] -Backported to 2.11 and 2.10 - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> ---- - .../ust/getcpu-override/test_getcpu_override | 16 +++++++++++----- - 1 file changed, 11 insertions(+), 5 deletions(-) - -diff --git a/tests/regression/ust/getcpu-override/test_getcpu_override b/tests/regression/ust/getcpu-override/test_getcpu_override -index 4ca385aeb..ee3e31953 100755 ---- a/tests/regression/ust/getcpu-override/test_getcpu_override -+++ b/tests/regression/ust/getcpu-override/test_getcpu_override -@@ -157,13 +157,19 @@ plan_tests $NUM_TESTS - - print_test_banner "$TEST_DESC" - --if [ -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then -- foundobj=1 --else -- foundobj=0 -+if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then -+ skip 0 "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0 -+fi -+ -+if [ "$num_cpus" -eq "1" ]; then -+ # Skip the test since we cannot perform it as designed since N mod 1 -+ # is always equals to zero. There is no point testing this on a system -+ # with a single thread. LTTng-UST limits the get_cpu function to return -+ # value inside the [0, NUM_CPU - 1] range for a valid event (present in -+ # trace). -+ skip 0 "Test system only have a single thread. Skipping all tests." $NUM_TESTS && exit 0 - fi - --skip $foundobj "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0 - - TESTS=( - test_getcpu_override_fail --- -2.17.1 - diff --git a/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch b/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch deleted file mode 100644 index 822b26a367..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 83d165442d1c3658b6bafa28ddade8ffee7092ad Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Wed, 6 Mar 2019 16:46:49 -0500 -Subject: [PATCH lttng-tools 2/2] Fix: test: unit: the tree origin can be a - symlink itself - -Problem: - -The base tree is defined as "/tmp/.....XXXXXX". -On systems where "/tmp/" is itself a symlink utils_expand_path will -expand the tree origin itself. - -For example on a base core-image-minimal Yocto build /tmp is a symlink -to "/var/tmp", which is a symlink to "/var/volatile". - -utils_expand_path will return something like this for the symlink test: -"/var/volative/.....XXXXXX/...." which is the valid result. - -Solution: - -Simply use realpath on the tree_origin and use this path to perform the -test validation. - -This work was performed in the effort to support yocto fully and be able -to run the test suite to detect problem as early as possible. - - -Upstream-Status: Accepted [f66e964a2e0c75f5e1a55fbcc963b1c5e2b4519d] -Backported to 2.11 and 2.10 - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> ---- - tests/unit/test_utils_expand_path.c | 18 ++++++++++++++---- - 1 file changed, 14 insertions(+), 4 deletions(-) - -diff --git a/tests/unit/test_utils_expand_path.c b/tests/unit/test_utils_expand_path.c -index d5cab002e..d047c207d 100644 ---- a/tests/unit/test_utils_expand_path.c -+++ b/tests/unit/test_utils_expand_path.c -@@ -281,8 +281,8 @@ error: - static void test_utils_expand_path(void) - { - char *result; -- char name[100], tmppath[PATH_MAX]; -- int i; -+ char name[100], tmppath[PATH_MAX], real_tree_origin[PATH_MAX]; -+ int i, treelen; - - /* Test valid cases */ - for (i = 0; i < num_valid_tests; i++) { -@@ -295,14 +295,24 @@ static void test_utils_expand_path(void) - free(result); - } - -+ /* -+ * Get the realpath for the tree_origin since it can itself be a -+ * symlink. -+ */ -+ result = realpath(tree_origin, real_tree_origin); -+ if (!result) { -+ fail("realpath failed."); -+ return; -+ } -+ - /* Test symlink tree cases */ -- int treelen = strlen(tree_origin) + 1; -+ treelen = strlen(real_tree_origin) + 1; - for (i = 0; i < num_symlink_tests; i++) { - sprintf(name, "symlink tree test case: [tmppath/]%s", - symlink_tests_inputs[i].input); - - snprintf(tmppath, PATH_MAX, "%s/%s", -- tree_origin, symlink_tests_inputs[i].input); -+ real_tree_origin, symlink_tests_inputs[i].input); - result = utils_expand_path(tmppath); - ok(result != NULL && strcmp(result + treelen, - symlink_tests_inputs[i].expected_result) == 0, name); --- -2.17.1 - diff --git a/meta/recipes-kernel/lttng/lttng-tools/0004-Skip-when-testapp-is-not-present.patch b/meta/recipes-kernel/lttng/lttng-tools/0004-Skip-when-testapp-is-not-present.patch deleted file mode 100644 index 6c9f7e462c..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0004-Skip-when-testapp-is-not-present.patch +++ /dev/null @@ -1,610 +0,0 @@ -From 95c27e6acceaeda55c729b9e92e594322adef13f Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Wed, 3 Apr 2019 16:31:18 -0400 -Subject: [PATCH lttng-tools] Skip when testapp is not present - -We expect lttng-ust do be present, this is a wrong assumptions. - -This is a quick fix. The real fix is to either detect at runtime -lttng-ust support or at build time (HAVE_LIBLTTNG_UST_CTL). - -This prevent hang for make check done on a build configured with ---without-lttng-ust. - -Upstream-Status: Inappropriate [other] -Reason: This patch is inappropriate for upstream for 2.10 stable release -since we do not backport "superficial" fix to the test suite. We do -backport when a test is broken. The fact that on --without-lttng-ust -hang is not a "broken" test per-see. Still, a variation of this fix will -be upstreamed in our master branch and possibly 2.11. The upstreamed -version will split the test in kernel/ust test and skip them at the -build system level. This patch is more succinct. - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> ---- - tests/regression/tools/crash/test_crash | 4 ++ - .../regression/tools/exclusion/test_exclusion | 4 ++ - .../tools/filtering/test_valid_filter | 21 ++++-- - tests/regression/tools/health/test_thread_ok | 29 +++++--- - tests/regression/tools/live/Makefile.am | 2 - - tests/regression/tools/live/test_lttng_ust | 4 ++ - tests/regression/tools/live/test_ust | 4 ++ - .../tools/live/test_ust_tracefile_count | 4 ++ - tests/regression/tools/mi/test_mi | 4 ++ - .../notification/test_notification_multi_app | 18 +++-- - .../tools/notification/test_notification_ust | 4 ++ - .../regression/tools/regen-metadata/test_ust | 2 +- - .../regression/tools/regen-statedump/test_ust | 2 +- - .../regression/tools/save-load/test_autoload | 7 ++ - tests/regression/tools/save-load/test_load | 8 +++ - tests/regression/tools/save-load/test_save | 7 ++ - .../regression/tools/snapshots/test_ust_fast | 2 +- - .../regression/tools/snapshots/test_ust_long | 2 +- - .../tools/snapshots/test_ust_streaming | 2 +- - tests/regression/tools/snapshots/ust_test | 2 +- - .../streaming/test_high_throughput_limits | 2 +- - tests/regression/tools/streaming/test_ust | 2 +- - .../tracefile-limits/test_tracefile_count | 2 +- - .../tracefile-limits/test_tracefile_size | 2 +- - .../tools/wildcard/test_event_wildcard | 67 ++++++++++--------- - 25 files changed, 147 insertions(+), 60 deletions(-) - -diff --git a/tests/regression/tools/crash/test_crash b/tests/regression/tools/crash/test_crash -index 8c62c513d..3cbe97688 100755 ---- a/tests/regression/tools/crash/test_crash -+++ b/tests/regression/tools/crash/test_crash -@@ -35,6 +35,10 @@ NUM_TESTS=77 - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - # Global declaration for simplification - LTTNG_CRASH=$TESTDIR/../src/bin/lttng-crash/$CRASH_BIN - -diff --git a/tests/regression/tools/exclusion/test_exclusion b/tests/regression/tools/exclusion/test_exclusion -index 949cd41df..42e4d72fb 100755 ---- a/tests/regression/tools/exclusion/test_exclusion -+++ b/tests/regression/tools/exclusion/test_exclusion -@@ -30,6 +30,10 @@ NUM_TESTS=149 - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - function enable_ust_lttng_all_event_exclusion() - { - sess_name="$1" -diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter -index 163b32182..1e8da630b 100755 ---- a/tests/regression/tools/filtering/test_valid_filter -+++ b/tests/regression/tools/filtering/test_valid_filter -@@ -418,12 +418,18 @@ issue_356_filter+="intfield > 4 && intfield > 5 && " - issue_356_filter+="intfield > 6 && intfield > 7 && " - issue_356_filter+="intfield > 8 || intfield > 0" - -+BIN_NAME="gen-ust-events" -+ -+skip_ust=1 -+if [ ! -x "$CURDIR/$BIN_NAME" ]; then -+ skip_ust=0 -+ skip 0 "No UST nevents binary detected." $NUM_UST_TESTS -+fi -+ - start_lttng_sessiond - - ### UST TESTS - --BIN_NAME="gen-ust-events" -- - KIRK_KRAUSS_TESTS=( - # the tests below were written by Kirk Krauss in this article: - # http://www.drdobbs.com/architecture-and-design/matching-wildcards-an-empirical-way-to-t/240169123 -@@ -897,9 +903,6 @@ UST_STR_FILTERS=( - END - ) - --if [ ! -x "$CURDIR/$BIN_NAME" ]; then -- BAIL_OUT "No UST nevents binary detected." --fi - - IFS="$OLDIFS" - -@@ -910,6 +913,10 @@ i=0 - while true; do - validator="${UST_FILTERS[$i]}" - -+ if [ $skip_ust -eq 0 ]; then -+ break -+ fi -+ - if [ "$validator" = END ]; then - break - fi -@@ -929,6 +936,10 @@ i=0 - while true; do - validator="${UST_STR_FILTERS[$i]}" - -+ if [ $skip_ust -eq 0 ]; then -+ break -+ fi -+ - if [ "$validator" = END ]; then - break - fi -diff --git a/tests/regression/tools/health/test_thread_ok b/tests/regression/tools/health/test_thread_ok -index e81d6ed24..849b7e71f 100755 ---- a/tests/regression/tools/health/test_thread_ok -+++ b/tests/regression/tools/health/test_thread_ok -@@ -27,6 +27,9 @@ CHANNEL_NAME="testchan" - HEALTH_CHECK_BIN="health_check" - NUM_TESTS=17 - SLEEP_TIME=30 -+TESTAPP_PATH="$TESTDIR/utils/testapp" -+TESTAPP_NAME="gen-ust-events" -+TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" - - source $TESTDIR/utils/utils.sh - -@@ -76,15 +79,19 @@ function test_thread_ok - $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH} - report_errors - -- diag "With UST consumer daemons" -- create_lttng_session_no_output $SESSION_NAME -- enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME -- start_lttng_tracing_ok $SESSION_NAME -- destroy_lttng_session_ok $SESSION_NAME -+ skip $skip_ust "Ust does not seems to be supported" "5" || -+ { -+ diag "With UST consumer daemons" -+ create_lttng_session_no_output $SESSION_NAME -+ enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME -+ start_lttng_tracing_ok $SESSION_NAME -+ destroy_lttng_session_ok $SESSION_NAME - -- # Check health status -- $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH} -- report_errors -+ -+ # Check health status -+ $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH} -+ report_errors -+ } - - skip $isroot "Root access is needed. Skipping kernel consumer health check test." "5" || - { -@@ -141,6 +148,12 @@ else - isroot=0 - fi - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ skip_ust=0 -+else -+ skip_ust=1 -+fi -+ - test_thread_ok - - rm -rf ${HEALTH_PATH} -diff --git a/tests/regression/tools/live/Makefile.am b/tests/regression/tools/live/Makefile.am -index 46186d383..db74de8d5 100644 ---- a/tests/regression/tools/live/Makefile.am -+++ b/tests/regression/tools/live/Makefile.am -@@ -16,9 +16,7 @@ LIVE=$(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \ - noinst_PROGRAMS = live_test - EXTRA_DIST = test_kernel test_lttng_kernel - --if HAVE_LIBLTTNG_UST_CTL - EXTRA_DIST += test_ust test_ust_tracefile_count test_lttng_ust --endif - - live_test_SOURCES = live_test.c - live_test_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \ -diff --git a/tests/regression/tools/live/test_lttng_ust b/tests/regression/tools/live/test_lttng_ust -index 06017d01d..be9b3d7f7 100755 ---- a/tests/regression/tools/live/test_lttng_ust -+++ b/tests/regression/tools/live/test_lttng_ust -@@ -38,6 +38,10 @@ NUM_TESTS=12 - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - # MUST set TESTDIR before calling those functions - plan_tests $NUM_TESTS - -diff --git a/tests/regression/tools/live/test_ust b/tests/regression/tools/live/test_ust -index 0384a706f..add521bfc 100755 ---- a/tests/regression/tools/live/test_ust -+++ b/tests/regression/tools/live/test_ust -@@ -36,6 +36,10 @@ DIR=$(readlink -f $TESTDIR) - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - echo "$TEST_DESC" - - function setup_live_tracing() -diff --git a/tests/regression/tools/live/test_ust_tracefile_count b/tests/regression/tools/live/test_ust_tracefile_count -index 6da368fc6..10504f8c6 100755 ---- a/tests/regression/tools/live/test_ust_tracefile_count -+++ b/tests/regression/tools/live/test_ust_tracefile_count -@@ -36,6 +36,10 @@ DIR=$(readlink -f $TESTDIR) - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - echo "$TEST_DESC" - - function setup_live_tracing() -diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi -index 48dda7da6..2cc30b29a 100755 ---- a/tests/regression/tools/mi/test_mi -+++ b/tests/regression/tools/mi/test_mi -@@ -61,6 +61,10 @@ NUM_TESTS=228 - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - #Overwrite the lttng_bin to get mi output - LTTNG_BIN="lttng --mi xml" - -diff --git a/tests/regression/tools/notification/test_notification_multi_app b/tests/regression/tools/notification/test_notification_multi_app -index 0a05ea6a0..29b0f62fa 100755 ---- a/tests/regression/tools/notification/test_notification_multi_app -+++ b/tests/regression/tools/notification/test_notification_multi_app -@@ -52,6 +52,11 @@ plan_tests $NUM_TESTS - - print_test_banner "$TEST_DESC" - -+skip_ust=1 -+if [ ! -x "$TESTAPP_BIN" ]; then -+ skip_ust=0 -+fi -+ - app_pids=() - - function kernel_event_generator_toogle_state -@@ -468,10 +473,15 @@ function test_on_register_evaluation () - } - - --TESTS=( -- test_multi_app_ust -- test_on_register_evaluation_ust --) -+TESTS=() -+if [ $skip_ust -eq "1" ]; then -+ TESTS+=( -+ test_multi_app_ust -+ test_on_register_evaluation_ust -+ ) -+else -+ skip 0 "No UST events binary detected." $NUM_TEST_UST -+fi - - if [ "$(id -u)" == "0" ]; then - TESTS+=( -diff --git a/tests/regression/tools/notification/test_notification_ust b/tests/regression/tools/notification/test_notification_ust -index 8941e476d..eb2e15cad 100755 ---- a/tests/regression/tools/notification/test_notification_ust -+++ b/tests/regression/tools/notification/test_notification_ust -@@ -46,6 +46,10 @@ DIR=$(readlink -f $TESTDIR) - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - function ust_event_generator_toogle_state - { - ust_event_generator_suspended=$((ust_event_generator_suspended==0)) -diff --git a/tests/regression/tools/regen-metadata/test_ust b/tests/regression/tools/regen-metadata/test_ust -index b7f1af1d8..312c8a40d 100755 ---- a/tests/regression/tools/regen-metadata/test_ust -+++ b/tests/regression/tools/regen-metadata/test_ust -@@ -34,7 +34,7 @@ NUM_TESTS=33 - source $TESTDIR/utils/utils.sh - - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST events binary detected." -+ plan_skip_all "No UST events binary detected." - fi - - function lttng_create_session_uri -diff --git a/tests/regression/tools/regen-statedump/test_ust b/tests/regression/tools/regen-statedump/test_ust -index 486b9a560..8d455b26a 100755 ---- a/tests/regression/tools/regen-statedump/test_ust -+++ b/tests/regression/tools/regen-statedump/test_ust -@@ -34,7 +34,7 @@ NUM_TESTS=11 - source $TESTDIR/utils/utils.sh - - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST events binary detected." -+ plan_skip_all "No UST events binary detected." - fi - - function test_ust_local () -diff --git a/tests/regression/tools/save-load/test_autoload b/tests/regression/tools/save-load/test_autoload -index 7ee5e9906..ec376cfb3 100755 ---- a/tests/regression/tools/save-load/test_autoload -+++ b/tests/regression/tools/save-load/test_autoload -@@ -21,6 +21,9 @@ CURDIR=$(dirname $0)/ - CONFIG_DIR="${CURDIR}/configuration" - TESTDIR=$CURDIR/../../../ - export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/) -+TESTAPP_PATH="$TESTDIR/utils/testapp" -+TESTAPP_NAME="gen-ust-events" -+TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" - - DIR=$(readlink -f $TESTDIR) - -@@ -28,6 +31,10 @@ NUM_TESTS=9 - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - # MUST set TESTDIR before calling those functions - plan_tests $NUM_TESTS - -diff --git a/tests/regression/tools/save-load/test_load b/tests/regression/tools/save-load/test_load -index 5e38b46b6..b6fdd8192 100755 ---- a/tests/regression/tools/save-load/test_load -+++ b/tests/regression/tools/save-load/test_load -@@ -20,6 +20,10 @@ TEST_DESC="Load session(s)" - CURDIR=$(dirname $0)/ - CONFIG_DIR="${CURDIR}/configuration" - TESTDIR=$CURDIR/../../../ -+TESTAPP_PATH="$TESTDIR/utils/testapp" -+TESTAPP_NAME="gen-ust-events" -+TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" -+ - export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/) - - SESSION_NAME="load-42" -@@ -31,6 +35,10 @@ NUM_TESTS=67 - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "$TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - # MUST set TESTDIR before calling those functions - plan_tests $NUM_TESTS - -diff --git a/tests/regression/tools/save-load/test_save b/tests/regression/tools/save-load/test_save -index c5f6b1341..cfaf67b7a 100755 ---- a/tests/regression/tools/save-load/test_save -+++ b/tests/regression/tools/save-load/test_save -@@ -23,6 +23,9 @@ TESTDIR=$CURDIR/../../../ - SESSION_NAME="save-42" - CHANNEL_NAME="chan-save" - EVENT_NAME="tp:tptest" -+TESTAPP_PATH="$TESTDIR/utils/testapp" -+TESTAPP_NAME="gen-ust-events" -+TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" - - DIR=$(readlink -f $TESTDIR) - -@@ -30,6 +33,10 @@ NUM_TESTS=41 - - source $TESTDIR/utils/utils.sh - -+if [ ! -x "TESTAPP_BIN" ]; then -+ plan_skip_all "No UST events binary detected." -+fi -+ - # MUST set TESTDIR before calling those functions - plan_tests $NUM_TESTS - -diff --git a/tests/regression/tools/snapshots/test_ust_fast b/tests/regression/tools/snapshots/test_ust_fast -index edb435c52..5a68ec56d 100755 ---- a/tests/regression/tools/snapshots/test_ust_fast -+++ b/tests/regression/tools/snapshots/test_ust_fast -@@ -23,7 +23,7 @@ TEST_BIN="ust_test" - source $TESTDIR/utils/utils.sh - - if [ ! -x "$CURDIR/$TEST_BIN" ]; then -- BAIL_OUT "No UST test found: $TEST_BIN" -+ plan_skip_all "No UST test found: $TEST_BIN" - fi - - ./$CURDIR/$TEST_BIN $NR_SNAPSHOT -diff --git a/tests/regression/tools/snapshots/test_ust_long b/tests/regression/tools/snapshots/test_ust_long -index 9e1a0c262..afa019f6a 100755 ---- a/tests/regression/tools/snapshots/test_ust_long -+++ b/tests/regression/tools/snapshots/test_ust_long -@@ -23,7 +23,7 @@ TEST_BIN="ust_test" - source $TESTDIR/utils/utils.sh - - if [ ! -x "$CURDIR/$TEST_BIN" ]; then -- BAIL_OUT "No UST test found: $TEST_BIN" -+ plan_skip_all "No UST test found: $TEST_BIN" - fi - - ./$CURDIR/$TEST_BIN $NR_SNAPSHOT -diff --git a/tests/regression/tools/snapshots/test_ust_streaming b/tests/regression/tools/snapshots/test_ust_streaming -index 93b0957f3..69291ab4d 100755 ---- a/tests/regression/tools/snapshots/test_ust_streaming -+++ b/tests/regression/tools/snapshots/test_ust_streaming -@@ -37,7 +37,7 @@ NUM_TESTS=75 - source $TESTDIR/utils/utils.sh - - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST events binary detected." -+ plan_skip_all "No UST events binary detected." - fi - - function snapshot_add_output () -diff --git a/tests/regression/tools/snapshots/ust_test b/tests/regression/tools/snapshots/ust_test -index 755cef9e0..92f9f6cff 100755 ---- a/tests/regression/tools/snapshots/ust_test -+++ b/tests/regression/tools/snapshots/ust_test -@@ -34,7 +34,7 @@ TRACE_PATH=$(mktemp -d) - source $TESTDIR/utils/utils.sh - - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST events binary detected." -+ plan_skip_all "No UST events binary detected." - fi - - # Need the number of snapshot to do. -diff --git a/tests/regression/tools/streaming/test_high_throughput_limits b/tests/regression/tools/streaming/test_high_throughput_limits -index 32c3f1f2b..f54178923 100755 ---- a/tests/regression/tools/streaming/test_high_throughput_limits -+++ b/tests/regression/tools/streaming/test_high_throughput_limits -@@ -38,7 +38,7 @@ NUM_TESTS=104 - source $TESTDIR/utils/utils.sh - - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST events binary detected." -+ plan_skip_all "No UST events binary detected." - fi - - function set_bw_limit -diff --git a/tests/regression/tools/streaming/test_ust b/tests/regression/tools/streaming/test_ust -index a5d5b5e92..e1dd98ee7 100755 ---- a/tests/regression/tools/streaming/test_ust -+++ b/tests/regression/tools/streaming/test_ust -@@ -34,7 +34,7 @@ NUM_TESTS=16 - source $TESTDIR/utils/utils.sh - - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST events binary detected." -+ plan_skip_all "No UST events binary detected." - fi - - function lttng_create_session_uri -diff --git a/tests/regression/tools/tracefile-limits/test_tracefile_count b/tests/regression/tools/tracefile-limits/test_tracefile_count -index 6ada8580f..7553c7d1f 100755 ---- a/tests/regression/tools/tracefile-limits/test_tracefile_count -+++ b/tests/regression/tools/tracefile-limits/test_tracefile_count -@@ -33,7 +33,7 @@ PAGE_SIZE=$(getconf PAGE_SIZE) - source $TESTDIR/utils/utils.sh - - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST events binary detected." -+ plan_skip_all "No UST events binary detected." - fi - - function enable_lttng_channel_count_limit () -diff --git a/tests/regression/tools/tracefile-limits/test_tracefile_size b/tests/regression/tools/tracefile-limits/test_tracefile_size -index 3dddbe613..1089487ff 100755 ---- a/tests/regression/tools/tracefile-limits/test_tracefile_size -+++ b/tests/regression/tools/tracefile-limits/test_tracefile_size -@@ -33,7 +33,7 @@ NUM_TESTS=66 - source $TESTDIR/utils/utils.sh - - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST events binary detected." -+ plan_skip_all "No UST events binary detected." - fi - - function enable_lttng_channel_size_limit () -diff --git a/tests/regression/tools/wildcard/test_event_wildcard b/tests/regression/tools/wildcard/test_event_wildcard -index 61ea67a72..921a2301d 100755 ---- a/tests/regression/tools/wildcard/test_event_wildcard -+++ b/tests/regression/tools/wildcard/test_event_wildcard -@@ -97,42 +97,47 @@ print_test_banner "$TEST_DESC" - - start_lttng_sessiond - --diag "Test UST wildcard" -- - if [ ! -x "$TESTAPP_BIN" ]; then -- BAIL_OUT "No UST nevents binary detected." -+ skip_ust=0 -+else -+ skip_ust=1 - fi - --EVENT_NAME="tp:tptest" -+skip $skip_ust "No UST nevents binary detected." $NUM_UST_TESTS || -+{ -+ diag "Test UST wildcard" - --# non-matching --test_event_wildcard ust 0 'tp:abc*' --test_event_wildcard ust 0 '*abc' --test_event_wildcard ust 0 '*z*' --test_event_wildcard ust 0 '*\**' --test_event_wildcard ust 0 '*\*' --test_event_wildcard ust 0 '\**' --test_event_wildcard ust 0 '*:*tpte*s' --test_event_wildcard ust 0 'tp**tpTest' -+ EVENT_NAME="tp:tptest" - --# matching --test_event_wildcard ust 1 'tp:tp*' --test_event_wildcard ust 1 '*' --test_event_wildcard ust 1 'tp:tptest*' --test_event_wildcard ust 1 '**' --test_event_wildcard ust 1 '***' --test_event_wildcard ust 1 '*tptest' --test_event_wildcard ust 1 '**tptest' --test_event_wildcard ust 1 '*tpte*' --test_event_wildcard ust 1 '*tp*' --test_event_wildcard ust 1 '*tp**' --test_event_wildcard ust 1 '*:*tptest' --test_event_wildcard ust 1 '*:*tpte*t' --test_event_wildcard ust 1 't*p*:*t*e*s*t' --test_event_wildcard ust 1 '*t*p*:*t*e*s*t*' --test_event_wildcard ust 1 'tp*tptest' --test_event_wildcard ust 1 'tp**tptest' --test_event_wildcard ust 1 'tp*test' -+ # non-matching -+ test_event_wildcard ust 0 'tp:abc*' -+ test_event_wildcard ust 0 '*abc' -+ test_event_wildcard ust 0 '*z*' -+ test_event_wildcard ust 0 '*\**' -+ test_event_wildcard ust 0 '*\*' -+ test_event_wildcard ust 0 '\**' -+ test_event_wildcard ust 0 '*:*tpte*s' -+ test_event_wildcard ust 0 'tp**tpTest' -+ -+ # matching -+ test_event_wildcard ust 1 'tp:tp*' -+ test_event_wildcard ust 1 '*' -+ test_event_wildcard ust 1 'tp:tptest*' -+ test_event_wildcard ust 1 '**' -+ test_event_wildcard ust 1 '***' -+ test_event_wildcard ust 1 '*tptest' -+ test_event_wildcard ust 1 '**tptest' -+ test_event_wildcard ust 1 '*tpte*' -+ test_event_wildcard ust 1 '*tp*' -+ test_event_wildcard ust 1 '*tp**' -+ test_event_wildcard ust 1 '*:*tptest' -+ test_event_wildcard ust 1 '*:*tpte*t' -+ test_event_wildcard ust 1 't*p*:*t*e*s*t' -+ test_event_wildcard ust 1 '*t*p*:*t*e*s*t*' -+ 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 --- -2.17.1 - diff --git a/meta/recipes-kernel/lttng/lttng-tools/0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch b/meta/recipes-kernel/lttng/lttng-tools/0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch deleted file mode 100644 index 16df3e610a..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 9bc81a446d0a3ea9a884739eee48d3f14db3283c Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Wed, 28 Mar 2018 15:21:26 -0400 -Subject: [PATCH lttng-tools] Tests: use modprobe to test for the presence of - lttng-modules -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Upstream-Status: Backport [28702730192ae1ded06105c54c5dc] - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> ---- - tests/regression/tools/regen-metadata/test_kernel | 8 ++------ - tests/regression/tools/regen-statedump/test_kernel | 7 +------ - tests/regression/tools/snapshots/test_kernel | 9 +++------ - tests/regression/tools/snapshots/test_kernel_streaming | 8 ++------ - tests/regression/tools/streaming/test_kernel | 8 ++------ - tests/utils/utils.sh | 10 ++++++++++ - 6 files changed, 20 insertions(+), 30 deletions(-) - -diff --git a/tests/regression/tools/regen-metadata/test_kernel b/tests/regression/tools/regen-metadata/test_kernel -index fd139aeef..1849b9cd0 100755 ---- a/tests/regression/tools/regen-metadata/test_kernel -+++ b/tests/regression/tools/regen-metadata/test_kernel -@@ -28,12 +28,6 @@ NUM_TESTS=18 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function lttng_create_session_uri - { - # Create session with default path -@@ -91,6 +85,8 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || - { -+ validate_lttng_modules_present -+ - start_lttng_relayd "-o $TRACE_PATH" - start_lttng_sessiond - modprobe lttng-test -diff --git a/tests/regression/tools/regen-statedump/test_kernel b/tests/regression/tools/regen-statedump/test_kernel -index 85afe76a1..50054eb07 100755 ---- a/tests/regression/tools/regen-statedump/test_kernel -+++ b/tests/regression/tools/regen-statedump/test_kernel -@@ -29,12 +29,6 @@ NUM_TESTS=11 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function test_kernel_local () - { - diag "Test kernel local with statedump regeneration" -@@ -64,6 +58,7 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || - { -+ validate_lttng_modules_present - start_lttng_sessiond - modprobe lttng-test - -diff --git a/tests/regression/tools/snapshots/test_kernel b/tests/regression/tools/snapshots/test_kernel -index 886c4557a..ff563100b 100755 ---- a/tests/regression/tools/snapshots/test_kernel -+++ b/tests/regression/tools/snapshots/test_kernel -@@ -29,12 +29,6 @@ NUM_TESTS=2060 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function test_kernel_local_snapshot () - { - diag "Test local kernel snapshots" -@@ -241,6 +235,9 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel snapshot tests." $NUM_TESTS || - { -+ -+ validate_lttng_modules_present -+ - start_lttng_sessiond - - #tests=( test_kernel_1000_local_snapshots ) -diff --git a/tests/regression/tools/snapshots/test_kernel_streaming b/tests/regression/tools/snapshots/test_kernel_streaming -index 7b96ef270..1d97519aa 100755 ---- a/tests/regression/tools/snapshots/test_kernel_streaming -+++ b/tests/regression/tools/snapshots/test_kernel_streaming -@@ -29,12 +29,6 @@ NUM_TESTS=61 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function snapshot_add_output () - { - local sess_name=$1 -@@ -169,6 +163,8 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || - { -+ validate_lttng_modules_present -+ - start_lttng_relayd "-o $TRACE_PATH" - start_lttng_sessiond - -diff --git a/tests/regression/tools/streaming/test_kernel b/tests/regression/tools/streaming/test_kernel -index d54bcedf5..6bb23d9f5 100755 ---- a/tests/regression/tools/streaming/test_kernel -+++ b/tests/regression/tools/streaming/test_kernel -@@ -28,12 +28,6 @@ NUM_TESTS=10 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function lttng_create_session_uri - { - # Create session with default path -@@ -80,6 +74,8 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || - { -+ validate_lttng_modules_present -+ - start_lttng_relayd "-o $TRACE_PATH" - start_lttng_sessiond - -diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh -index af63824ce..26e59e383 100644 ---- a/tests/utils/utils.sh -+++ b/tests/utils/utils.sh -@@ -125,6 +125,16 @@ function conf_proc_count() - echo - } - -+# Check if base lttng-modules are present. -+# Bail out on failure -+function validate_lttng_modules_present () -+{ -+ modprobe -n lttng-tracer 2>/dev/null -+ if [ $? -ne 0 ]; then -+ BAIL_OUT "LTTng modules not detected." -+ fi -+} -+ - function enable_kernel_lttng_event - { - local withtap="$1" --- -2.17.1 - diff --git a/meta/recipes-kernel/lttng/lttng-tools/0006-Tests-check-for-lttng-modules-presence.patch b/meta/recipes-kernel/lttng/lttng-tools/0006-Tests-check-for-lttng-modules-presence.patch deleted file mode 100644 index e07c227f46..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0006-Tests-check-for-lttng-modules-presence.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 92f93238f1df005aadc98e105c0dd0e04a5955a7 Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Mon, 25 Mar 2019 14:24:51 -0400 -Subject: [2/2] tests: check for lttng-modules presence - -Upstream-status: Accepted [5da3fc8579a9f93ea4767729a107784bf2d034ae] -Backported to 2.11 and 2.10 - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> ---- - tests/regression/tools/notification/test_notification_kernel | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tests/regression/tools/notification/test_notification_kernel b/tests/regression/tools/notification/test_notification_kernel -index 6d7f256ae..e7368df26 100755 ---- a/tests/regression/tools/notification/test_notification_kernel -+++ b/tests/regression/tools/notification/test_notification_kernel -@@ -108,6 +108,7 @@ function kernel_test - } - - if [ "$(id -u)" == "0" ]; then -+ validate_lttng_modules_present - kernel_test - else - # Kernel tests are skipped. --- -2.17.1 - diff --git a/meta/recipes-kernel/lttng/lttng-tools/0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch b/meta/recipes-kernel/lttng/lttng-tools/0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch deleted file mode 100644 index 5437de26e8..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch +++ /dev/null @@ -1,345 +0,0 @@ -From 10e8001ad876d8cb3b5a17c7492e713bbc047975 Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Thu, 28 Mar 2019 18:31:29 -0400 -Subject: [PATCH] Fix: getgrnam is not MT-Safe, use getgrnam_r - -Running the test suite under a Yocto musl build resulted in musl -coredump due to double freeing. - -We get the following backtraces: - -0 a_crash () at ./arch/x86_64/atomic_arch.h:108 -1 unmap_chunk (self=<optimized out>) at src/malloc/malloc.c:515 -2 free (p=<optimized out>) at src/malloc/malloc.c:526 -3 0x00007f46d9dc3849 in __getgrent_a (f=f@entry=0x7f46d9d1f7e0, gr=gr@entry=0x7f46d9e24460 <gr>, line=line@entry=0x7f46d9e26058 <line>, size=size@entry=0x7f46d92db550, mem=mem@entry=0x7f46d9e26050 <mem>, nmem=nmem@entry=0x7f46d92db558, res=0x7f46d92db548) at src/passwd/getgrent_a.c:45 -4 0x00007f46d9dc2e6b in __getgr_a (name=0x487242 "tracing", gid=gid@entry=0, gr=gr@entry=0x7f46d9e24460 <gr>, buf=buf@entry=0x7f46d9e26058 <line>, size=size@entry=0x7f46d92db550, mem=mem@entry=0x7f46d9e26050 <mem>, nmem=0x7f46d92db558, res=0x7f46d92db548) at src/passwd/getgr_a.c:30 -5 0x00007f46d9dc3733 in getgrnam (name=<optimized out>) at src/passwd/getgrent.c:37 -6 0x0000000000460b29 in utils_get_group_id (name=<optimized out>) at ../../../lttng-tools-2.10.6/src/common/utils.c:1241 -7 0x000000000044ee69 in thread_manage_health (data=<optimized out>) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/main.c:4115 -8 0x00007f46d9de1541 in start (p=<optimized out>) at src/thread/pthread_create.c:195 -9 0x00007f46d9dee661 in __clone () at src/thread/x86_64/clone.s:22 - -From another run: - -0 a_crash () at ./arch/x86_64/atomic_arch.h:108 -1 unmap_chunk (self=<optimized out>) at src/malloc/malloc.c:515 -2 free (p=<optimized out>) at src/malloc/malloc.c:526 -3 0x00007f5abc210849 in __getgrent_a (f=f@entry=0x7f5abc2733e0, gr=gr@entry=0x7f5abc271460 <gr>, line=line@entry=0x7f5abc273058 <line>, size=size@entry=0x7f5abaef5510, mem=mem@entry=0x7f5abc273050 <mem>, nmem=nmem@entry=0x7f5abaef5518, res=0x7f5abaef5508) at src/passwd/getgrent_a.c:45 -4 0x00007f5abc20fe6b in __getgr_a (name=0x487242 "tracing", gid=gid@entry=0, gr=gr@entry=0x7f5abc271460 <gr>, buf=buf@entry=0x7f5abc273058 <line>, size=size@entry=0x7f5abaef5510, mem=mem@entry=0x7f5abc273050 <mem>, nmem=0x7f5abaef5518, res=0x7f5abaef5508) at src/passwd/getgr_a.c:30 -5 0x00007f5abc210733 in getgrnam (name=<optimized out>) at src/passwd/getgrent.c:37 -6 0x0000000000460b29 in utils_get_group_id (name=<optimized out>) at ../../../lttng-tools-2.10.6/src/common/utils.c:1241 -7 0x000000000042dee4 in notification_channel_socket_create () at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:238 -8 init_thread_state (state=0x7f5abaef5560, handle=0x7f5abbf9be40) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:375 -9 thread_notification (data=0x7f5abbf9be40) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:495 -10 0x00007f5abc22e541 in start (p=<optimized out>) at src/thread/pthread_create.c:195 -11 0x00007f5abc23b661 in __clone () at src/thread/x86_64/clone.s:22 - -The problem was easily reproducible (~6 crash on ~300 runs). A prototype fix -using mutex around the getgrnam yielded no crash in over 1000 runs. This -patch yielded the same results as the prototype fix. - -Unfortunately we cannot rely on a mutex in liblttng-ctl since we cannot -enforce the locking for the application using the lib. - -Use getgrnam_r instead. - -The previous implementation of utils_get_group_id returned the gid of -the root group (0) on error/not found. lttng_check_tracing_group needs -to know if an error/not found occured, returning the root group is not -enough. We now return the gid via the passed parameter. The caller is -responsible for either defaulting to the root group or propagating the -error. - -We also do not want to warn when used in liblttng-ctl context. We might -want to move the warning elsewhere in the future. For now, pass a bool -if we need to warn or not. - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> ---- - src/bin/lttng-consumerd/health-consumerd.c | 10 ++- - src/bin/lttng-relayd/health-relayd.c | 20 ++++-- - src/bin/lttng-sessiond/main.c | 24 +++++-- - src/bin/lttng-sessiond/notification-thread.c | 10 ++- - src/common/utils.c | 75 +++++++++++++++++--- - src/common/utils.h | 4 +- - src/lib/lttng-ctl/lttng-ctl.c | 8 +-- - 7 files changed, 122 insertions(+), 29 deletions(-) - -diff --git a/src/bin/lttng-consumerd/health-consumerd.c b/src/bin/lttng-consumerd/health-consumerd.c -index 1e2f31e4..6045401a 100644 ---- a/src/bin/lttng-consumerd/health-consumerd.c -+++ b/src/bin/lttng-consumerd/health-consumerd.c -@@ -184,8 +184,14 @@ void *thread_manage_health(void *data) - is_root = !getuid(); - if (is_root) { - /* lttng health client socket path permissions */ -- ret = chown(health_unix_sock_path, 0, -- utils_get_group_id(tracing_group_name)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(tracing_group_name, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group. */ -+ } -+ -+ ret = chown(health_unix_sock_path, 0, gid); - if (ret < 0) { - ERR("Unable to set group on %s", health_unix_sock_path); - PERROR("chown"); -diff --git a/src/bin/lttng-relayd/health-relayd.c b/src/bin/lttng-relayd/health-relayd.c -index ba996621..962e88c4 100644 ---- a/src/bin/lttng-relayd/health-relayd.c -+++ b/src/bin/lttng-relayd/health-relayd.c -@@ -105,8 +105,14 @@ static int create_lttng_rundir_with_perm(const char *rundir) - int is_root = !getuid(); - - if (is_root) { -- ret = chown(rundir, 0, -- utils_get_group_id(tracing_group_name)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(tracing_group_name, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group.*/ -+ } -+ -+ ret = chown(rundir, 0, gid); - if (ret < 0) { - ERR("Unable to set group on %s", rundir); - PERROR("chown"); -@@ -256,8 +262,14 @@ void *thread_manage_health(void *data) - is_root = !getuid(); - if (is_root) { - /* lttng health client socket path permissions */ -- ret = chown(health_unix_sock_path, 0, -- utils_get_group_id(tracing_group_name)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(tracing_group_name, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group */ -+ } -+ -+ ret = chown(health_unix_sock_path, 0, gid); - if (ret < 0) { - ERR("Unable to set group on %s", health_unix_sock_path); - PERROR("chown"); -diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c -index fa6fa483..49307064 100644 ---- a/src/bin/lttng-sessiond/main.c -+++ b/src/bin/lttng-sessiond/main.c -@@ -4112,8 +4112,14 @@ static void *thread_manage_health(void *data) - - if (is_root) { - /* lttng health client socket path permissions */ -- ret = chown(config.health_unix_sock_path.value, 0, -- utils_get_group_id(config.tracing_group_name.value)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group */ -+ } -+ -+ ret = chown(config.health_unix_sock_path.value, 0, &gid); - if (ret < 0) { - ERR("Unable to set group on %s", config.health_unix_sock_path.value); - PERROR("chown"); -@@ -5238,7 +5244,10 @@ static int set_permissions(char *rundir) - int ret; - gid_t gid; - -- gid = utils_get_group_id(config.tracing_group_name.value); -+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group */ -+ } - - /* Set lttng run dir */ - ret = chown(rundir, 0, gid); -@@ -5349,7 +5358,14 @@ static int set_consumer_sockets(struct consumer_data *consumer_data) - goto error; - } - if (is_root) { -- ret = chown(path, 0, utils_get_group_id(config.tracing_group_name.value)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group */ -+ } -+ -+ ret = chown(path, 0, gid); - if (ret < 0) { - ERR("Unable to set group on %s", path); - PERROR("chown"); -diff --git a/src/bin/lttng-sessiond/notification-thread.c b/src/bin/lttng-sessiond/notification-thread.c -index 92ac597f..18a264d9 100644 ---- a/src/bin/lttng-sessiond/notification-thread.c -+++ b/src/bin/lttng-sessiond/notification-thread.c -@@ -235,8 +235,14 @@ int notification_channel_socket_create(void) - } - - if (getuid() == 0) { -- ret = chown(sock_path, 0, -- utils_get_group_id(config.tracing_group_name.value)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group. */ -+ } -+ -+ ret = chown(sock_path, 0, gid); - if (ret) { - ERR("Failed to set the notification channel socket's group"); - ret = -1; -diff --git a/src/common/utils.c b/src/common/utils.c -index c0bb031e..778bc00f 100644 ---- a/src/common/utils.c -+++ b/src/common/utils.c -@@ -1231,24 +1231,77 @@ size_t utils_get_current_time_str(const char *format, char *dst, size_t len) - } - - /* -- * Return the group ID matching name, else 0 if it cannot be found. -+ * Return 0 on success and set *gid to the group_ID matching the passed name. -+ * Else -1 if it cannot be found or an error occurred. - */ - LTTNG_HIDDEN --gid_t utils_get_group_id(const char *name) -+int utils_get_group_id(const char *name, bool warn, gid_t *gid) - { -- struct group *grp; -+ static volatile int warn_once; - -- grp = getgrnam(name); -- if (!grp) { -- static volatile int warn_once; -+ int ret; -+ long sys_len; -+ size_t len; -+ struct group grp; -+ struct group *result; -+ char *buffer = NULL; - -- if (!warn_once) { -- WARN("No tracing group detected"); -- warn_once = 1; -+ /* Get the system limit if it exists */ -+ sys_len = sysconf(_SC_GETGR_R_SIZE_MAX); -+ if (sys_len == -1) { -+ len = 1024; -+ } else { -+ len = (size_t) sys_len; -+ } -+ -+ buffer = malloc(len); -+ if (!buffer) { -+ PERROR("getgrnam_r malloc"); -+ ret = -1; -+ goto error; -+ } -+ -+ while ((ret = getgrnam_r(name, &grp, buffer, len, &result)) == ERANGE) -+ { -+ /* Buffer is not big enough, increase its size. */ -+ size_t new_len = 2 * len; -+ char *new_buffer = NULL; -+ if (new_len < len) { -+ ERR("getgrnam_r buffer size overflow"); -+ ret = -1; -+ goto error; -+ } -+ len = new_len; -+ new_buffer = realloc(buffer, len); -+ if (!new_buffer) { -+ PERROR("getgrnam_r realloc"); -+ ret = -1; -+ goto error; - } -- return 0; -+ buffer = new_buffer; -+ } -+ if (ret != 0) { -+ PERROR("getgrnam_r"); -+ ret = -1; -+ goto error; -+ } -+ -+ /* Group not found. */ -+ if (!result) { -+ ret = -1; -+ goto error; -+ } -+ -+ *gid = result->gr_gid; -+ ret = 0; -+ -+error: -+ free(buffer); -+ if (ret && warn && !warn_once) { -+ WARN("No tracing group detected"); -+ warn_once = 1; - } -- return grp->gr_gid; -+ return ret; - } - - /* -diff --git a/src/common/utils.h b/src/common/utils.h -index 18f19ef1..9c72431d 100644 ---- a/src/common/utils.h -+++ b/src/common/utils.h -@@ -22,6 +22,8 @@ - #include <unistd.h> - #include <stdint.h> - #include <getopt.h> -+#include <stdbool.h> -+#include <sys/types.h> - - #define KIBI_LOG2 10 - #define MEBI_LOG2 20 -@@ -52,7 +54,7 @@ int utils_get_count_order_u64(uint64_t x); - char *utils_get_home_dir(void); - char *utils_get_user_home_dir(uid_t uid); - size_t utils_get_current_time_str(const char *format, char *dst, size_t len); --gid_t utils_get_group_id(const char *name); -+int utils_get_group_id(const char *name, bool warn, gid_t *gid); - char *utils_generate_optstring(const struct option *long_options, - size_t opt_count); - int utils_create_lock_file(const char *filepath); -diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c -index 2d84aad9..561b0bcf 100644 ---- a/src/lib/lttng-ctl/lttng-ctl.c -+++ b/src/lib/lttng-ctl/lttng-ctl.c -@@ -208,15 +208,13 @@ end: - LTTNG_HIDDEN - int lttng_check_tracing_group(void) - { -- struct group *grp_tracing; /* no free(). See getgrnam(3) */ -- gid_t *grp_list; -+ gid_t *grp_list, tracing_gid; - int grp_list_size, grp_id, i; - int ret = -1; - const char *grp_name = tracing_group; - - /* Get GID of group 'tracing' */ -- grp_tracing = getgrnam(grp_name); -- if (!grp_tracing) { -+ if (utils_get_group_id(grp_name, false, &tracing_gid)) { - /* If grp_tracing is NULL, the group does not exist. */ - goto end; - } -@@ -241,7 +239,7 @@ int lttng_check_tracing_group(void) - } - - for (i = 0; i < grp_list_size; i++) { -- if (grp_list[i] == grp_tracing->gr_gid) { -+ if (grp_list[i] == tracing_gid) { - ret = 1; - break; - } --- -2.17.1 - 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 dbb18820a4..39d93e2bbf 100755 --- a/meta/recipes-kernel/lttng/lttng-tools/run-ptest +++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest @@ -1,6 +1,45 @@ #!/bin/sh # Without --ignore-exit, the tap harness causes any FAILs within a # test plan to raise ERRORs; this is just noise. -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 + +#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=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/x32.patch b/meta/recipes-kernel/lttng/lttng-tools/x32.patch deleted file mode 100644 index 42cebf94ac..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/x32.patch +++ /dev/null @@ -1,36 +0,0 @@ -Fix build for x32 - -Signed-off-by: Christopher Larson <chris_larson@mentor.com> - -Fix build error of src/common/utils.c for x32. - -Upstream-Status: Submitted [https://github.com/lttng/lttng-tools/pull/150] - -Signed-off-by: Kai Kang <kai.kang@windriver.com> - -diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c -index 0e96ef0c..5c79c8c7 100644 ---- a/src/bin/lttng/utils.c -+++ b/src/bin/lttng/utils.c -@@ -158,7 +158,7 @@ unsigned int fls_u32(uint32_t x) - #define HAS_FLS_U32 - #endif - --#if defined(__x86_64) -+#if defined(__x86_64) && !defined(__ILP32__) - static inline - unsigned int fls_u64(uint64_t x) - { -diff --git a/src/common/utils.c b/src/common/utils.c -index 08139e5e..3c389981 100644 ---- a/src/common/utils.c -+++ b/src/common/utils.c -@@ -1223,7 +1223,7 @@ static inline unsigned int fls_u32(uint32_t x) - #define HAS_FLS_U32 - #endif - --#if defined(__x86_64) -+#if defined(__x86_64) && !defined(__ILP32__) - static inline - unsigned int fls_u64(uint64_t x) - { diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb b/meta/recipes-kernel/lttng/lttng-tools_2.13.14.bb index a3fabb20ec..65d19b6e5f 100644 --- a/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb +++ b/meta/recipes-kernel/lttng/lttng-tools_2.13.14.bb @@ -3,81 +3,91 @@ SUMMARY = "Linux Trace Toolkit Control" DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \ to extract program execution details from the Linux operating system \ and interpret them." +HOMEPAGE = "https://github.com/lttng/lttng-tools" -LICENSE = "GPLv2 & LGPLv2.1" -LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \ - file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca" +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" -DEPENDS = "liburcu popt libxml2 util-linux" -RDEPENDS_${PN} = "libgcc" -RDEPENDS_${PN}-ptest += "make perl bash gawk ${PN} babeltrace procps perl-module-overloading coreutils util-linux kmod" -RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" -RDEPENDS_${PN}-ptest_append_libc-musl = " musl-utils" +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 binutils" +RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" +RDEPENDS:${PN}-ptest:append:libc-musl = " musl-utils" # babelstats.pl wants getopt-long -RDEPENDS_${PN}-ptest += "perl-module-getopt-long" +RDEPENDS:${PN}-ptest += "perl-module-getopt-long" PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ " -PACKAGECONFIG ??= "lttng-ust" +PACKAGECONFIG ??= "${LTTNGUST} kmod" PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native" PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust" PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod" PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" -PACKAGECONFIG_remove_arc = "lttng-ust" SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ - file://x32.patch \ + file://0001-tests-do-not-strip-a-helper-library.patch \ file://run-ptest \ file://lttng-sessiond.service \ - file://0001-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch \ - file://0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch \ - file://0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch \ - file://0004-Skip-when-testapp-is-not-present.patch\ - file://0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch \ - file://0006-Tests-check-for-lttng-modules-presence.patch \ - file://0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.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[md5sum] = "e88c521b5da6bb48a8187af633336ecc" -SRC_URI[sha256sum] = "f05df52bbebf8ce88d1b29e9e98cfc957d2ed738a345118018237ebdb581537c" +SRC_URI[sha256sum] = "53bdf7c4ad07dbfe660ee4d9affc63fe44ae59e9a73c6f7a96e0fca140e5adcb" inherit autotools ptest pkgconfig useradd python3-dir manpages systemd -SYSTEMD_SERVICE_${PN} = "lttng-sessiond.service" +CACHED_CONFIGUREVARS = "PGREP=/usr/bin/pgrep" + +SYSTEMD_SERVICE:${PN} = "lttng-sessiond.service" SYSTEMD_AUTO_ENABLE = "disable" USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "tracing" +GROUPADD_PARAM:${PN} = "tracing" -FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \ +FILES:${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \ ${PYTHON_SITEPACKAGES_DIR}/*" -FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" -FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" +FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" +FILES:${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" # Since files are installed into ${libdir}/lttng/libexec we match # the libexec insane test so skip it. # Python module needs to keep _lttng.so -INSANE_SKIP_${PN} = "libexec dev-so" -INSANE_SKIP_${PN}-dbg = "libexec" +INSANE_SKIP:${PN} = "libexec dev-so" +INSANE_SKIP:${PN}-dbg = "libexec" -do_install_append () { +PRIVATE_LIBS:${PN}-ptest = "libfoo.so" + +do_install:append () { # install systemd unit file - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_unitdir}/system + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${UNPACKDIR}/lttng-sessiond.service ${D}${systemd_system_unitdir} } do_install_ptest () { - for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/load-42*.lttng tests/regression/tools/save-load/configuration/load-42*.lttng ; do + for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/*.lttng \ + tests/regression/tools/save-load/configuration/load-42*.lttng tests/regression/tools/health/test_health.sh \ + tests/regression/tools/metadata/utils.sh tests/regression/tools/rotation/rotate_utils.sh \ + tests/regression/tools/notification/util_event_generator.sh \ + tests/regression/tools/base-path/*.lttng; do install -D "${B}/$f" "${D}${PTEST_PATH}/$f" done - for f in config/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-3.0.xsd; do + for f in tests/utils/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.1.xsd; do install -D "${S}/$f" "${D}${PTEST_PATH}/$f" done + # Patch in the correct path for the custom libraries a helper executable needs + 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" @@ -105,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) + *.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. @@ -115,6 +125,11 @@ do_install_ptest () { done 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 + # # Use the versioned libs of liblttng-ust-dl. # @@ -151,6 +166,10 @@ do_install_ptest () { -e 's#\(^test.*LDADD.=\)#disable\1#g' \ -i ${D}${PTEST_PATH}/tests/unit/Makefile + # Fix hardcoded build path + sed -e 's#TESTAPP_PATH=.*/tests/regression/#TESTAPP_PATH="${PTEST_PATH}/tests/regression/#' \ + -i ${D}${PTEST_PATH}/tests/regression/ust/python-logging/test_python_logging + # Substitute links to installed binaries. for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do exedir="${D}${PTEST_PATH}/src/bin/${prog}" @@ -165,3 +184,14 @@ do_install_ptest () { esac done } + +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 new file mode 100644 index 0000000000..6aca8f85fa --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch @@ -0,0 +1,33 @@ +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 + +since commit 6339062 Move liblttng-ust to 'src/lib/', +liblttng-ust.so/liblttng-ust-common.so/liblttng-ust-tracepoint.so +'s location changed from one dir to multiple dirs. which make below +error: +ld: warning: liblttng-ust-common.so.1, needed by ../../../src/lib/lttng-ust/.libs/liblttng-ust.so, not found (try using -rpath or -rpath-link) +ld: warning: liblttng-ust-tracepoint.so.1, needed by ../../../src/lib/lttng-ust/.libs/liblttng-ust.so, not found (try using -rpath or -rpath-link) + +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 insertion(+), 1 deletion(-) + +diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am +index 57782cc..d46caa6 100644 +--- a/doc/examples/Makefile.am ++++ b/doc/examples/Makefile.am +@@ -167,7 +167,7 @@ all-local: + CFLAGS='$(CFLAGS)' \ + AM_CFLAGS='$(AM_CFLAGS)' \ + LDFLAGS="$(LDFLAGS)" \ +- AM_LDFLAGS='$(AM_LDFLAGS) -L../../../src/lib/lttng-ust/.libs -Wl,-rpath="$(PWD)/../../src/lib/lttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../src/lib/lttng-ust/.libs/"' \ ++ AM_LDFLAGS='$(AM_LDFLAGS) -L../../../src/lib/lttng-ust/.libs -Wl,-rpath="$(PWD)/../../src/lib/lttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../src/lib/lttng-ust/.libs/:$(PWD)/../../src/lib/lttng-ust-tracepoint/.libs:$(PWD)/../../src/lib/lttng-ust-common/.libs/"' \ + LTTNG_GEN_TP_PATH="$$rel_src_subdir$(top_srcdir)/tools/" \ + AM_V_P="$(AM_V_P)" \ + AM_V_at="$(AM_V_at)" \ diff --git a/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch b/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch deleted file mode 100644 index 5c4bd36726..0000000000 --- a/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 5de7c318804a7b1edce8562d4891b4c74aac0677 Mon Sep 17 00:00:00 2001 -From: Michael Jeanson <mjeanson@efficios.com> -Date: Wed, 20 Mar 2019 11:07:35 -0400 -Subject: [PATCH] compat: work around broken _SC_NPROCESSORS_CONF on MUSL libc - -On MUSL libc the _SC_NPROCESSORS_CONF sysconf will report the number of -CPUs allocated to the task based on the affinity mask instead of the -total number of CPUs configured on the system. - -Upstream-Status: Accepted [1] [5de7c318804a7b1edce8562d4891b4c74aac0677] -[1] https://lists.lttng.org/pipermail/lttng-dev/2019-March/028616.html - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> -Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> ---- - libringbuffer/smp.c | 66 +++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 66 insertions(+) - -diff --git a/libringbuffer/smp.c b/libringbuffer/smp.c -index 9e7114be..656a75da 100644 ---- a/libringbuffer/smp.c -+++ b/libringbuffer/smp.c -@@ -2,6 +2,7 @@ - * libringbuffer/smp.c - * - * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> -+ * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -26,6 +27,7 @@ - - int __num_possible_cpus; - -+#if (defined(__GLIBC__) || defined( __UCLIBC__)) - void _get_num_possible_cpus(void) - { - int result; -@@ -43,3 +45,67 @@ void _get_num_possible_cpus(void) - return; - __num_possible_cpus = result; - } -+ -+#else -+ -+/* -+ * The MUSL libc implementation of the _SC_NPROCESSORS_CONF sysconf does not -+ * return the number of configured CPUs in the system but relies on the cpu -+ * affinity mask of the current task. -+ * -+ * So instead we use a strategy similar to GLIBC's, counting the cpu -+ * directories in "/sys/devices/system/cpu" and fallback on the value from -+ * sysconf if it fails. -+ */ -+ -+#include <dirent.h> -+#include <limits.h> -+#include <stdlib.h> -+#include <string.h> -+#include <sys/types.h> -+ -+#define __max(a,b) ((a)>(b)?(a):(b)) -+ -+void _get_num_possible_cpus(void) -+{ -+ int result, count = 0; -+ DIR *cpudir; -+ struct dirent *entry; -+ -+ cpudir = opendir("/sys/devices/system/cpu"); -+ if (cpudir == NULL) -+ goto end; -+ -+ /* -+ * Count the number of directories named "cpu" followed by and -+ * integer. This is the same strategy as glibc uses. -+ */ -+ while ((entry = readdir(cpudir))) { -+ if (entry->d_type == DT_DIR && -+ strncmp(entry->d_name, "cpu", 3) == 0) { -+ -+ char *endptr; -+ unsigned long cpu_num; -+ -+ cpu_num = strtoul(entry->d_name + 3, &endptr, 10); -+ if ((cpu_num < ULONG_MAX) && (endptr != entry->d_name + 3) -+ && (*endptr == '\0')) { -+ count++; -+ } -+ } -+ } -+ -+end: -+ /* -+ * Get the sysconf value as a fallback. Keep the highest number. -+ */ -+ result = __max(sysconf(_SC_NPROCESSORS_CONF), count); -+ -+ /* -+ * If both methods failed, don't store the value. -+ */ -+ if (result < 1) -+ return; -+ __num_possible_cpus = result; -+} -+#endif --- -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 new file mode 100644 index 0000000000..e85dbdb439 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch @@ -0,0 +1,26 @@ +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: 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 1ccc290..6531fa0 100644 +--- a/src/lib/lttng-ust-common/Makefile.am ++++ b/src/lib/lttng-ust-common/Makefile.am +@@ -16,6 +16,7 @@ liblttng_ust_common_la_SOURCES = \ + + liblttng_ust_common_la_LIBADD = \ + $(top_builddir)/src/common/libcommon.la \ ++ $(URCU_LIBS) \ + $(DL_LIBS) + + liblttng_ust_common_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSION) 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 new file mode 100644 index 0000000000..7c49583e0d --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch @@ -0,0 +1,29 @@ +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 +building. + +Upstream-Status: Submitted [https://github.com/lttng/lttng-ust/pull/59] + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> + +--- + src/python-lttngust/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/python-lttngust/Makefile.am b/src/python-lttngust/Makefile.am +index d53e21d..283901e 100644 +--- a/src/python-lttngust/Makefile.am ++++ b/src/python-lttngust/Makefile.am +@@ -45,7 +45,7 @@ install-exec-local: build-python-bindings.stamp + if [ "$(DESTDIR)" != "" ]; then \ + opts="$$opts --root=$(DESTDIR)"; \ + fi; \ +- $(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/lttng-ust-doc-examples-disable.patch b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch deleted file mode 100644 index bff852799d..0000000000 --- a/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch +++ /dev/null @@ -1,17 +0,0 @@ -Upstream-Status: Inappropriate [embedded specific] - -Don't build the doc examples - we don't need them and in fact they -never successfully built in previous iterations of the lttng-ust -recipe anyway. - -Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> - -Index: lttng-ust-2.9.1/doc/Makefile.am -=================================================================== ---- lttng-ust-2.9.1.orig/doc/Makefile.am -+++ lttng-ust-2.9.1/doc/Makefile.am -@@ -1,3 +1,3 @@ --SUBDIRS = . man examples -+SUBDIRS = . man - - dist_doc_DATA = java-agent.txt diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.10.3.bb b/meta/recipes-kernel/lttng/lttng-ust_2.13.8.bb index d546104129..dddd3a5004 100644 --- a/meta/recipes-kernel/lttng/lttng-ust_2.10.3.bb +++ b/meta/recipes-kernel/lttng/lttng-ust_2.13.8.bb @@ -3,46 +3,50 @@ 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" -LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \ - file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \ - file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44" +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}' \ am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ " -inherit autotools lib_package manpages python3native +inherit autotools lib_package manpages python3native pkgconfig + +include lttng-platforms.inc + +EXTRA_OECONF = "--disable-numa" +CPPFLAGS:append:arm = "${@oe.utils.vartrue('DEBUG_BUILD', '-DUATOMIC_NO_LINK_ERROR', '', d)}" DEPENDS = "liburcu util-linux" -RDEPENDS_${PN}-bin = "python3-core" +RDEPENDS:${PN}-bin = "python3-core" # For backwards compatibility after rename -RPROVIDES_${PN} = "lttng2-ust" -RREPLACES_${PN} = "lttng2-ust" -RCONFLICTS_${PN} = "lttng2-ust" +RPROVIDES:${PN} = "lttng2-ust" +RREPLACES:${PN} = "lttng2-ust" +RCONFLICTS:${PN} = "lttng2-ust" PE = "2" SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \ - file://lttng-ust-doc-examples-disable.patch \ - file://0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch \ - " + file://0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch \ + file://0001-lttng-ust-common-link-with-liburcu-explicitly.patch \ + file://0001-Makefile.am-update-rpath-link.patch \ + " -SRC_URI[md5sum] = "ffcfa8c1ba9a52f002d240e936e9afa2" -SRC_URI[sha256sum] = "9e8420f90d5f963f7aa32bc6d44adc1e491136f687c69ffb7a3075d33b40852b" +SRC_URI[sha256sum] = "d4ef98dab9a37ad4f524ccafdfd50af4f266039b528dd5afabce78e49024d937" CVE_PRODUCT = "ust" +PACKAGECONFIG[examples] = "--enable-examples, --disable-examples," PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" PACKAGECONFIG[python3-agent] = "--enable-python-agent ${PYTHON_OPTION}, --disable-python-agent, python3, python3" -FILES_${PN} += " ${PYTHON_SITEPACKAGES_DIR}/*" -FILES_${PN}-staticdev += " ${PYTHON_SITEPACKAGES_DIR}/*.a" -FILES_${PN}-dev += " ${PYTHON_SITEPACKAGES_DIR}/*.la" +FILES:${PN} += " ${PYTHON_SITEPACKAGES_DIR}/*" +FILES:${PN}-staticdev += " ${PYTHON_SITEPACKAGES_DIR}/*.a" +FILES:${PN}-dev += " ${PYTHON_SITEPACKAGES_DIR}/*.la" -do_install_append() { +do_install:append() { # Patch python tools to use Python 3; they should be source compatible, but # still refer to Python 2 in the shebang sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp |