Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "UProbes kernel module for SystemTap" |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 2 | HOMEPAGE = "https://sourceware.org/systemtap/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 3 | require systemtap_git.inc |
| 4 | |
| 5 | DEPENDS = "systemtap virtual/kernel" |
| 6 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | # On systems without CONFIG_UTRACE, this package is empty. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 8 | ALLOW_EMPTY:${PN} = "1" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | |
| 10 | inherit module-base gettext |
| 11 | |
| 12 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:" |
| 13 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 14 | FILES:${PN} += "${datadir}/systemtap/runtime/uprobes" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | # 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. |
| 19 | do_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 Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 24 | AR="${KERNEL_AR}" OBJCOPY="${KERNEL_OBJCOPY}" \ |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 25 | STRIP="${KERNEL_STRIP}" \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | -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 Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 30 | AR="${KERNEL_AR}" OBJCOPY="${KERNEL_OBJCOPY}" \ |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 31 | STRIP="${KERNEL_STRIP}" \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | -C "${S}/runtime/uprobes/" |
| 33 | fi |
| 34 | } |
| 35 | |
| 36 | do_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 | } |