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." |
| 6 | |
| 7 | LICENSE = "GPLv2 & LGPLv2.1" |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame^] | 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \ |
| 9 | file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \ |
| 10 | file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 11 | |
| 12 | DEPENDS = "liburcu popt libxml2 util-linux" |
| 13 | RDEPENDS_${PN} = "libgcc" |
| 14 | RDEPENDS_${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod lttng-modules sed python3-core" |
| 15 | RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" |
| 16 | RDEPENDS_${PN}-ptest_append_libc-musl = " musl-utils" |
| 17 | # babelstats.pl wants getopt-long |
| 18 | RDEPENDS_${PN}-ptest += "perl-module-getopt-long" |
| 19 | |
| 20 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ |
| 21 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ |
| 22 | PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ |
| 23 | " |
| 24 | PACKAGECONFIG ??= "lttng-ust" |
| 25 | PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native" |
| 26 | PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust" |
| 27 | PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod" |
| 28 | PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" |
| 29 | PACKAGECONFIG_remove_arc = "lttng-ust" |
| 30 | |
| 31 | 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] | 32 | file://0001-tests-do-not-strip-a-helper-library.patch \ |
| 33 | file://run-ptest \ |
| 34 | file://lttng-sessiond.service \ |
| 35 | file://0001-tests-regression-disable-the-tools-live-tests.patch \ |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame^] | 36 | file://0001-tests-gen-ust-events-ns-tp.h-Fix-build-with-musl-lib.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 37 | " |
| 38 | |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame^] | 39 | SRC_URI[md5sum] = "4592201ea981f0722438345fb1f009d2" |
| 40 | SRC_URI[sha256sum] = "405661d27617dc79a42712174a051a45c7ca12d167576c0d93f2de708ed29445" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 41 | |
| 42 | inherit autotools ptest pkgconfig useradd python3-dir manpages systemd |
| 43 | |
| 44 | SYSTEMD_SERVICE_${PN} = "lttng-sessiond.service" |
| 45 | SYSTEMD_AUTO_ENABLE = "disable" |
| 46 | |
| 47 | USERADD_PACKAGES = "${PN}" |
| 48 | GROUPADD_PARAM_${PN} = "tracing" |
| 49 | |
| 50 | FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \ |
| 51 | ${PYTHON_SITEPACKAGES_DIR}/*" |
| 52 | FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" |
| 53 | FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" |
| 54 | |
| 55 | # Since files are installed into ${libdir}/lttng/libexec we match |
| 56 | # the libexec insane test so skip it. |
| 57 | # Python module needs to keep _lttng.so |
| 58 | INSANE_SKIP_${PN} = "libexec dev-so" |
| 59 | INSANE_SKIP_${PN}-dbg = "libexec" |
| 60 | |
| 61 | PRIVATE_LIBS_${PN}-ptest = "libfoo.so" |
| 62 | |
| 63 | do_install_append () { |
| 64 | # install systemd unit file |
| 65 | install -d ${D}${systemd_unitdir}/system |
| 66 | install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_unitdir}/system |
| 67 | } |
| 68 | |
| 69 | do_install_ptest () { |
| 70 | for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/load-42*.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; do |
| 71 | install -D "${B}/$f" "${D}${PTEST_PATH}/$f" |
| 72 | done |
| 73 | |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame^] | 74 | for f in config/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.0.xsd; do |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 75 | install -D "${S}/$f" "${D}${PTEST_PATH}/$f" |
| 76 | done |
| 77 | |
| 78 | # Prevent 'make check' from recursing into non-test subdirectories. |
| 79 | sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile" |
| 80 | |
| 81 | # We don't need these |
| 82 | sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile" |
| 83 | |
| 84 | # We shouldn't need to build anything in tests/utils |
| 85 | sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \ |
| 86 | "${D}${PTEST_PATH}/tests/Makefile" |
| 87 | |
| 88 | # Copy the tests directory tree and the executables and |
| 89 | # Makefiles found within. |
| 90 | for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do |
| 91 | install -d "${D}${PTEST_PATH}/tests/$d" |
| 92 | find "${B}/tests/$d" -maxdepth 1 -executable -type f \ |
| 93 | -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + |
| 94 | # Take all .py scripts for tests using the python bindings. |
| 95 | find "${B}/tests/$d" -maxdepth 1 -type f -name "*.py" \ |
| 96 | -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + |
| 97 | test -r "${B}/tests/$d/Makefile" && \ |
| 98 | install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile" |
| 99 | done |
| 100 | |
| 101 | for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do |
| 102 | for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do |
| 103 | cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f |
| 104 | case $f in |
| 105 | *.so) |
| 106 | install -d ${D}${PTEST_PATH}/tests/$d/ |
| 107 | ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f |
| 108 | # Remove any rpath/runpath to pass QA check. |
| 109 | chrpath --delete ${D}${PTEST_PATH}/tests/$d/$f |
| 110 | ;; |
| 111 | esac |
| 112 | done |
| 113 | done |
| 114 | |
| 115 | chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary |
| 116 | |
| 117 | # |
| 118 | # Use the versioned libs of liblttng-ust-dl. |
| 119 | # |
| 120 | ustdl="${D}${PTEST_PATH}/tests/regression/ust/ust-dl/test_ust-dl.py" |
| 121 | if [ -e $ustdl ]; then |
| 122 | sed -i -e 's!:liblttng-ust-dl.so!:liblttng-ust-dl.so.0!' $ustdl |
| 123 | fi |
| 124 | |
| 125 | install ${B}/tests/unit/ini_config/sample.ini ${D}${PTEST_PATH}/tests/unit/ini_config/ |
| 126 | |
| 127 | # We shouldn't need to build anything in tests/regression/tools |
| 128 | sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \ |
| 129 | "${D}${PTEST_PATH}/tests/regression/Makefile" |
| 130 | |
| 131 | # Prevent attempts to update Makefiles during test runs, and |
| 132 | # silence "Making check in $SUBDIR" messages. |
| 133 | find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ |
| 134 | sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \ |
| 135 | -e '/echo "Making $$target in $$subdir"; \\/d' \ |
| 136 | -e 's/^srcdir = \(.*\)/srcdir = ./' \ |
| 137 | -e 's/^builddir = \(.*\)/builddir = ./' \ |
| 138 | -e 's/^all-am:.*/all-am:/' \ |
| 139 | {} + |
| 140 | |
| 141 | find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ |
| 142 | touch -r "${B}/Makefile" {} + |
| 143 | |
| 144 | # |
| 145 | # Need to stop generated binaries from rebuilding by removing their source dependencies |
| 146 | # |
| 147 | sed -e 's#\(^test.*OBJECTS.=\)#disable\1#g' \ |
| 148 | -e 's#\(^test.*DEPENDENCIES.=\)#disable\1#g' \ |
| 149 | -e 's#\(^test.*SOURCES.=\)#disable\1#g' \ |
| 150 | -e 's#\(^test.*LDADD.=\)#disable\1#g' \ |
| 151 | -i ${D}${PTEST_PATH}/tests/unit/Makefile |
| 152 | |
| 153 | # Substitute links to installed binaries. |
| 154 | for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do |
| 155 | exedir="${D}${PTEST_PATH}/src/bin/${prog}" |
| 156 | install -d "$exedir" |
| 157 | case "$prog" in |
| 158 | lttng-consumerd) |
| 159 | ln -s "${libdir}/lttng/libexec/$prog" "$exedir" |
| 160 | ;; |
| 161 | *) |
| 162 | ln -s "${bindir}/$prog" "$exedir" |
| 163 | ;; |
| 164 | esac |
| 165 | done |
| 166 | } |