blob: 2181e45a8d604ddfed92b9a3680037a03f81c476 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "UProbes kernel module for SystemTap"
Andrew Geissler95ac1b82021-03-31 14:34:31 -05002HOMEPAGE = "https://sourceware.org/systemtap/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003require 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.
Patrick Williams213cb262021-08-07 19:21:33 -05008ALLOW_EMPTY:${PN} = "1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009
10inherit module-base gettext
11
12FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
13
Patrick Williams213cb262021-08-07 19:21:33 -050014FILES:${PN} += "${datadir}/systemtap/runtime/uprobes"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015
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}