Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Pratik Farkase <pratik.farkase@est.tech>
To: openembedded-core@lists.openembedded.org
Cc: pratik.farkase@ericsson.com, Pratik Farkase <pratik.farkase@est.tech>
Subject: [OE-core][PATCH] lttng-ust: add ptest support
Date: Thu, 29 Oct 2026 14:11:53 +0100	[thread overview]
Message-ID: <20261029131154.7487-1-pratik.farkase@est.tech> (raw)

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>
---
 .../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 | 58 ++++++++++++++++++-
 3 files changed, 89 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..13842535b9 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,58 @@ 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 \
+"
+
+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


             reply	other threads:[~2026-10-29 13:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 13:11 Pratik Farkase [this message]
2026-10-31  8:38 ` [OE-core][PATCH] lttng-ust: add ptest support Mathieu Dubois-Briand
2026-11-03  8:57 ` [OE-core][PATCH v2] " Pratik Farkase
2026-11-03  9:01   ` Patchtest results for " patchtest
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261029131154.7487-1-pratik.farkase@est.tech \
    --to=pratik.farkase@est.tech \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pratik.farkase@ericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox