blob: dc2e1f32489d225c1b7a4e75ba4eabf8168c80ab [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SECTION = "devel"
2SUMMARY = "Linux Trace Toolkit Control"
3DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
4to extract program execution details from the Linux operating system \
5and interpret them."
Andrew Geissler90fd73c2021-03-05 15:25:55 -06006HOMEPAGE = "https://github.com/lttng/lttng-tools"
Andrew Geissler82c905d2020-04-13 13:39:40 -05007
8LICENSE = "GPLv2 & LGPLv2.1"
Andrew Geissler1e34c2d2020-05-29 16:02:59 -05009LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \
10 file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \
11 file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95"
Andrew Geissler82c905d2020-04-13 13:39:40 -050012
Andrew Geisslerc9f78652020-09-18 14:11:35 -050013include lttng-platforms.inc
14
Andrew Geissler82c905d2020-04-13 13:39:40 -050015DEPENDS = "liburcu popt libxml2 util-linux"
Patrick Williams213cb262021-08-07 19:21:33 -050016RDEPENDS:${PN} = "libgcc"
17RRECOMMENDS:${PN} += "${LTTNGMODULES}"
18RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep"
19RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils"
20RDEPENDS:${PN}-ptest:append:libc-musl = " musl-utils"
Andrew Geissler82c905d2020-04-13 13:39:40 -050021# babelstats.pl wants getopt-long
Patrick Williams213cb262021-08-07 19:21:33 -050022RDEPENDS:${PN}-ptest += "perl-module-getopt-long"
Andrew Geissler82c905d2020-04-13 13:39:40 -050023
24PYTHON_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 Geisslerc9f78652020-09-18 14:11:35 -050028PACKAGECONFIG ??= "${LTTNGUST}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native"
30PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
31PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod"
32PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050033
34SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050035 file://0001-tests-do-not-strip-a-helper-library.patch \
36 file://run-ptest \
37 file://lttng-sessiond.service \
38 file://0001-tests-regression-disable-the-tools-live-tests.patch \
Andrew Geissler90fd73c2021-03-05 15:25:55 -060039 file://determinism.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050040 "
41
Andrew Geissler09036742021-06-25 14:25:14 -050042SRC_URI[sha256sum] = "d729f8c2373a41194f171aeb0da0a9bb35ac181f31afa7e260786d19a500dea1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050043
44inherit autotools ptest pkgconfig useradd python3-dir manpages systemd
45
Patrick Williams213cb262021-08-07 19:21:33 -050046SYSTEMD_SERVICE:${PN} = "lttng-sessiond.service"
Andrew Geissler82c905d2020-04-13 13:39:40 -050047SYSTEMD_AUTO_ENABLE = "disable"
48
49USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050050GROUPADD_PARAM:${PN} = "tracing"
Andrew Geissler82c905d2020-04-13 13:39:40 -050051
Patrick Williams213cb262021-08-07 19:21:33 -050052FILES:${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
Andrew Geissler82c905d2020-04-13 13:39:40 -050053 ${PYTHON_SITEPACKAGES_DIR}/*"
Patrick Williams213cb262021-08-07 19:21:33 -050054FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
55FILES:${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
Andrew Geissler82c905d2020-04-13 13:39:40 -050056
57# Since files are installed into ${libdir}/lttng/libexec we match
58# the libexec insane test so skip it.
59# Python module needs to keep _lttng.so
Patrick Williams213cb262021-08-07 19:21:33 -050060INSANE_SKIP:${PN} = "libexec dev-so"
61INSANE_SKIP:${PN}-dbg = "libexec"
Andrew Geissler82c905d2020-04-13 13:39:40 -050062
Patrick Williams213cb262021-08-07 19:21:33 -050063PRIVATE_LIBS:${PN}-ptest = "libfoo.so"
Andrew Geissler82c905d2020-04-13 13:39:40 -050064
Patrick Williams213cb262021-08-07 19:21:33 -050065do_install:append () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050066 # install systemd unit file
67 install -d ${D}${systemd_unitdir}/system
68 install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_unitdir}/system
69}
70
71do_install_ptest () {
Andrew Geissler09036742021-06-25 14:25:14 -050072 for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/*.lttng \
73 tests/regression/tools/save-load/configuration/load-42*.lttng tests/regression/tools/health/test_health.sh \
74 tests/regression/tools/metadata/utils.sh tests/regression/tools/rotation/rotate_utils.sh \
75 tests/regression/tools/base-path/*.lttng; do
Andrew Geissler82c905d2020-04-13 13:39:40 -050076 install -D "${B}/$f" "${D}${PTEST_PATH}/$f"
77 done
78
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050079 for f in config/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.0.xsd; do
Andrew Geissler82c905d2020-04-13 13:39:40 -050080 install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
81 done
82
83 # Prevent 'make check' from recursing into non-test subdirectories.
84 sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile"
85
86 # We don't need these
87 sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile"
88
89 # We shouldn't need to build anything in tests/utils
90 sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \
91 "${D}${PTEST_PATH}/tests/Makefile"
92
93 # Copy the tests directory tree and the executables and
94 # Makefiles found within.
95 for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
96 install -d "${D}${PTEST_PATH}/tests/$d"
97 find "${B}/tests/$d" -maxdepth 1 -executable -type f \
98 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
99 # Take all .py scripts for tests using the python bindings.
100 find "${B}/tests/$d" -maxdepth 1 -type f -name "*.py" \
101 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
102 test -r "${B}/tests/$d/Makefile" && \
103 install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
104 done
105
106 for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
107 for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
108 cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
109 case $f in
110 *.so)
111 install -d ${D}${PTEST_PATH}/tests/$d/
112 ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f
113 # Remove any rpath/runpath to pass QA check.
114 chrpath --delete ${D}${PTEST_PATH}/tests/$d/$f
115 ;;
116 esac
117 done
118 done
119
120 chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600121 chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libbar.so
122 chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libfoo.so
Andrew Geissler82c905d2020-04-13 13:39:40 -0500123
124 #
125 # Use the versioned libs of liblttng-ust-dl.
126 #
127 ustdl="${D}${PTEST_PATH}/tests/regression/ust/ust-dl/test_ust-dl.py"
128 if [ -e $ustdl ]; then
129 sed -i -e 's!:liblttng-ust-dl.so!:liblttng-ust-dl.so.0!' $ustdl
130 fi
131
132 install ${B}/tests/unit/ini_config/sample.ini ${D}${PTEST_PATH}/tests/unit/ini_config/
133
134 # We shouldn't need to build anything in tests/regression/tools
135 sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \
136 "${D}${PTEST_PATH}/tests/regression/Makefile"
137
138 # Prevent attempts to update Makefiles during test runs, and
139 # silence "Making check in $SUBDIR" messages.
140 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
141 sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
142 -e '/echo "Making $$target in $$subdir"; \\/d' \
143 -e 's/^srcdir = \(.*\)/srcdir = ./' \
144 -e 's/^builddir = \(.*\)/builddir = ./' \
145 -e 's/^all-am:.*/all-am:/' \
146 {} +
147
148 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
149 touch -r "${B}/Makefile" {} +
150
151 #
152 # Need to stop generated binaries from rebuilding by removing their source dependencies
153 #
154 sed -e 's#\(^test.*OBJECTS.=\)#disable\1#g' \
155 -e 's#\(^test.*DEPENDENCIES.=\)#disable\1#g' \
156 -e 's#\(^test.*SOURCES.=\)#disable\1#g' \
157 -e 's#\(^test.*LDADD.=\)#disable\1#g' \
158 -i ${D}${PTEST_PATH}/tests/unit/Makefile
159
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600160 # Fix hardcoded build path
Andrew Geisslerc926e172021-05-07 16:11:35 -0500161 sed -e 's#TESTAPP_PATH=.*/tests/regression/#TESTAPP_PATH="${PTEST_PATH}/tests/regression/#' \
Andrew Geissler90fd73c2021-03-05 15:25:55 -0600162 -i ${D}${PTEST_PATH}/tests/regression/ust/python-logging/test_python_logging
163
Andrew Geissler82c905d2020-04-13 13:39:40 -0500164 # Substitute links to installed binaries.
165 for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do
166 exedir="${D}${PTEST_PATH}/src/bin/${prog}"
167 install -d "$exedir"
168 case "$prog" in
169 lttng-consumerd)
170 ln -s "${libdir}/lttng/libexec/$prog" "$exedir"
171 ;;
172 *)
173 ln -s "${bindir}/$prog" "$exedir"
174 ;;
175 esac
176 done
177}