Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "UProbes kernel module for SystemTap" |
| 2 | |
| 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. |
| 8 | ALLOW_EMPTY_${PN} = "1" |
| 9 | |
| 10 | inherit module-base gettext |
| 11 | |
| 12 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:" |
| 13 | |
| 14 | FILES_${PN} += "${datadir}/systemtap/runtime/uprobes" |
| 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}" \ |
| 24 | AR="${KERNEL_AR}" \ |
| 25 | -C ${STAGING_KERNEL_DIR} scripts |
| 26 | oe_runmake KDIR=${STAGING_KERNEL_DIR} \ |
| 27 | M="${S}/runtime/uprobes/" \ |
| 28 | CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ |
| 29 | AR="${KERNEL_AR}" \ |
| 30 | -C "${S}/runtime/uprobes/" |
| 31 | fi |
| 32 | } |
| 33 | |
| 34 | do_install() { |
| 35 | if [ -e "${S}/runtime/uprobes/uprobes.ko" ] |
| 36 | then |
| 37 | install -d ${D}${datadir}/systemtap/runtime/uprobes/ |
| 38 | install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/ |
| 39 | fi |
| 40 | } |