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