blob: 3d35481bdc9f632830661cc64d248d584ba77319 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "UProbes kernel module for SystemTap"
Andrew Geissler95ac1b82021-03-31 14:34:31 -05002HOMEPAGE = "https://sourceware.org/systemtap/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003require systemtap_git.inc
4
5DEPENDS = "systemtap virtual/kernel"
6
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007# On systems without CONFIG_UTRACE, this package is empty.
Patrick Williams213cb262021-08-07 19:21:33 -05008ALLOW_EMPTY:${PN} = "1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009
10inherit module-base gettext
11
12FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
13
Patrick Williams213cb262021-08-07 19:21:33 -050014FILES:${PN} += "${datadir}/systemtap/runtime/uprobes"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016# Compile and install the uprobes kernel module on machines with utrace
17# support. Note that staprun expects it in the systemtap/runtime directory,
18# not in /lib/modules.
19do_compile() {
20 if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config
21 then
22 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP
23 oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060024 AR="${KERNEL_AR}" OBJCOPY="${KERNEL_OBJCOPY}" \
Patrick Williams520786c2023-06-25 16:20:36 -050025 STRIP="${KERNEL_STRIP}" \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026 -C ${STAGING_KERNEL_DIR} scripts
27 oe_runmake KDIR=${STAGING_KERNEL_DIR} \
28 M="${S}/runtime/uprobes/" \
29 CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060030 AR="${KERNEL_AR}" OBJCOPY="${KERNEL_OBJCOPY}" \
Patrick Williams520786c2023-06-25 16:20:36 -050031 STRIP="${KERNEL_STRIP}" \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032 -C "${S}/runtime/uprobes/"
33 fi
34}
35
36do_install() {
37 if [ -e "${S}/runtime/uprobes/uprobes.ko" ]
38 then
39 install -d ${D}${datadir}/systemtap/runtime/uprobes/
40 install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/
41 fi
42}