diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 14:31:25 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 16:43:26 +0000 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-kernel/systemtap | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | talos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz talos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-kernel/systemtap')
8 files changed, 224 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb new file mode 100644 index 000000000..3686c2f76 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb @@ -0,0 +1,42 @@ +SUMMARY = "UProbes kernel module for SystemTap" + +require systemtap_git.inc + +DEPENDS = "systemtap virtual/kernel" + +# On systems without CONFIG_UTRACE, this package is empty. +ALLOW_EMPTY_${PN} = "1" + +inherit module-base gettext + +FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:" + +FILES_${PN} += "${datadir}/systemtap/runtime/uprobes" + +EXTRA_OEMAKE = "" + +# Compile and install the uprobes kernel module on machines with utrace +# support. Note that staprun expects it in the systemtap/runtime directory, +# not in /lib/modules. +do_compile() { + if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config + then + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP + oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ + AR="${KERNEL_AR}" \ + -C ${STAGING_KERNEL_DIR} scripts + oe_runmake KDIR=${STAGING_KERNEL_DIR} \ + M="${S}/runtime/uprobes/" \ + CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ + AR="${KERNEL_AR}" \ + -C "${S}/runtime/uprobes/" + fi +} + +do_install() { + if [ -e "${S}/runtime/uprobes/uprobes.ko" ] + then + install -d ${D}${datadir}/systemtap/runtime/uprobes/ + install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/ + fi +} diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch new file mode 100644 index 000000000..b4f2fbc06 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch @@ -0,0 +1,39 @@ +From 5eb10d90af9178edb65e6091ae939d1b5b19bb78 Mon Sep 17 00:00:00 2001 +From: Wenzong Fan <wenzong.fan@windriver.com> +Date: Tue, 23 Sep 2014 04:47:10 -0400 +Subject: [PATCH] systemtap: allow to disable libvirt + +Upstream-Status: Pending + +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> +--- + configure.ac | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index a631ae7..cb4885b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -525,10 +525,15 @@ dnl Check for the libvirt and libxml2 devel packages + + dnl We require libvirt >= 1.0.2 because stapvirt relies on the + dnl virDomainOpenChannel function, which was implemented in 1.0.2. +-PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [ +- have_libvirt=yes +- AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed]) +- ], [have_libvirt=no]) ++AC_ARG_ENABLE([libvirt], ++ AS_HELP_STRING([--disable-libvirt], [Do not use libvirt even if present])) ++ ++if test "$enable_libvirt" != no; then ++ PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [ ++ have_libvirt=yes ++ AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed]) ++ ], [have_libvirt=no]) ++fi + AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"]) + PKG_CHECK_MODULES([libxml2], [libxml-2.0], [ + have_libxml2=yes +-- +1.7.9.5 + diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch new file mode 100644 index 000000000..33a89940a --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch @@ -0,0 +1,19 @@ +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> + +Index: git/doc/SystemTap_Tapset_Reference/Makefile.am +=================================================================== +--- git.orig/doc/SystemTap_Tapset_Reference/Makefile.am 2012-04-13 08:43:46.263339003 -0500 ++++ git/doc/SystemTap_Tapset_Reference/Makefile.am 2012-04-13 09:31:22.470083915 -0500 +@@ -27,6 +27,10 @@ + noinst_PROGRAMS = docproc + SRCTREE=$(abs_top_srcdir)/ + DOCPROC=$(abs_builddir)/docproc ++docproc_LINK = $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ ++ ++docproc.o: $(srcdir)/docproc.c ++ $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/docproc.c + + all: $(PDFDOCS) stamp-htmldocs stamp-mandocs + tapsets.xml: docproc $(shell find $(SRCTREE)/tapset -name '*.stp') diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch new file mode 100644 index 000000000..988cda4f0 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch @@ -0,0 +1,15 @@ +Upstream-Status: Pending + +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com> +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac ++++ git/configure.ac +@@ -19,7 +19,6 @@ AC_PROG_LN_S + AC_PROG_CC + AC_PROG_CXX + AC_PROG_CPP +-AM_PROG_CC_STDC + AM_PROG_CC_C_O + AC_PROG_RANLIB + AC_OBJEXT diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch new file mode 100644 index 000000000..013af5c3a --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch @@ -0,0 +1,23 @@ +systemtap: Cross compilation fix + +This is a cross compilation fix. It allows systemtap to find +the kernel map file in the right place, i.e. in the kernel build tree. +Without this fix it takes a map file from the build host, if available. + +Upstream-Status: Pending + +Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com> + +Index: git/session.cxx +=================================================================== +--- git.orig/session.cxx ++++ git/session.cxx +@@ -1634,7 +1634,7 @@ systemtap_session::parse_kernel_function + clog << _F("Kernel symbol table %s unavailable, (%s)", + system_map_path.c_str(), strerror(errno)) << endl; + +- system_map_path = "/boot/System.map-" + kernel_release; ++ system_map_path = kernel_build_tree + "/System.map-" + kernel_release; + system_map.clear(); + system_map.open(system_map_path.c_str(), ifstream::in); + if (! system_map.is_open()) diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch new file mode 100644 index 000000000..28a7eae40 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch @@ -0,0 +1,34 @@ +Fix time_t print because in x32 ABI is long long int instead of long int. + +Upstream-Status: Pending + +Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> + +diff --git a/cache.cxx b/cache.cxx +index 3546b30..19c77ca 100644 +--- a/cache.cxx ++++ b/cache.cxx +@@ -294,7 +294,11 @@ clean_cache(systemtap_session& s) + { + //interval not passed, don't continue + if (s.verbose > 1) ++#if defined(__x86_64__) && defined (__ILP32__) ++ clog << _F("Cache cleaning skipped, interval not reached %lld s / %lu s.", ++#else + clog << _F("Cache cleaning skipped, interval not reached %lu s / %lu s.", ++#endif + (current_time.tv_sec-sb.st_mtime), cache_clean_interval) << endl; + return; + } +@@ -302,7 +306,11 @@ clean_cache(systemtap_session& s) + { + //interval reached, continue + if (s.verbose > 1) ++#if defined(__x86_64__) && defined (__ILP32__) ++ clog << _F("Cleaning cache, interval reached %lld s > %lu s.", ++#else + clog << _F("Cleaning cache, interval reached %lu s > %lu s.", ++#endif + (current_time.tv_sec-sb.st_mtime), cache_clean_interval) << endl; + } + diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb new file mode 100644 index 000000000..97064b838 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb @@ -0,0 +1,28 @@ +SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux" + +require systemtap_git.inc + +DEPENDS = "elfutils sqlite3 systemtap-native" +DEPENDS_class-native = "elfutils-native sqlite3-native gettext-native" +DEPENDS_class-nativesdk = "nativesdk-elfutils nativesdk-sqlite3 nativesdk-gettext" + +RDEPENDS_${PN} += "python bash" +RDEPENDS_${PN}_class-native += "python-native" +RDEPENDS_${PN}_class-nativesdk += "python-native" + +EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \ + --without-nss --without-avahi --without-dyninst \ + --disable-server --disable-grapher --enable-prologues \ + ac_cv_prog_have_javac=no \ + ac_cv_prog_have_jar=no " + +STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs" + +EXTRA_OECONF += "${STAP_DOCS} " + +PACKAGECONFIG ??= "" +PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt" + +inherit autotools gettext pkgconfig + +BBCLASSEXTEND = "native nativesdk" diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.inc b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.inc new file mode 100644 index 000000000..656f15f80 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.inc @@ -0,0 +1,24 @@ +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" +SRCREV = "7009f2f782e52d6105fe68d6ea2a9820a1099c06" +PV = "2.9" + +SRC_URI = "git://sourceware.org/git/systemtap.git \ + file://docproc-build-fix.patch \ + file://obsolete_automake_macros.patch \ + file://system_map_location.patch \ + file://configure-allow-to-disable-libvirt.patch \ + file://x32_abi_time.patch \ + " + +# systemtap doesn't support mips +COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64).*-linux' + +S = "${WORKDIR}/git" + +# systemtap can't be built without optimization, if someone tries to compile an +# entire image as -O0, break with fatal. +python () { + if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x": + bb.fatal("systemtap can't be built with -O0, using -O1 -Wno-error or -O1 instead.") +} |