* Re: [OE-core][PATCH] lttng-ust: add ptest support
2026-10-29 13:11 [OE-core][PATCH] lttng-ust: add ptest support Pratik Farkase
@ 2026-10-31 8:38 ` Mathieu Dubois-Briand
2026-11-03 8:57 ` [OE-core][PATCH v2] " Pratik Farkase
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Mathieu Dubois-Briand @ 2026-10-31 8:38 UTC (permalink / raw)
To: Pratik Farkase, openembedded-core; +Cc: pratik.farkase
On Thu Oct 29, 2026 at 2:11 PM CET, Pratik Farkase wrote:
> Build and run the lttng-ust unit test suite under ptest, modelled on the
> liburcu ptest support: the run-ptest script executes each TAP test from
> the tests/unit subdirectories and reports PASS/FAIL. The compile tests,
> benchmarks and the abi0-conflict regression test (unstable under QEMU)
> are excluded.
>
> The ust-elf test ships prebuilt, intentionally foreign-architecture ELF
> fixtures, so they are kept from being stripped and the related QA checks
> are relaxed for the ptest package.
>
> Tested on qemuriscv64 with ptest-runner.
>
> Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
> ---
Hi Pratik,
It looks like one of the tests is failing:
WARNING: core-image-ptest-lttng-ust-1.0-r0 do_testimage: There were failing ptests.
Traceback (most recent call last):
File "/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/layers/openembedded-core/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/layers/openembedded-core/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/layers/openembedded-core/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/layers/openembedded-core/meta/lib/oeqa/runtime/cases/ptest.py", line 27, in test_ptestrunner_expectfail
self.do_ptestrunner()
File "/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/layers/openembedded-core/meta/lib/oeqa/runtime/cases/ptest.py", line 121, in do_ptestrunner
self.fail(failmsg)
AssertionError:
Failed ptests:
{'lttng-ust': ['unit/ust-error/test_ust_error']}
https://autobuilder.yoctoproject.org/valkyrie/#/builders/109/builds/1469
https://autobuilder.yoctoproject.org/valkyrie/#/builders/110/builds/1491
Can you have a look at the issue?
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread* [OE-core][PATCH v2] lttng-ust: add ptest support
2026-10-29 13:11 [OE-core][PATCH] lttng-ust: add ptest support Pratik Farkase
2026-10-31 8:38 ` Mathieu Dubois-Briand
@ 2026-11-03 8:57 ` Pratik Farkase
2026-11-03 9:01 ` Patchtest results for " patchtest
2026-11-03 9:07 ` Pratik Farkase
2026-11-16 9:52 ` [OE-core][PATCH v3] " Pratik Farkase
3 siblings, 1 reply; 7+ messages in thread
From: Pratik Farkase @ 2026-11-03 8:57 UTC (permalink / raw)
To: openembedded-core; +Cc: pratik.farkase, Pratik Farkase
Build and run the lttng-ust unit test suite under ptest, modelled on the
liburcu ptest support: the run-ptest script executes each TAP test from
the tests/unit subdirectories and reports PASS/FAIL. The compile tests,
benchmarks and the abi0-conflict regression test (unstable under QEMU)
are excluded.
The ust-elf test ships prebuilt, intentionally foreign-architecture ELF
fixtures, so they are kept from being stripped and the related QA checks
are relaxed for the ptest package.
Tested on qemuriscv64 with ptest-runner.
Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
v2: Skip unit/ust-error on musl. It segfaults because lttng_ust_strerror()
negates its argument (undefined for the INT_MIN the test passes) and then
reads its lookup table out of bounds; this only shows up on musl.
.../distro/include/ptest-packagelists.inc | 1 +
meta/recipes-kernel/lttng/lttng-ust/run-ptest | 31 +++++++++
meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb | 63 ++++++++++++++++++-
3 files changed, 94 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-kernel/lttng/lttng-ust/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 74591a34f2..d5357d8732 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -64,6 +64,7 @@ PTESTS_FAST = "\
libxslt \
libyaml \
logrotate \
+ lttng-ust \
lua \
lzo \
m4 \
diff --git a/meta/recipes-kernel/lttng/lttng-ust/run-ptest b/meta/recipes-kernel/lttng/lttng-ust/run-ptest
new file mode 100644
index 0000000000..468562eb70
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/run-ptest
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+PTEST_PATH=$(dirname "$0")
+cd "$PTEST_PATH/tests" || exit 1
+
+export UST_TESTS_SRCDIR="$PTEST_PATH/tests"
+export UST_TESTS_BUILDDIR="$PTEST_PATH/tests"
+
+TESTS="
+unit/libringbuffer/test_shm
+unit/gcc-weak-hidden/test_gcc_weak_hidden
+unit/libcommon/test_get_cpu_mask_from_sysfs
+unit/libcommon/test_get_max_cpuid_from_mask
+unit/libcommon/test_get_max_cpuid_from_sysfs
+unit/libcommon/test_get_possible_cpus_array_len
+unit/libmsgpack/test_msgpack
+unit/pthread_name/test_pthread_name
+unit/snprintf/test_snprintf
+unit/ust-elf/test_ust_elf
+unit/ust-error/test_ust_error
+unit/ust-utils/test_ust_utils
+"
+
+for test in $TESTS; do
+ [ -x "$test" ] || continue
+ if ( cd "$(dirname "$test")" && ./"$(basename "$test")" ); then
+ echo "PASS: $test"
+ else
+ echo "FAIL: $test"
+ fi
+done
diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb b/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
index abc701cb79..2204993b12 100644
--- a/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
@@ -13,7 +13,7 @@ PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
# lttng-ust publishes bugfix/security-only releases on its per-minor
# stable-X.Y branches, the same upstream and release model as lttng-tools.
-inherit autotools lib_package manpages python3native pkgconfig upstream-stable-release-point
+inherit autotools lib_package manpages python3native pkgconfig upstream-stable-release-point ptest
include lttng-platforms.inc
@@ -33,6 +33,7 @@ PE = "2"
SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \
file://0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch \
file://0001-lttng-ust-common-link-with-liburcu-explicitly.patch \
+ file://run-ptest \
"
SRC_URI[sha256sum] = "1e84e02fa1fc1261eb6cf3d14d64006506a29f7c605ac85de02180318c6aa38a"
@@ -52,3 +53,63 @@ do_install:append() {
# still refer to Python 2 in the shebang
sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp
}
+
+RDEPENDS:${PN}-ptest += "bash liburcu"
+
+INHIBIT_PACKAGE_STRIP_FILES = "\
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86_64/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86_64/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/armeb/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/armeb/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/aarch64_be/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/aarch64_be/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.exec \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.pic \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.pie \
+"
+
+INSANE_SKIP:${PN}-ptest += "arch ldflags buildpaths"
+SKIP_FILEDEPS:${PN}-ptest = "1"
+
+LTTNG_UST_PTEST_DIRS = " \
+ unit/libringbuffer \
+ unit/gcc-weak-hidden \
+ unit/libcommon \
+ unit/libmsgpack \
+ unit/pthread_name \
+ unit/snprintf \
+ unit/ust-elf \
+ unit/ust-error \
+ unit/ust-utils \
+"
+
+LTTNG_UST_PTEST_DIRS:remove:libc-musl = "unit/ust-error"
+
+do_compile_ptest() {
+ for d in ${LTTNG_UST_PTEST_DIRS}; do
+ oe_runmake -C ${B}/tests/$d check TESTS=
+ done
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests/utils
+ install -m 0644 ${S}/tests/utils/tap.sh ${S}/tests/utils/utils.sh ${D}${PTEST_PATH}/tests/utils/
+
+ for d in ${LTTNG_UST_PTEST_DIRS}; do
+ mf=${B}/tests/$d/Makefile
+ install -d ${D}${PTEST_PATH}/tests/$d
+ for p in $(makefile-getvar $mf noinst_PROGRAMS); do
+ ${B}/libtool --mode=install install -m 0755 ${B}/tests/$d/$p ${D}${PTEST_PATH}/tests/$d/
+ done
+ for s in $(makefile-getvar $mf dist_noinst_SCRIPTS dist_check_SCRIPTS); do
+ install -m 0755 ${S}/tests/$d/$s ${D}${PTEST_PATH}/tests/$d/
+ done
+ done
+
+ cp -R --preserve=mode ${S}/tests/unit/ust-elf/data ${D}${PTEST_PATH}/tests/unit/ust-elf/
+}
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Patchtest results for [OE-core][PATCH v2] lttng-ust: add ptest support
2026-11-03 8:57 ` [OE-core][PATCH v2] " Pratik Farkase
@ 2026-11-03 9:01 ` patchtest
0 siblings, 0 replies; 7+ messages in thread
From: patchtest @ 2026-11-03 9:01 UTC (permalink / raw)
To: Pratik Farkase; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 3285 bytes --]
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:
---
Testing patch /home/patchtest/share/mboxes/v2-lttng-ust-add-ptest-support.patch
FAIL: test mbox format: Series has malformed diff lines. Create the series again using git-format-patch and ensure it applies using git am (test_mbox.TestMbox.test_mbox_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test auh changelog truncation notice (test_mbox.TestMbox.test_auh_changelog_truncation_notice)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest pylint: Python-unidiff parse error (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: Parse error Hunk is longer than expected (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: Parse error Hunk is longer than expected (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: Parse error Hunk is longer than expected (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: Python-unidiff parse error (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
^ permalink raw reply [flat|nested] 7+ messages in thread
* [OE-core][PATCH v2] lttng-ust: add ptest support
2026-10-29 13:11 [OE-core][PATCH] lttng-ust: add ptest support Pratik Farkase
2026-10-31 8:38 ` Mathieu Dubois-Briand
2026-11-03 8:57 ` [OE-core][PATCH v2] " Pratik Farkase
@ 2026-11-03 9:07 ` Pratik Farkase
2026-11-05 11:38 ` Alexander Kanavin
2026-11-16 9:52 ` [OE-core][PATCH v3] " Pratik Farkase
3 siblings, 1 reply; 7+ messages in thread
From: Pratik Farkase @ 2026-11-03 9:07 UTC (permalink / raw)
To: openembedded-core; +Cc: pratik.farkase, Pratik Farkase
Build and run the lttng-ust unit test suite under ptest, modelled on the
liburcu ptest support: the run-ptest script executes each TAP test from
the tests/unit subdirectories and reports PASS/FAIL. The compile tests,
benchmarks and the abi0-conflict regression test (unstable under QEMU)
are excluded.
The ust-elf test ships prebuilt, intentionally foreign-architecture ELF
fixtures, so they are kept from being stripped and the related QA checks
are relaxed for the ptest package.
Tested on qemuriscv64 with ptest-runner.
Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
Notes:
v2: Skip unit/ust-error on musl. It segfaults because lttng_ust_strerror()
negates its argument (undefined for the INT_MIN the test passes) and then
reads its lookup table out of bounds; this only shows up on musl.
.../distro/include/ptest-packagelists.inc | 1 +
meta/recipes-kernel/lttng/lttng-ust/run-ptest | 31 ++++++++++
meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb | 60 ++++++++++++++++++-
3 files changed, 91 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-kernel/lttng/lttng-ust/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 74591a34f2..d5357d8732 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -64,6 +64,7 @@ PTESTS_FAST = "\
libxslt \
libyaml \
logrotate \
+ lttng-ust \
lua \
lzo \
m4 \
diff --git a/meta/recipes-kernel/lttng/lttng-ust/run-ptest b/meta/recipes-kernel/lttng/lttng-ust/run-ptest
new file mode 100644
index 0000000000..468562eb70
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/run-ptest
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+PTEST_PATH=$(dirname "$0")
+cd "$PTEST_PATH/tests" || exit 1
+
+export UST_TESTS_SRCDIR="$PTEST_PATH/tests"
+export UST_TESTS_BUILDDIR="$PTEST_PATH/tests"
+
+TESTS="
+unit/libringbuffer/test_shm
+unit/gcc-weak-hidden/test_gcc_weak_hidden
+unit/libcommon/test_get_cpu_mask_from_sysfs
+unit/libcommon/test_get_max_cpuid_from_mask
+unit/libcommon/test_get_max_cpuid_from_sysfs
+unit/libcommon/test_get_possible_cpus_array_len
+unit/libmsgpack/test_msgpack
+unit/pthread_name/test_pthread_name
+unit/snprintf/test_snprintf
+unit/ust-elf/test_ust_elf
+unit/ust-error/test_ust_error
+unit/ust-utils/test_ust_utils
+"
+
+for test in $TESTS; do
+ [ -x "$test" ] || continue
+ if ( cd "$(dirname "$test")" && ./"$(basename "$test")" ); then
+ echo "PASS: $test"
+ else
+ echo "FAIL: $test"
+ fi
+done
diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb b/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
index abc701cb79..49084df2aa 100644
--- a/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
@@ -13,7 +13,7 @@ PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
# lttng-ust publishes bugfix/security-only releases on its per-minor
# stable-X.Y branches, the same upstream and release model as lttng-tools.
-inherit autotools lib_package manpages python3native pkgconfig upstream-stable-release-point
+inherit autotools lib_package manpages python3native pkgconfig upstream-stable-release-point ptest
include lttng-platforms.inc
@@ -33,6 +33,7 @@ PE = "2"
SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \
file://0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch \
file://0001-lttng-ust-common-link-with-liburcu-explicitly.patch \
+ file://run-ptest \
"
SRC_URI[sha256sum] = "1e84e02fa1fc1261eb6cf3d14d64006506a29f7c605ac85de02180318c6aa38a"
@@ -52,3 +53,60 @@ do_install:append() {
# still refer to Python 2 in the shebang
sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp
}
+
+RDEPENDS:${PN}-ptest += "bash liburcu"
+
+INHIBIT_PACKAGE_STRIP_FILES = "\
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86_64/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86_64/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/armeb/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/armeb/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/aarch64_be/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/aarch64_be/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.exec \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.pic \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.pie \
+"
+
+INSANE_SKIP:${PN}-ptest += "arch ldflags buildpaths"
+SKIP_FILEDEPS:${PN}-ptest = "1"
+
+LTTNG_UST_PTEST_DIRS = " \
+ unit/libringbuffer \
+ unit/gcc-weak-hidden \
+ unit/libcommon \
+ unit/libmsgpack \
+ unit/pthread_name \
+ unit/snprintf \
+ unit/ust-elf \
+ unit/ust-error \
+ unit/ust-utils \
+"
+
+LTTNG_UST_PTEST_DIRS:remove:libc-musl = "unit/ust-error"
+
+do_compile_ptest() {
+ for d in ${LTTNG_UST_PTEST_DIRS}; do
+ oe_runmake -C ${B}/tests/$d check TESTS=
+ done
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests/utils
+ install -m 0644 ${S}/tests/utils/tap.sh ${S}/tests/utils/utils.sh ${D}${PTEST_PATH}/tests/utils/
+
+ for d in ${LTTNG_UST_PTEST_DIRS}; do
+ mf=${B}/tests/$d/Makefile
+ install -d ${D}${PTEST_PATH}/tests/$d
+ for p in $(makefile-getvar $mf noinst_PROGRAMS); do
+ ${B}/libtool --mode=install install -m 0755 ${B}/tests/$d/$p ${D}${PTEST_PATH}/tests/$d/
+ done
+ for s in $(makefile-getvar $mf dist_noinst_SCRIPTS dist_check_SCRIPTS); do
+ install -m 0755 ${S}/tests/$d/$s ${D}${PTEST_PATH}/tests/$d/
+ done
+ done
+
+ cp -R --preserve=mode ${S}/tests/unit/ust-elf/data ${D}${PTEST_PATH}/tests/unit/ust-elf/
+}
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [OE-core][PATCH v2] lttng-ust: add ptest support
2026-11-03 9:07 ` Pratik Farkase
@ 2026-11-05 11:38 ` Alexander Kanavin
0 siblings, 0 replies; 7+ messages in thread
From: Alexander Kanavin @ 2026-11-05 11:38 UTC (permalink / raw)
To: pratik.farkase; +Cc: openembedded-core, pratik.farkase
[-- Attachment #1: Type: text/plain, Size: 2665 bytes --]
On Tue, 3 Nov 2026 at 10:07, Pratik Farkase via openembedded-core
<pratik.farkase=est.tech@lists.openembedded.org> wrote:
> +TESTS="
> +unit/libringbuffer/test_shm
> +unit/gcc-weak-hidden/test_gcc_weak_hidden
> +unit/libcommon/test_get_cpu_mask_from_sysfs
> +unit/libcommon/test_get_max_cpuid_from_mask
> +unit/libcommon/test_get_max_cpuid_from_sysfs
> +unit/libcommon/test_get_possible_cpus_array_len
> +unit/libmsgpack/test_msgpack
> +unit/pthread_name/test_pthread_name
> +unit/snprintf/test_snprintf
> +unit/ust-elf/test_ust_elf
> +unit/ust-error/test_ust_error
> +unit/ust-utils/test_ust_utils
> +"
Hello Pratik,
hardcoding a list of tests creates a maintainability problem. If upstream
adds more tests, they will not be run. If upstream removes tests, this
creates friction in version updates. Can you find ways to avoid it? One
possibility is to ship the makefile, and issue 'make check' (or something
similar) that would run tests from the list embedded in the makefile.
Another option is to create a list on the fly with 'find'.
+LTTNG_UST_PTEST_DIRS = " \
> + unit/libringbuffer \
> + unit/gcc-weak-hidden \
> + unit/libcommon \
> + unit/libmsgpack \
> + unit/pthread_name \
> + unit/snprintf \
> + unit/ust-elf \
> + unit/ust-error \
> + unit/ust-utils \
> +"
>
This has a similar problem. Rather than go over a hardcoded list of
directories, can we just start from the top dir and visit everything? If
too much is installed, then we can look into ways to trim it.
> + for d in ${LTTNG_UST_PTEST_DIRS}; do
> + mf=${B}/tests/$d/Makefile
> + install -d ${D}${PTEST_PATH}/tests/$d
> + for p in $(makefile-getvar $mf noinst_PROGRAMS); do
> + ${B}/libtool --mode=install install -m 0755 ${B}/tests/$d/$p
> ${D}${PTEST_PATH}/tests/$d/
> + done
> + for s in $(makefile-getvar $mf dist_noinst_SCRIPTS
> dist_check_SCRIPTS); do
> + install -m 0755 ${S}/tests/$d/$s ${D}${PTEST_PATH}/tests/$d/
> + done
> + done
>
Here's perhaps the most important point. You've done a lot of ptest
additions, but for autotools-driven projects this always results in hacky,
difficult to maintain code. What we would really like to see is support for
installable tests in the autotools upstream. Similar to how gnome project
does it. E.g. extend the macros to add test installation targets, and
making a script that would run them from the target. Then we could convert
all the ptests to use that, a far cleaner, maintainable solution. We can
even carry such a patch ourselves if autotools upstream rejects it (they
can be notoriously stubborn in such matters).
Cheers,
Alex
[-- Attachment #2: Type: text/html, Size: 3593 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [OE-core][PATCH v3] lttng-ust: add ptest support
2026-10-29 13:11 [OE-core][PATCH] lttng-ust: add ptest support Pratik Farkase
` (2 preceding siblings ...)
2026-11-03 9:07 ` Pratik Farkase
@ 2026-11-16 9:52 ` Pratik Farkase
3 siblings, 0 replies; 7+ messages in thread
From: Pratik Farkase @ 2026-11-16 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: pratik.farkase, Pratik Farkase
Build and run the lttng-ust unit test suite under ptest, modelled on the
liburcu ptest support: the run-ptest script executes each TAP test from
the tests/unit subdirectories and reports PASS/FAIL. The compile tests,
benchmarks and the abi0-conflict regression test (unstable under QEMU)
are excluded.
The ust-elf test ships prebuilt, intentionally foreign-architecture ELF
fixtures, so they are kept from being stripped and the related QA checks
are relaxed for the ptest package.
Tested on qemuriscv64 with ptest-runner.
Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
Notes:
v3: Derive the test list and directories dynamically from the autotools
TESTS variable (makefile-getvar) instead of hardcoding them, per review.
This also picks up unit/ust-utils/test_ust_utils_cxx automatically. Drop
the buildpaths INSANE_SKIP, which is no longer needed.
v2: Skip unit/ust-error on musl (lttng_ust_strerror() negates its argument,
undefined for INT_MIN, then reads its lookup table out of bounds).
.../distro/include/ptest-packagelists.inc | 1 +
meta/recipes-kernel/lttng/lttng-ust/run-ptest | 16 +++++
meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb | 61 ++++++++++++++++++-
3 files changed, 77 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-kernel/lttng/lttng-ust/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 74591a34f2..d5357d8732 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -64,6 +64,7 @@ PTESTS_FAST = "\
libxslt \
libyaml \
logrotate \
+ lttng-ust \
lua \
lzo \
m4 \
diff --git a/meta/recipes-kernel/lttng/lttng-ust/run-ptest b/meta/recipes-kernel/lttng/lttng-ust/run-ptest
new file mode 100644
index 0000000000..b1f85cef81
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/run-ptest
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+PTEST_PATH=$(dirname "$0")
+cd "$PTEST_PATH/tests" || exit 1
+
+export UST_TESTS_SRCDIR="$PTEST_PATH/tests"
+export UST_TESTS_BUILDDIR="$PTEST_PATH/tests"
+
+while read -r test; do
+ [ -x "$test" ] || continue
+ if ( cd "$(dirname "$test")" && ./"$(basename "$test")" ); then
+ echo "PASS: $test"
+ else
+ echo "FAIL: $test"
+ fi
+done < tests.list
diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb b/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
index abc701cb79..684855839b 100644
--- a/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-ust_2.16.0.bb
@@ -13,7 +13,7 @@ PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
# lttng-ust publishes bugfix/security-only releases on its per-minor
# stable-X.Y branches, the same upstream and release model as lttng-tools.
-inherit autotools lib_package manpages python3native pkgconfig upstream-stable-release-point
+inherit autotools lib_package manpages python3native pkgconfig upstream-stable-release-point ptest
include lttng-platforms.inc
@@ -33,6 +33,7 @@ PE = "2"
SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \
file://0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch \
file://0001-lttng-ust-common-link-with-liburcu-explicitly.patch \
+ file://run-ptest \
"
SRC_URI[sha256sum] = "1e84e02fa1fc1261eb6cf3d14d64006506a29f7c605ac85de02180318c6aa38a"
@@ -52,3 +53,61 @@ do_install:append() {
# still refer to Python 2 in the shebang
sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp
}
+
+RDEPENDS:${PN}-ptest += "bash liburcu"
+
+INHIBIT_PACKAGE_STRIP_FILES = "\
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86_64/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86_64/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/x86/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/armeb/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/armeb/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/aarch64_be/main.elf \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/aarch64_be/main.elf.debug \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.exec \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.pic \
+ ${PKGD}${PTEST_PATH}/tests/unit/ust-elf/data/pic/hello.pie \
+"
+
+INSANE_SKIP:${PN}-ptest += "arch ldflags"
+SKIP_FILEDEPS:${PN}-ptest = "1"
+
+LTTNG_UST_PTEST_SKIP = ""
+LTTNG_UST_PTEST_SKIP:libc-musl = "unit/ust-error/"
+
+do_compile_ptest() {
+ oe_runmake -C ${B}/tests/unit check TESTS=
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests/utils
+ install -m 0644 ${S}/tests/utils/tap.sh ${S}/tests/utils/utils.sh ${D}${PTEST_PATH}/tests/utils/
+
+ tests=$(makefile-getvar ${B}/tests/Makefile TESTS)
+
+ : > ${D}${PTEST_PATH}/tests/tests.list
+ for t in $tests; do
+ case $t in
+ unit/*) ;;
+ *) continue ;;
+ esac
+ for skip in ${LTTNG_UST_PTEST_SKIP}; do
+ case $t in $skip*) continue 2 ;; esac
+ done
+ echo "$t" >> ${D}${PTEST_PATH}/tests/tests.list
+ done
+
+ for d in $(sed 's|/[^/]*$||' ${D}${PTEST_PATH}/tests/tests.list | sort -u); do
+ mf=${B}/tests/$d/Makefile
+ install -d ${D}${PTEST_PATH}/tests/$d
+ for p in $(makefile-getvar $mf noinst_PROGRAMS); do
+ ${B}/libtool --mode=install install -m 0755 ${B}/tests/$d/$p ${D}${PTEST_PATH}/tests/$d/
+ done
+ for s in $(makefile-getvar $mf dist_noinst_SCRIPTS dist_check_SCRIPTS); do
+ install -m 0755 ${S}/tests/$d/$s ${D}${PTEST_PATH}/tests/$d/
+ done
+ done
+
+ cp -R --preserve=mode ${S}/tests/unit/ust-elf/data ${D}${PTEST_PATH}/tests/unit/ust-elf/
+}
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread