lttng-tools: Upgrade 2.13.15 -> 2.14.0

* Remove 3 backported patch.
0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch
0001-compat-Define-off64_t-as-off_t-on-linux.patch
0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch

* Remove 0001-fix-lttng-tools-fails-to-compile-with-libxml2-2.14.0.patch
as the issue has been fixed in another way as [1].

* Rebase 0001-tests-do-not-strip-a-helper-library.patch and disable-tests.patch
to fuzz issue.

* Add babeltrace2 to DEPENDS to fix below configure error.
 | configure: error: libbabeltrace2 is required to build tests

* src/common/config/session.xsd is restructured to src/common/session.xsd [2].

* Add 0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch to fix
the below buildpath QA issue.
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: File /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-c-constructor-so in package lttng-tools-ptest contains reference to TMPDIR [buildpaths]
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: lttng-tools-ptest: /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-c-constructor-so contains bad RPATH /buildarea3/myu2/yocto/builds/ptest-2025-07-09/tmp/work/core2-64-poky-linux/lttng-tools/2.14.0/build/tests/utils/testapp/gen-ust-events-constructor [rpaths]
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: File /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-constructor-so in package lttng-tools-ptest contains reference to TMPDIR [buildpaths]
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: lttng-tools-ptest: /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-constructor-so contains bad RPATH /buildarea3/myu2/yocto/builds/ptest-2025-07-09/tmp/work/core2-64-poky-linux/lttng-tools/2.14.0/build/tests/utils/testapp/gen-ust-events-constructor [rpaths]

* Add the redpends for lttng-tools-ptest to fix the test failure.
 ERROR: tools/live/test_early_inactive_app.py
============================================

Traceback (most recent call last):
  File "/usr/lib/lttng-tools/ptest/tests/regression/./tools/live/test_early_inactive_app.py", line 21, in <module>
    import lttngtest
  File "/usr/lib/lttng-tools/ptest/tests/utils/lttngtest/__init__.py", line 9, in <module>
    from .environment import *
  File "/usr/lib/lttng-tools/ptest/tests/utils/lttngtest/environment.py", line 13, in <module>
    import random
ModuleNotFoundError: No module named 'random'
ERROR: tools/live/test_early_inactive_app.py - missing test plan

ModuleNotFoundError: No module named 'random'
ModuleNotFoundError: No module named 'xml'
ModuleNotFoundError: No module named 'tempfile'
ModuleNotFoundError: No module named 'json'
ModuleNotFoundError: No module named 'bt2'

[1] 2d2e77ddc9
[2] 4ae042345b

RP: Added install of missing expect scripts
    Add new dependency on lttng-ust-dev due to test requirement (and remove QA check warning)
    Add missing dependency on python3-asyncio for concurency module

(From OE-Core rev: a09c0fa79cba48c76ed9b582e42becff91f32435)

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Mingli Yu
2025-07-24 17:28:13 +08:00
committed by Richard Purdie
parent 975fd7de31
commit 4fd63f7ec3
9 changed files with 71 additions and 1452 deletions

View File

@@ -1,53 +0,0 @@
From ea47622987d0947af3e8f75d16d52e27ebd60166 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")
Submitted [https://review.lttng.org/c/lttng-tools/+/12155]
Upstream-Status: Backport [https://github.com/lttng/lttng-tools/commit/78f5b22de60c114c5c83410015a08bdd212edc0b]
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 8ef4f0d..e506b53 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()
{

View File

@@ -1,86 +0,0 @@
From e5b2615aaad44a1c0d52da1469b28f99cfb12b5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=
<jeremie.galarneau@efficios.com>
Date: Tue, 17 Jan 2023 16:57:35 -0500
Subject: [PATCH] compat: off64_t is not defined by musl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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.
Submitted [https://review.lttng.org/c/lttng-tools/+/9268]
Upstream-Status: Backport [https://github.com/lttng/lttng-tools/commit/57fd993799a2b081c826f6fc8def32d28d526bfb]
Reported-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8
---
src/common/compat/compat-fcntl.c | 5 ++++-
src/common/compat/fcntl.h | 10 +++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/common/compat/compat-fcntl.c b/src/common/compat/compat-fcntl.c
index 5c0bdc9..18bab0a 100644
--- 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
diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h
index 5e566e5..93b22b7 100644
--- 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, off64_t offset, off64_t nbytes,
#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;
}

View File

@@ -1,55 +0,0 @@
From 0b19e10a8a52fab0bfadbac5ce70f1b2d185a1d1 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 21 May 2025 13:09:25 +0800
Subject: [PATCH] fix lttng-tools fails to compile with libxml2 2.14.0+
Description:
| In file included from /srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work/core2-32-poky-linux/lttng-tools/2.13.15/recipe-sysroot/usr/include/libxml2/libxml/parser.h:25,
| from ../../../../lttng-tools-2.13.15/src/common/config/session-config.c:29:
| /srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work/core2-32-poky-linux/lttng-tools/2.13.15/recipe-sysroot/usr/include/libxml2/libxml/encoding.h:173:7: note: declared here
| 173 | } input XML_DEPRECATED_MEMBER;
| | ^~~~~
| ../../../../lttng-tools-2.13.15/src/common/config/session-config.c:432:15: error: called object is not a function or function pointer
| 432 | ret = handler->input(out_str, &out_len, (const xmlChar *) in_str, &in_len);
| | ^~~~~~~
| At top level:
| cc1: note: unrecognized command-line option '-Wno-incomplete-setjmp-declaration' may have been intended to silence earlier diagnostics
According to [1][2], the UTF-8 handler is
```
static xmlCharEncError
UTF8ToUTF8(void *vctxt ATTRIBUTE_UNUSED,
unsigned char* out, int *outlen,
const unsigned char* in, int *inlen,
int flush ATTRIBUTE_UNUSED)
```
Update input.func with setting ATTRIBUTE_UNUSED params with NULL and 0
[1] https://gitlab.gnome.org/GNOME/libxml2/-/commit/38f475072aefe032fff1dc058df3e56c1e7062fa
[2] https://gitlab.gnome.org/GNOME/libxml2/-/commit/69b83bb68e2a8ed0013f80c51b9a358714b00c9a#478024cc18a2cc8dbaed34076e9775f6827f413d_2188_2201
Upstream-Status: Submitted [https://github.com/lttng/lttng-tools/pull/170]
Signed-off-by: Marko, Peter <Peter.Marko@siemens.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
src/common/config/session-config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c
index bb4e9fe..4042d34 100644
--- a/src/common/config/session-config.c
+++ b/src/common/config/session-config.c
@@ -429,7 +429,7 @@ static xmlChar *encode_string(const char *in_str)
goto end;
}
- ret = handler->input(out_str, &out_len, (const xmlChar *) in_str, &in_len);
+ ret = handler->input.func(NULL, out_str, &out_len, (const xmlChar *) in_str, &in_len, 0);
if (ret < 0) {
xmlFree(out_str);
out_str = NULL;
--
2.34.1

View File

@@ -0,0 +1,43 @@
From 673e8ef4763ea9a9c67248e6a1a7eadfc4bc278d Mon Sep 17 00:00:00 2001
From: Liu Yiding <liuyd.fnst@fujitsu.com>
Date: Thu, 3 Jul 2025 19:00:25 +0800
Subject: [PATCH] gen-ust-events-constructor: change rpath to $libdir like
others do
set rpath to abs_builddir will cause issue like:
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: File /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-c-constructor-so in package lttng-tools-ptest contains reference to TMPDIR [buildpaths]
ERROR: lttng-tools-2.14.0-r0 do_package_qa: QA Issue: File /usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events-constructor/gen-ust-events-constructor-so in package lttng-tools-ptest contains reference to TMPDIR [buildpaths]
userspace-probe-elf-binary and userspace-probe-sdt-binary set rpath to libdir
|$ grep -nr "rpath" */Makefile.am
|gen-ust-events-constructor/Makefile.am:29: -rpath $(abs_builddir)
|userspace-probe-elf-binary/Makefile.am:8:libfoo_la_LDFLAGS = -shared -module -avoid-version -rpath $(libdir)
|userspace-probe-sdt-binary/Makefile.am:25:libfoo_la_LDFLAGS = -module -shared -avoid-version -rpath $(libdir)
|userspace-probe-sdt-binary/Makefile.am:31:libbar_la_LDFLAGS = -module -shared -avoid-version -rpath $(libdir)
|userspace-probe-sdt-binary/Makefile.am:37:libzzz_la_LDFLAGS = -module -shared -avoid-version -rpath $(libdir)
Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
Upstream-Status: Submitted [https://github.com/lttng/lttng-tools/pull/171]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
tests/utils/testapp/gen-ust-events-constructor/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/utils/testapp/gen-ust-events-constructor/Makefile.am b/tests/utils/testapp/gen-ust-events-constructor/Makefile.am
index 6c09cf585..3eb26fba2 100644
--- a/tests/utils/testapp/gen-ust-events-constructor/Makefile.am
+++ b/tests/utils/testapp/gen-ust-events-constructor/Makefile.am
@@ -26,7 +26,7 @@ else
# Force the shared flag on the noinst libraries since they are
# only built static by default
FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \
- -rpath $(abs_builddir)
+ -rpath $(libdir)
noinst_LTLIBRARIES += libtp-so-provider.la libtp-so-define.la \
libtp-so_c-provider.la libtp-so_c-define.la
--
2.34.1

View File

@@ -1,4 +1,4 @@
From 3f1f1dc868accca37d2f276ed741884698b38538 Mon Sep 17 00:00:00 2001
From a45157a50e14d4bd244a3dd05d79c5703c819550 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

View File

@@ -1,4 +1,4 @@
From 1fbd24512e8fce64b92efa846c301e45a7371ed2 Mon Sep 17 00:00:00 2001
From 05cf8ed6cc42a2f6ff53009d0ae2713fe63f1245 Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: Tue, 14 Dec 2021 12:34:04 +0000
Subject: [PATCH] lttng-tools: Disable problem tests
@@ -18,12 +18,12 @@ Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
1 file changed, 12 deletions(-)
diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am
index e556223..756fb98 100644
index 7076488..e5be904 100644
--- a/tests/regression/Makefile.am
+++ b/tests/regression/Makefile.am
@@ -29,18 +29,6 @@ TESTS = tools/base-path/test_ust \
tools/crash/test_crash \
@@ -40,18 +40,6 @@ SERIAL_TESTS = tools/base-path/test_ust \
tools/regen-metadata/test_ust \
tools/regen-statedump/test_kernel \
tools/regen-statedump/test_ust \
- tools/notification/test_notification_ust_error \
- tools/notification/test_notification_ust_buffer_usage \
@@ -39,4 +39,4 @@ index e556223..756fb98 100644
- tools/notification/test_notification_multi_app \
tools/rotation/test_ust \
tools/rotation/test_kernel \
tools/rotation/test_save_load_mi \
tools/rotation/test_ust_kernel \

View File

@@ -20,7 +20,7 @@ function validate_lttng_modules_present()
return 1
}
export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs
export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs:FIXMEPTESTPATH/tests/utils/testapp/gen-ust-events-constructor/.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.

View File

@@ -12,14 +12,27 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \
include lttng-platforms.inc
DEPENDS = "liburcu popt libxml2 util-linux bison-native"
DEPENDS = "liburcu popt libxml2 util-linux bison-native babeltrace2"
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 \
babeltrace2 \
lttng-ust-dev \
python3-asyncio \
python3-logging \
python3-math \
python3-numbers \
python3-json \
python3-io \
python3-shell \
python3-xml \
"
INSANE_SKIP:${PN}-ptest += "dev-deps"
PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
@@ -36,13 +49,10 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
file://run-ptest \
file://lttng-sessiond.service \
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 \
file://0001-fix-lttng-tools-fails-to-compile-with-libxml2-2.14.0.patch \
file://0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch \
"
SRC_URI[sha256sum] = "96ea42351ee112c19dad9fdc7aae93b583d9f1722b2175664a381d2d337703c4"
SRC_URI[sha256sum] = "d8c39c26cec13b7bd82551cd52a22efc358b888e36ebcf9c1b60ef1c3a3c2fd3"
inherit autotools ptest pkgconfig useradd python3-dir manpages systemd
@@ -80,11 +90,14 @@ do_install_ptest () {
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/trace-format/ust-local-trace-pretty.expect \
tests/regression/tools/trace-format/kernel-local-trace-pretty.expect \
tests/regression/tools/base-path/*.lttng; do
install -D "${B}/$f" "${D}${PTEST_PATH}/$f"
done
for f in tests/utils/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.1.xsd; do
for f in tests/utils/tap-driver.sh config/test-driver src/common/session.xsd src/common/mi-lttng-4.1.xsd \
tests/regression/tests.serial; do
install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
done