xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "UProbes kernel module for SystemTap"
2*4882a593SmuzhiyunHOMEPAGE = "https://sourceware.org/systemtap/"
3*4882a593Smuzhiyunrequire systemtap_git.inc
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunDEPENDS = "systemtap virtual/kernel"
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun# On systems without CONFIG_UTRACE, this package is empty.
8*4882a593SmuzhiyunALLOW_EMPTY:${PN} = "1"
9*4882a593Smuzhiyun
10*4882a593Smuzhiyuninherit module-base gettext
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunFILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunFILES:${PN} += "${datadir}/systemtap/runtime/uprobes"
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun# Compile and install the uprobes kernel module on machines with utrace
17*4882a593Smuzhiyun# support.  Note that staprun expects it in the systemtap/runtime directory,
18*4882a593Smuzhiyun# not in /lib/modules.
19*4882a593Smuzhiyundo_compile() {
20*4882a593Smuzhiyun	if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config
21*4882a593Smuzhiyun	then
22*4882a593Smuzhiyun		unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP
23*4882a593Smuzhiyun		oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
24*4882a593Smuzhiyun			   AR="${KERNEL_AR}" \
25*4882a593Smuzhiyun			   -C ${STAGING_KERNEL_DIR} scripts
26*4882a593Smuzhiyun		oe_runmake KDIR=${STAGING_KERNEL_DIR}   \
27*4882a593Smuzhiyun			   M="${S}/runtime/uprobes/" \
28*4882a593Smuzhiyun			   CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
29*4882a593Smuzhiyun			   AR="${KERNEL_AR}" \
30*4882a593Smuzhiyun			   -C "${S}/runtime/uprobes/"
31*4882a593Smuzhiyun	fi
32*4882a593Smuzhiyun}
33*4882a593Smuzhiyun
34*4882a593Smuzhiyundo_install() {
35*4882a593Smuzhiyun	if [ -e "${S}/runtime/uprobes/uprobes.ko" ]
36*4882a593Smuzhiyun	then
37*4882a593Smuzhiyun		install -d ${D}${datadir}/systemtap/runtime/uprobes/
38*4882a593Smuzhiyun		install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/
39*4882a593Smuzhiyun	fi
40*4882a593Smuzhiyun}
41