From 24df057854f010b796ce470fa25f11669dd9195a Mon Sep 17 00:00:00 2001 From: wangmy Date: Mon, 25 Oct 2021 22:26:56 +0800 Subject: lttng-tools: upgrade 2.13.0 -> 2.13.1 2021-10-18 lttng-tools 2.13.1 (National Chocolate Cupcake Day) Fix: ust: app stuck on recv message during UST comm timeout scenario Fix: ust: UST communication can return -EAGAIN Fix: ust: segfault on lttng start on filter bytecode copy Fix: sessiond: previously created channel cannot be enabled Build fix: Missing message in LTTNG_DEPRECATED invocation Fix: notification-thread: handling event from a removed tracer event src include: add missing "extern" include: remove spurious spaces in condition/session-rotation.h tests: fix header of regression/ust/getcpu-override/run-getcpu-override fix: wrong define used for GCC version check Fix: userspace-probe: unreported error on string copy error Fix: userspace-probe: truncating binary path for SDT Fix: lttng: add-trigger: don't provide a default event rule type Fix: statements with side-effects in assert statements Fix: lttng_trace_archive_location_serialize is called on freed memory Fix: sessiond: ust session is inactive during ust_app_global_update Fix: common: error query for trigger action protocol error Fix: common: un-hide two rate policy functions Fix: include: remove unneeded declaration of lttng_session_descriptor_get_session_name Fix: Tests: race condition in test_ns_contexts_change Fix: Tests: race condition in test_event_tracker Fix: man: lttng-rotate: trace file count/size limitation does not apply Fix: runas: less-than-zero comparison of an unsigned value Fix: runas: supplementary groups are ignored on lttng save Docs: lttng-event-rule(7): --exclude does not exist, use --exclude-name sessiond: logging typo: {triger, triggger} -> trigger Fix: lttng: free sessions in cmd_destroy Fix: lttng: free domains and channels in get_session_stats_str 0001-Fix-Tests-race-condition-in-test_event_tracker.patch 0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch are removed since they're included in 2.13.1 (From OE-Core rev: 9541cac079b0fa4961328f610e3df3ccf5316cea) Signed-off-by: Wang Mingyu Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- ...ests-race-condition-in-test_event_tracker.patch | 221 --------------------- ...race-condition-in-test_ns_contexts_change.patch | 46 ----- meta/recipes-kernel/lttng/lttng-tools_2.13.0.bb | 190 ------------------ meta/recipes-kernel/lttng/lttng-tools_2.13.1.bb | 188 ++++++++++++++++++ 4 files changed, 188 insertions(+), 457 deletions(-) delete mode 100644 meta/recipes-kernel/lttng/lttng-tools/0001-Fix-Tests-race-condition-in-test_event_tracker.patch delete mode 100644 meta/recipes-kernel/lttng/lttng-tools/0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch delete mode 100644 meta/recipes-kernel/lttng/lttng-tools_2.13.0.bb create mode 100644 meta/recipes-kernel/lttng/lttng-tools_2.13.1.bb (limited to 'meta/recipes-kernel/lttng') diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-Tests-race-condition-in-test_event_tracker.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-Tests-race-condition-in-test_event_tracker.patch deleted file mode 100644 index 10020e1ecf..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-Tests-race-condition-in-test_event_tracker.patch +++ /dev/null @@ -1,221 +0,0 @@ -From d3392e4850532c02e53e3c3ff1cc27df7e51c941 Mon Sep 17 00:00:00 2001 -From: Francis Deslauriers -Date: Tue, 7 Sep 2021 17:10:31 -0400 -Subject: [PATCH 1/2] Fix: Tests: race condition in test_event_tracker -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Background -========== -The `test_event_tracker` file contains test cases when the event -generating app in executed in two distinct steps. Those two steps are -preparation and execution. - 1. the preparation is the launching the app in the background, and - 2. the execution is actually generating the event that should or - should not be traced depending on the test case. - -This is useful to test the tracker feature since we want to ensure that -already running apps are notified properly when changing their tracking -status. - -Issue -===== -The `test_event_vpid_track_untrack` test case suffers from a race -condition that is easy to reproduce on Yocto. - -The issue is that sometimes events are end up the trace when none is -expected. - -This is due to the absence of synchronization point at the launch of the -app which leads to the app being scheduled in-between the track-untrack -calls leading to events being recorded to the trace. - -It's easy to reproduce this issue on my machine by adding a `sleep 5` -between the track and untrack calls and setting the `NR_USEC_WAIT` -variable to 1. - -Fix -=== -Using the testapp `--sync-before-last-event-touch` flag to make the app -create a file when all but the last event are executed. We then have the -app wait until we create a file (`--sync-before-last-event`) to generate -that last event. This way, we are sure no event will be generated when -running the track and untrack commands. - -Notes -===== -- This issue affects other test cases in this file. -- This commit fixes a typo in the test header. -- This commit adds `diag` calls to help tracking to what test the output - relates to when reading the log. - -Signed-off-by: Francis Deslauriers -Signed-off-by: Jérémie Galarneau -Change-Id: Ia2b68128dc9a805526f9748f31ec2c2d95566f31 -Upstream-Status: Backport -Signed-off-by: Alexander Kanavin ---- - .../tools/tracker/test_event_tracker | 56 ++++++++++++++----- - 1 file changed, 42 insertions(+), 14 deletions(-) - -diff --git a/tests/regression/tools/tracker/test_event_tracker b/tests/regression/tools/tracker/test_event_tracker -index feb3787..cc0f698 100755 ---- a/tests/regression/tools/tracker/test_event_tracker -+++ b/tests/regression/tools/tracker/test_event_tracker -@@ -5,7 +5,7 @@ - # - # SPDX-License-Identifier: GPL-2.0-only - --TEST_DESC="LTTng - Event traker test" -+TEST_DESC="LTTng - Event tracker test" - - CURDIR=$(dirname "$0")/ - TESTDIR="$CURDIR/../../.." -@@ -15,7 +15,7 @@ TESTAPP_KERNEL_NAME="gen-kernel-test-events" - TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" - TESTAPP_KERNEL_BIN="$TESTAPP_PATH/$TESTAPP_KERNEL_NAME/$TESTAPP_KERNEL_NAME" - SESSION_NAME="tracker" --NR_ITER=100 -+NR_ITER=1 - NUM_GLOBAL_TESTS=2 - NUM_UST_TESTS=283 - NUM_KERNEL_TESTS=462 -@@ -30,27 +30,41 @@ SCRIPT_GROUPNAME="$(id -gn)" - - CHILD_PID=-1 - WAIT_PATH= --AFTER_FIRST_PATH= --BEFORE_LAST_PATH= -+TOUCH_BEFORE_LAST_PATH= -+SYNC_BEFORE_LAST_PATH= - - source $TESTDIR/utils/utils.sh - -+# Launch the testapp and execute it up until right before the last event. It is -+# useful to do it in two seperate steps in order to test tracking and -+# untracking on an active app. - function prepare_ust_app - { -- AFTER_FIRST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX) -- BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX) -+ TOUCH_BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_touch_before_last.XXXXXX) -+ SYNC_BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX) -+ -+ $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ -+ --sync-before-last-event-touch "$TOUCH_BEFORE_LAST_PATH" \ -+ --sync-before-last-event "$SYNC_BEFORE_LAST_PATH" & - -- $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT -a "$AFTER_FIRST_PATH" -b "$BEFORE_LAST_PATH" & - CHILD_PID=$! -+ -+ # Wait for the app to execute all the way to right before the last -+ # event. -+ while [ ! -f "${TOUCH_BEFORE_LAST_PATH}" ]; do -+ sleep 0.5 -+ done - } - -+# Generate the last event. - function trace_ust_app - { -- touch "$BEFORE_LAST_PATH" -- wait -+ # Ask the test app to generate the last event. -+ touch "$SYNC_BEFORE_LAST_PATH" -+ wait "$CHILD_PID" - ok $? "Traced application stopped." -- rm "$BEFORE_LAST_PATH" -- rm "$AFTER_FIRST_PATH" -+ rm "$SYNC_BEFORE_LAST_PATH" -+ rm "$TOUCH_BEFORE_LAST_PATH" - } - - function prepare_kernel_app -@@ -64,7 +78,7 @@ function prepare_kernel_app - function trace_kernel_app - { - touch "$WAIT_PATH" -- wait -+ wait "$CHILD_PID" - ok $? "Traced application stopped." - rm "$WAIT_PATH" - } -@@ -78,6 +92,8 @@ function test_event_tracker() - local tracker="$4" - local channel='' - -+ diag "${FUNCNAME[0]} $*" -+ - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) - - create_lttng_session_ok $SESSION_NAME "$trace_path" -@@ -117,6 +133,8 @@ function test_event_vpid_tracker() - local wildcard="$3" - local channel='' - -+ diag "${FUNCNAME[0]} $*" -+ - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) - - create_lttng_session_ok $SESSION_NAME "$trace_path" -@@ -160,6 +178,8 @@ function test_event_pid_tracker() - local wildcard="$3" - local channel='' - -+ diag "${FUNCNAME[0]} $*" -+ - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) - - create_lttng_session_ok $SESSION_NAME "$trace_path" -@@ -203,6 +223,8 @@ function test_event_tracker_fail() - local wildcard="$2" - local tracker="$3" - -+ diag "${FUNCNAME[0]} $*" -+ - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) - - create_lttng_session_ok $SESSION_NAME "$trace_path" -@@ -222,6 +244,8 @@ function test_event_track_untrack() - local tracker="$4" - local channel='' - -+ diag "${FUNCNAME[0]} $*" -+ - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) - - create_lttng_session_ok $SESSION_NAME "$trace_path" -@@ -262,6 +286,8 @@ function test_event_vpid_track_untrack() - local wildcard="$3" - local channel='' - -+ diag "${FUNCNAME[0]} $*" -+ - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) - - create_lttng_session_ok $SESSION_NAME "$trace_path" -@@ -302,6 +328,8 @@ function test_event_pid_track_untrack() - local wildcard="$3" - local channel='' - -+ diag "${FUNCNAME[0]} $*" -+ - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) - - create_lttng_session_ok $SESSION_NAME "$trace_path" -@@ -336,9 +364,9 @@ function test_event_pid_track_untrack() - - function test_event_ust_vpid_untrack_snapshot() - { -- local trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) -+ diag "${FUNCNAME[0]} $*" - -- diag "Test_event_ust_vpid_untrack_snapshot" -+ local trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) - - create_lttng_session_ok $SESSION_NAME "$trace_path" "--snapshot" - --- -2.20.1 - diff --git a/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch b/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch deleted file mode 100644 index a8d983105a..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch +++ /dev/null @@ -1,46 +0,0 @@ -From d284752e616dfc4c9288be3bb21c04ea78cdd967 Mon Sep 17 00:00:00 2001 -From: Francis Deslauriers -Date: Wed, 8 Sep 2021 10:16:23 -0400 -Subject: [PATCH 2/2] Fix: Tests: race condition in test_ns_contexts_change -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Issue -===== -The test script doesn't wait for the test application to complete before -stopping the tracing session. The race is that depending on the -scheduling the application is not always done generating events when the -session is stopped. - -Fix -=== -Make the test script wait for the termination of the test app before -stopping the session. - -Signed-off-by: Francis Deslauriers -Signed-off-by: Jérémie Galarneau -Change-Id: I29d9b41d2a2ed60a6c42020509c2067442ae332c -Upstream-Status: Backport -Signed-off-by: Alexander Kanavin ---- - tests/regression/ust/namespaces/test_ns_contexts_change | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/tests/regression/ust/namespaces/test_ns_contexts_change b/tests/regression/ust/namespaces/test_ns_contexts_change -index c0af15e..8a4b62c 100755 ---- a/tests/regression/ust/namespaces/test_ns_contexts_change -+++ b/tests/regression/ust/namespaces/test_ns_contexts_change -@@ -79,6 +79,9 @@ function test_ns() - - touch "$file_sync_before_last" - -+ # Wait for the test app to generate all expected events and exit. -+ wait $app_pid -+ - # stop and destroy - stop_lttng_tracing_ok "$session_name" - destroy_lttng_session_ok "$session_name" --- -2.20.1 - diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.13.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.13.0.bb deleted file mode 100644 index 1491aff618..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools_2.13.0.bb +++ /dev/null @@ -1,190 +0,0 @@ -SECTION = "devel" -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=40ef17463fbd6f377db3c47b1cbaded8 \ - file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \ - file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95" - -include lttng-platforms.inc - -DEPENDS = "liburcu popt libxml2 util-linux bison-native" -RDEPENDS:${PN} = "libgcc" -RRECOMMENDS:${PN} += "${LTTNGMODULES}" -RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep" -RDEPENDS:${PN}-ptest: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" - -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 ??= "${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" - -SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ - file://0001-tests-do-not-strip-a-helper-library.patch \ - file://run-ptest \ - file://lttng-sessiond.service \ - file://determinism.patch \ - file://0001-src-common-correct-header-location.patch \ - file://0001-Fix-Tests-race-condition-in-test_event_tracker.patch \ - file://0002-Fix-Tests-race-condition-in-test_ns_contexts_change.patch \ - " - -SRC_URI[sha256sum] = "8dc894f9a7a840e943c1c344345c75f001a9529daa9157f1a0e6175c081c29e6" - -inherit autotools ptest pkgconfig useradd python3-dir manpages systemd - -CACHED_CONFIGUREVARS = "PGREP=/usr/bin/pgrep" - -SYSTEMD_SERVICE:${PN} = "lttng-sessiond.service" -SYSTEMD_AUTO_ENABLE = "disable" - -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM:${PN} = "tracing" - -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" - -# 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" - -PRIVATE_LIBS:${PN}-ptest = "libfoo.so" - -do_install:append () { - # install systemd unit file - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_system_unitdir} -} - -do_install_ptest () { - 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 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}!' "${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" - - # We don't need these - sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile" - - # We shouldn't need to build anything in tests/utils - sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \ - "${D}${PTEST_PATH}/tests/Makefile" - - # Copy the tests directory tree and the executables and - # Makefiles found within. - 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" {} + - # Take all .py scripts for tests using the python bindings. - find "${B}/tests/$d" -maxdepth 1 -type f -name "*.py" \ - -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" - 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 - case $f in - *.so|userspace-probe-elf-binary) - install -d ${D}${PTEST_PATH}/tests/$d/ - ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f - # Remove any rpath/runpath to pass QA check. - chrpath --delete ${D}${PTEST_PATH}/tests/$d/$f - ;; - esac - done - done - - chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-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. - # - ustdl="${D}${PTEST_PATH}/tests/regression/ust/ust-dl/test_ust-dl.py" - if [ -e $ustdl ]; then - sed -i -e 's!:liblttng-ust-dl.so!:liblttng-ust-dl.so.0!' $ustdl - fi - - install ${B}/tests/unit/ini_config/sample.ini ${D}${PTEST_PATH}/tests/unit/ini_config/ - - # We shouldn't need to build anything in tests/regression/tools - sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \ - "${D}${PTEST_PATH}/tests/regression/Makefile" - - # 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:/' \ - {} + - - find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ - touch -r "${B}/Makefile" {} + - - # - # Need to stop generated binaries from rebuilding by removing their source dependencies - # - sed -e 's#\(^test.*OBJECTS.=\)#disable\1#g' \ - -e 's#\(^test.*DEPENDENCIES.=\)#disable\1#g' \ - -e 's#\(^test.*SOURCES.=\)#disable\1#g' \ - -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}" - install -d "$exedir" - case "$prog" in - lttng-consumerd) - ln -s "${libdir}/lttng/libexec/$prog" "$exedir" - ;; - *) - ln -s "${bindir}/$prog" "$exedir" - ;; - 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 \ - " diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.13.1.bb b/meta/recipes-kernel/lttng/lttng-tools_2.13.1.bb new file mode 100644 index 0000000000..063d8e8c2d --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools_2.13.1.bb @@ -0,0 +1,188 @@ +SECTION = "devel" +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=40ef17463fbd6f377db3c47b1cbaded8 \ + file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \ + file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95" + +include lttng-platforms.inc + +DEPENDS = "liburcu popt libxml2 util-linux bison-native" +RDEPENDS:${PN} = "libgcc" +RRECOMMENDS:${PN} += "${LTTNGMODULES}" +RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep" +RDEPENDS:${PN}-ptest: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" + +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 ??= "${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" + +SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ + file://0001-tests-do-not-strip-a-helper-library.patch \ + file://run-ptest \ + file://lttng-sessiond.service \ + file://determinism.patch \ + file://0001-src-common-correct-header-location.patch \ + " + +SRC_URI[sha256sum] = "cfe6df7da831fc07fd07ce46b442c2ec1074c167af73f3a1b1d2fba0c453c8b5" + +inherit autotools ptest pkgconfig useradd python3-dir manpages systemd + +CACHED_CONFIGUREVARS = "PGREP=/usr/bin/pgrep" + +SYSTEMD_SERVICE:${PN} = "lttng-sessiond.service" +SYSTEMD_AUTO_ENABLE = "disable" + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM:${PN} = "tracing" + +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" + +# 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" + +PRIVATE_LIBS:${PN}-ptest = "libfoo.so" + +do_install:append () { + # install systemd unit file + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_system_unitdir} +} + +do_install_ptest () { + 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 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}!' "${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" + + # We don't need these + sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile" + + # We shouldn't need to build anything in tests/utils + sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \ + "${D}${PTEST_PATH}/tests/Makefile" + + # Copy the tests directory tree and the executables and + # Makefiles found within. + 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" {} + + # Take all .py scripts for tests using the python bindings. + find "${B}/tests/$d" -maxdepth 1 -type f -name "*.py" \ + -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" + 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 + case $f in + *.so|userspace-probe-elf-binary) + install -d ${D}${PTEST_PATH}/tests/$d/ + ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f + # Remove any rpath/runpath to pass QA check. + chrpath --delete ${D}${PTEST_PATH}/tests/$d/$f + ;; + esac + done + done + + chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-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. + # + ustdl="${D}${PTEST_PATH}/tests/regression/ust/ust-dl/test_ust-dl.py" + if [ -e $ustdl ]; then + sed -i -e 's!:liblttng-ust-dl.so!:liblttng-ust-dl.so.0!' $ustdl + fi + + install ${B}/tests/unit/ini_config/sample.ini ${D}${PTEST_PATH}/tests/unit/ini_config/ + + # We shouldn't need to build anything in tests/regression/tools + sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \ + "${D}${PTEST_PATH}/tests/regression/Makefile" + + # 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:/' \ + {} + + + find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ + touch -r "${B}/Makefile" {} + + + # + # Need to stop generated binaries from rebuilding by removing their source dependencies + # + sed -e 's#\(^test.*OBJECTS.=\)#disable\1#g' \ + -e 's#\(^test.*DEPENDENCIES.=\)#disable\1#g' \ + -e 's#\(^test.*SOURCES.=\)#disable\1#g' \ + -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}" + install -d "$exedir" + case "$prog" in + lttng-consumerd) + ln -s "${libdir}/lttng/libexec/$prog" "$exedir" + ;; + *) + ln -s "${bindir}/$prog" "$exedir" + ;; + 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 \ + " -- cgit v1.2.3-54-g00ecf