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 | |
| 7 | PR = "r1" |
| 8 | |
| 9 | # On systems without CONFIG_UTRACE, this package is empty. |
| 10 | ALLOW_EMPTY_${PN} = "1" |
| 11 | |
| 12 | inherit module-base gettext |
| 13 | |
| 14 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:" |
| 15 | |
| 16 | FILES_${PN} += "${datadir}/systemtap/runtime/uprobes" |
| 17 | |
| 18 | EXTRA_OEMAKE = "" |
| 19 | |
| 20 | # Compile and install the uprobes kernel module on machines with utrace |
| 21 | # support. Note that staprun expects it in the systemtap/runtime directory, |
| 22 | # not in /lib/modules. |
| 23 | do_compile() { |
| 24 | if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config |
| 25 | then |
| 26 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP |
| 27 | oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ |
| 28 | AR="${KERNEL_AR}" \ |
| 29 | -C ${STAGING_KERNEL_DIR} scripts |
| 30 | oe_runmake KDIR=${STAGING_KERNEL_DIR} \ |
| 31 | M="${S}/runtime/uprobes/" \ |
| 32 | CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ |
| 33 | AR="${KERNEL_AR}" \ |
| 34 | -C "${S}/runtime/uprobes/" |
| 35 | fi |
| 36 | } |
| 37 | |
| 38 | do_install() { |
| 39 | if [ -e "${S}/runtime/uprobes/uprobes.ko" ] |
| 40 | then |
| 41 | install -d ${D}${datadir}/systemtap/runtime/uprobes/ |
| 42 | install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/ |
| 43 | fi |
| 44 | } |