blob: 758908bff957813824d7ad4754fb2a135c556651 [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
7PR = "r1"
8
9# On systems without CONFIG_UTRACE, this package is empty.
10ALLOW_EMPTY_${PN} = "1"
11
12inherit module-base gettext
13
14FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
15
16FILES_${PN} += "${datadir}/systemtap/runtime/uprobes"
17
18EXTRA_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.
23do_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
38do_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}