blob: 0787e04d191211954600e9c94700ccf6c5a3c2c6 [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."
6
7LICENSE = "GPLv2 & LGPLv2.1"
Andrew Geissler1e34c2d2020-05-29 16:02:59 -05008LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \
9 file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \
10 file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95"
Andrew Geissler82c905d2020-04-13 13:39:40 -050011
Andrew Geisslerc9f78652020-09-18 14:11:35 -050012include lttng-platforms.inc
13
Andrew Geissler82c905d2020-04-13 13:39:40 -050014DEPENDS = "liburcu popt libxml2 util-linux"
15RDEPENDS_${PN} = "libgcc"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050016RRECOMMENDS_${PN} += "${LTTNGMODULES}"
17RDEPENDS_${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core"
Andrew Geissler82c905d2020-04-13 13:39:40 -050018RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils"
19RDEPENDS_${PN}-ptest_append_libc-musl = " musl-utils"
20# babelstats.pl wants getopt-long
21RDEPENDS_${PN}-ptest += "perl-module-getopt-long"
22
23PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
24 am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
25 PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
26"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050027PACKAGECONFIG ??= "${LTTNGUST}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050028PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native"
29PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
30PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod"
31PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050032
33SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050034 file://0001-tests-do-not-strip-a-helper-library.patch \
35 file://run-ptest \
36 file://lttng-sessiond.service \
37 file://0001-tests-regression-disable-the-tools-live-tests.patch \
38 "
39
Andrew Geissler635e0e42020-08-21 15:58:33 -050040SRC_URI[sha256sum] = "9ed9161795ff023b076f9f95afaa4f1f822ec42495c0fa04c586ab8fa74e84f1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050041
42inherit autotools ptest pkgconfig useradd python3-dir manpages systemd
43
44SYSTEMD_SERVICE_${PN} = "lttng-sessiond.service"
45SYSTEMD_AUTO_ENABLE = "disable"
46
47USERADD_PACKAGES = "${PN}"
48GROUPADD_PARAM_${PN} = "tracing"
49
50FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
51 ${PYTHON_SITEPACKAGES_DIR}/*"
52FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
53FILES_${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
58INSANE_SKIP_${PN} = "libexec dev-so"
59INSANE_SKIP_${PN}-dbg = "libexec"
60
61PRIVATE_LIBS_${PN}-ptest = "libfoo.so"
62
63do_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
69do_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 Geissler1e34c2d2020-05-29 16:02:59 -050074 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 -050075 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}