blob: 46820ef4891e2ad14526acbd1d049fb95a25398a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "UProbes kernel module for SystemTap"
2
3require 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.
8ALLOW_EMPTY_${PN} = "1"
9
10inherit module-base gettext
11
12FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
13
14FILES_${PN} += "${datadir}/systemtap/runtime/uprobes"
15
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}" \
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
34do_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}