Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SECTION = "devel" |
| 2 | SUMMARY = "Linux Trace Toolkit Control" |
| 3 | DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \ |
| 4 | to extract program execution details from the Linux operating system \ |
| 5 | and interpret them." |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 6 | HOMEPAGE = "https://github.com/lttng/lttng-tools" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 | |
| 8 | LICENSE = "GPLv2 & LGPLv2.1" |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \ |
| 10 | file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \ |
| 11 | file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 12 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 13 | include lttng-platforms.inc |
| 14 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 15 | DEPENDS = "liburcu popt libxml2 util-linux bison-native" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 16 | RDEPENDS:${PN} = "libgcc" |
| 17 | RRECOMMENDS:${PN} += "${LTTNGMODULES}" |
| 18 | RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep" |
| 19 | RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" |
| 20 | RDEPENDS:${PN}-ptest:append:libc-musl = " musl-utils" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | # babelstats.pl wants getopt-long |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 22 | RDEPENDS:${PN}-ptest += "perl-module-getopt-long" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 23 | |
| 24 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ |
| 25 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ |
| 26 | PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ |
| 27 | " |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 28 | PACKAGECONFIG ??= "${LTTNGUST} kmod" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 29 | PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native" |
| 30 | PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust" |
| 31 | PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod" |
| 32 | PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 33 | |
| 34 | SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 35 | file://0001-tests-do-not-strip-a-helper-library.patch \ |
| 36 | file://run-ptest \ |
| 37 | file://lttng-sessiond.service \ |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 38 | file://determinism.patch \ |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 39 | file://0001-src-common-correct-header-location.patch \ |
| 40 | file://0001-tests-wait-some-more-before-analysing-traces-or-star.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 41 | " |
| 42 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 43 | SRC_URI[sha256sum] = "8dc894f9a7a840e943c1c344345c75f001a9529daa9157f1a0e6175c081c29e6" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 44 | |
| 45 | inherit autotools ptest pkgconfig useradd python3-dir manpages systemd |
| 46 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 47 | CACHED_CONFIGUREVARS = "PGREP=/usr/bin/pgrep" |
| 48 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 49 | SYSTEMD_SERVICE:${PN} = "lttng-sessiond.service" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 50 | SYSTEMD_AUTO_ENABLE = "disable" |
| 51 | |
| 52 | USERADD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 53 | GROUPADD_PARAM:${PN} = "tracing" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 54 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 55 | FILES:${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 56 | ${PYTHON_SITEPACKAGES_DIR}/*" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 57 | FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" |
| 58 | FILES:${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 59 | |
| 60 | # Since files are installed into ${libdir}/lttng/libexec we match |
| 61 | # the libexec insane test so skip it. |
| 62 | # Python module needs to keep _lttng.so |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 63 | INSANE_SKIP:${PN} = "libexec dev-so" |
| 64 | INSANE_SKIP:${PN}-dbg = "libexec" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 65 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 66 | PRIVATE_LIBS:${PN}-ptest = "libfoo.so" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 67 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 68 | do_install:append () { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 69 | # install systemd unit file |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 70 | install -d ${D}${systemd_system_unitdir} |
| 71 | install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_system_unitdir} |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | do_install_ptest () { |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 75 | for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/*.lttng \ |
| 76 | tests/regression/tools/save-load/configuration/load-42*.lttng tests/regression/tools/health/test_health.sh \ |
| 77 | tests/regression/tools/metadata/utils.sh tests/regression/tools/rotation/rotate_utils.sh \ |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 78 | tests/regression/tools/notification/util_event_generator.sh \ |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 79 | tests/regression/tools/base-path/*.lttng; do |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 80 | install -D "${B}/$f" "${D}${PTEST_PATH}/$f" |
| 81 | done |
| 82 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 83 | for f in tests/utils/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.1.xsd; do |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 84 | install -D "${S}/$f" "${D}${PTEST_PATH}/$f" |
| 85 | done |
| 86 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 87 | # Patch in the correct path for the custom libraries a helper executable needs |
| 88 | sed -i -e 's!FIXMEPTESTPATH!${PTEST_PATH}!' "${D}${PTEST_PATH}/run-ptest" |
| 89 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 90 | # Prevent 'make check' from recursing into non-test subdirectories. |
| 91 | sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile" |
| 92 | |
| 93 | # We don't need these |
| 94 | sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile" |
| 95 | |
| 96 | # We shouldn't need to build anything in tests/utils |
| 97 | sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \ |
| 98 | "${D}${PTEST_PATH}/tests/Makefile" |
| 99 | |
| 100 | # Copy the tests directory tree and the executables and |
| 101 | # Makefiles found within. |
| 102 | for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do |
| 103 | install -d "${D}${PTEST_PATH}/tests/$d" |
| 104 | find "${B}/tests/$d" -maxdepth 1 -executable -type f \ |
| 105 | -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + |
| 106 | # Take all .py scripts for tests using the python bindings. |
| 107 | find "${B}/tests/$d" -maxdepth 1 -type f -name "*.py" \ |
| 108 | -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + |
| 109 | test -r "${B}/tests/$d/Makefile" && \ |
| 110 | install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile" |
| 111 | done |
| 112 | |
| 113 | for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do |
| 114 | for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do |
| 115 | cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f |
| 116 | case $f in |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 117 | *.so|userspace-probe-elf-binary) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 118 | install -d ${D}${PTEST_PATH}/tests/$d/ |
| 119 | ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f |
| 120 | # Remove any rpath/runpath to pass QA check. |
| 121 | chrpath --delete ${D}${PTEST_PATH}/tests/$d/$f |
| 122 | ;; |
| 123 | esac |
| 124 | done |
| 125 | done |
| 126 | |
| 127 | chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 128 | chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libbar.so |
| 129 | chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libfoo.so |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 130 | |
| 131 | # |
| 132 | # Use the versioned libs of liblttng-ust-dl. |
| 133 | # |
| 134 | ustdl="${D}${PTEST_PATH}/tests/regression/ust/ust-dl/test_ust-dl.py" |
| 135 | if [ -e $ustdl ]; then |
| 136 | sed -i -e 's!:liblttng-ust-dl.so!:liblttng-ust-dl.so.0!' $ustdl |
| 137 | fi |
| 138 | |
| 139 | install ${B}/tests/unit/ini_config/sample.ini ${D}${PTEST_PATH}/tests/unit/ini_config/ |
| 140 | |
| 141 | # We shouldn't need to build anything in tests/regression/tools |
| 142 | sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \ |
| 143 | "${D}${PTEST_PATH}/tests/regression/Makefile" |
| 144 | |
| 145 | # Prevent attempts to update Makefiles during test runs, and |
| 146 | # silence "Making check in $SUBDIR" messages. |
| 147 | find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ |
| 148 | sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \ |
| 149 | -e '/echo "Making $$target in $$subdir"; \\/d' \ |
| 150 | -e 's/^srcdir = \(.*\)/srcdir = ./' \ |
| 151 | -e 's/^builddir = \(.*\)/builddir = ./' \ |
| 152 | -e 's/^all-am:.*/all-am:/' \ |
| 153 | {} + |
| 154 | |
| 155 | find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ |
| 156 | touch -r "${B}/Makefile" {} + |
| 157 | |
| 158 | # |
| 159 | # Need to stop generated binaries from rebuilding by removing their source dependencies |
| 160 | # |
| 161 | sed -e 's#\(^test.*OBJECTS.=\)#disable\1#g' \ |
| 162 | -e 's#\(^test.*DEPENDENCIES.=\)#disable\1#g' \ |
| 163 | -e 's#\(^test.*SOURCES.=\)#disable\1#g' \ |
| 164 | -e 's#\(^test.*LDADD.=\)#disable\1#g' \ |
| 165 | -i ${D}${PTEST_PATH}/tests/unit/Makefile |
| 166 | |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 167 | # Fix hardcoded build path |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 168 | sed -e 's#TESTAPP_PATH=.*/tests/regression/#TESTAPP_PATH="${PTEST_PATH}/tests/regression/#' \ |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 169 | -i ${D}${PTEST_PATH}/tests/regression/ust/python-logging/test_python_logging |
| 170 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 171 | # Substitute links to installed binaries. |
| 172 | for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do |
| 173 | exedir="${D}${PTEST_PATH}/src/bin/${prog}" |
| 174 | install -d "$exedir" |
| 175 | case "$prog" in |
| 176 | lttng-consumerd) |
| 177 | ln -s "${libdir}/lttng/libexec/$prog" "$exedir" |
| 178 | ;; |
| 179 | *) |
| 180 | ln -s "${bindir}/$prog" "$exedir" |
| 181 | ;; |
| 182 | esac |
| 183 | done |
| 184 | } |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 185 | |
| 186 | INHIBIT_PACKAGE_STRIP_FILES = "\ |
| 187 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary \ |
| 188 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary \ |
| 189 | " |