blob: e9c8e18e222b96c5b0e30a5032c0a2bcb95a0dc9 [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 \
36 "
37
Andrew Geissler635e0e42020-08-21 15:58:33 -050038SRC_URI[sha256sum] = "9ed9161795ff023b076f9f95afaa4f1f822ec42495c0fa04c586ab8fa74e84f1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050039
40inherit autotools ptest pkgconfig useradd python3-dir manpages systemd
41
42SYSTEMD_SERVICE_${PN} = "lttng-sessiond.service"
43SYSTEMD_AUTO_ENABLE = "disable"
44
45USERADD_PACKAGES = "${PN}"
46GROUPADD_PARAM_${PN} = "tracing"
47
48FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
49 ${PYTHON_SITEPACKAGES_DIR}/*"
50FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
51FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
52
53# Since files are installed into ${libdir}/lttng/libexec we match
54# the libexec insane test so skip it.
55# Python module needs to keep _lttng.so
56INSANE_SKIP_${PN} = "libexec dev-so"
57INSANE_SKIP_${PN}-dbg = "libexec"
58
59PRIVATE_LIBS_${PN}-ptest = "libfoo.so"
60
61do_install_append () {
62 # install systemd unit file
63 install -d ${D}${systemd_unitdir}/system
64 install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_unitdir}/system
65}
66
67do_install_ptest () {
68 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
69 install -D "${B}/$f" "${D}${PTEST_PATH}/$f"
70 done
71
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050072 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 -050073 install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
74 done
75
76 # Prevent 'make check' from recursing into non-test subdirectories.
77 sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile"
78
79 # We don't need these
80 sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile"
81
82 # We shouldn't need to build anything in tests/utils
83 sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \
84 "${D}${PTEST_PATH}/tests/Makefile"
85
86 # Copy the tests directory tree and the executables and
87 # Makefiles found within.
88 for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
89 install -d "${D}${PTEST_PATH}/tests/$d"
90 find "${B}/tests/$d" -maxdepth 1 -executable -type f \
91 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
92 # Take all .py scripts for tests using the python bindings.
93 find "${B}/tests/$d" -maxdepth 1 -type f -name "*.py" \
94 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
95 test -r "${B}/tests/$d/Makefile" && \
96 install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
97 done
98
99 for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
100 for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
101 cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
102 case $f in
103 *.so)
104 install -d ${D}${PTEST_PATH}/tests/$d/
105 ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f
106 # Remove any rpath/runpath to pass QA check.
107 chrpath --delete ${D}${PTEST_PATH}/tests/$d/$f
108 ;;
109 esac
110 done
111 done
112
113 chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary
114
115 #
116 # Use the versioned libs of liblttng-ust-dl.
117 #
118 ustdl="${D}${PTEST_PATH}/tests/regression/ust/ust-dl/test_ust-dl.py"
119 if [ -e $ustdl ]; then
120 sed -i -e 's!:liblttng-ust-dl.so!:liblttng-ust-dl.so.0!' $ustdl
121 fi
122
123 install ${B}/tests/unit/ini_config/sample.ini ${D}${PTEST_PATH}/tests/unit/ini_config/
124
125 # We shouldn't need to build anything in tests/regression/tools
126 sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \
127 "${D}${PTEST_PATH}/tests/regression/Makefile"
128
129 # Prevent attempts to update Makefiles during test runs, and
130 # silence "Making check in $SUBDIR" messages.
131 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
132 sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
133 -e '/echo "Making $$target in $$subdir"; \\/d' \
134 -e 's/^srcdir = \(.*\)/srcdir = ./' \
135 -e 's/^builddir = \(.*\)/builddir = ./' \
136 -e 's/^all-am:.*/all-am:/' \
137 {} +
138
139 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
140 touch -r "${B}/Makefile" {} +
141
142 #
143 # Need to stop generated binaries from rebuilding by removing their source dependencies
144 #
145 sed -e 's#\(^test.*OBJECTS.=\)#disable\1#g' \
146 -e 's#\(^test.*DEPENDENCIES.=\)#disable\1#g' \
147 -e 's#\(^test.*SOURCES.=\)#disable\1#g' \
148 -e 's#\(^test.*LDADD.=\)#disable\1#g' \
149 -i ${D}${PTEST_PATH}/tests/unit/Makefile
150
151 # Substitute links to installed binaries.
152 for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do
153 exedir="${D}${PTEST_PATH}/src/bin/${prog}"
154 install -d "$exedir"
155 case "$prog" in
156 lttng-consumerd)
157 ln -s "${libdir}/lttng/libexec/$prog" "$exedir"
158 ;;
159 *)
160 ln -s "${bindir}/$prog" "$exedir"
161 ;;
162 esac
163 done
164}