diff options
| author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
|---|---|---|
| committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
| commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
| tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/recipes-kernel/systemtap | |
| download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz | |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-kernel/systemtap')
6 files changed, 216 insertions, 0 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb new file mode 100644 index 0000000000..0cfcbe44ac --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | DESCRIPTION = "UProbes kernel module for SystemTap" | ||
| 2 | |||
| 3 | require systemtap_git.inc | ||
| 4 | |||
| 5 | DEPENDS = "systemtap virtual/kernel" | ||
| 6 | |||
| 7 | PR = "r1" | ||
| 8 | |||
| 9 | # On systems without CONFIG_UTRACE, this package is empty. | ||
| 10 | ALLOW_EMPTY_${PN} = "1" | ||
| 11 | |||
| 12 | inherit module-base gettext | ||
| 13 | |||
| 14 | FILES_${PN} += "${datadir}/systemtap/runtime/uprobes" | ||
| 15 | |||
| 16 | EXTRA_OEMAKE = "" | ||
| 17 | |||
| 18 | # Compile and install the uprobes kernel module on machines with utrace | ||
| 19 | # support. Note that staprun expects it in the systemtap/runtime directory, | ||
| 20 | # not in /lib/modules. | ||
| 21 | do_compile() { | ||
| 22 | if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_DIR}/.config | ||
| 23 | then | ||
| 24 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP | ||
| 25 | oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ | ||
| 26 | AR="${KERNEL_AR}" \ | ||
| 27 | -C ${STAGING_KERNEL_DIR} scripts | ||
| 28 | oe_runmake KDIR=${STAGING_KERNEL_DIR} \ | ||
| 29 | M="${S}/runtime/uprobes/" \ | ||
| 30 | CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ | ||
| 31 | AR="${KERNEL_AR}" \ | ||
| 32 | -C "${S}/runtime/uprobes/" | ||
| 33 | fi | ||
| 34 | } | ||
| 35 | |||
| 36 | do_install() { | ||
| 37 | if [ -e "${S}/runtime/uprobes/uprobes.ko" ] | ||
| 38 | then | ||
| 39 | install -d ${D}${datadir}/systemtap/runtime/uprobes/ | ||
| 40 | install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/ | ||
| 41 | fi | ||
| 42 | } | ||
diff --git a/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch b/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch new file mode 100644 index 0000000000..33a89940ae --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | Upstream-Status: Inappropriate [configuration] | ||
| 2 | |||
| 3 | Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> | ||
| 4 | |||
| 5 | Index: git/doc/SystemTap_Tapset_Reference/Makefile.am | ||
| 6 | =================================================================== | ||
| 7 | --- git.orig/doc/SystemTap_Tapset_Reference/Makefile.am 2012-04-13 08:43:46.263339003 -0500 | ||
| 8 | +++ git/doc/SystemTap_Tapset_Reference/Makefile.am 2012-04-13 09:31:22.470083915 -0500 | ||
| 9 | @@ -27,6 +27,10 @@ | ||
| 10 | noinst_PROGRAMS = docproc | ||
| 11 | SRCTREE=$(abs_top_srcdir)/ | ||
| 12 | DOCPROC=$(abs_builddir)/docproc | ||
| 13 | +docproc_LINK = $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ | ||
| 14 | + | ||
| 15 | +docproc.o: $(srcdir)/docproc.c | ||
| 16 | + $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/docproc.c | ||
| 17 | |||
| 18 | all: $(PDFDOCS) stamp-htmldocs stamp-mandocs | ||
| 19 | tapsets.xml: docproc $(shell find $(SRCTREE)/tapset -name '*.stp') | ||
diff --git a/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch b/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch new file mode 100644 index 0000000000..988cda4f0c --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | Signed-off-by: Marko Lindqvist <cazfi74@gmail.com> | ||
| 4 | Index: git/configure.ac | ||
| 5 | =================================================================== | ||
| 6 | --- git.orig/configure.ac | ||
| 7 | +++ git/configure.ac | ||
| 8 | @@ -19,7 +19,6 @@ AC_PROG_LN_S | ||
| 9 | AC_PROG_CC | ||
| 10 | AC_PROG_CXX | ||
| 11 | AC_PROG_CPP | ||
| 12 | -AM_PROG_CC_STDC | ||
| 13 | AM_PROG_CC_C_O | ||
| 14 | AC_PROG_RANLIB | ||
| 15 | AC_OBJEXT | ||
diff --git a/meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch b/meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch new file mode 100644 index 0000000000..0b52cba528 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | scheduler.stp ctxswitch: Handle missing symbols. | ||
| 2 | |||
| 3 | Compiler output code optimization leads to missing debug data for some | ||
| 4 | target variables, in particular some inline functions parameters, e.g. | ||
| 5 | context_switch. | ||
| 6 | |||
| 7 | Handle this by testing for variable name resolvability and provide default | ||
| 8 | variable values in case no suitable target data is available through variable | ||
| 9 | name. | ||
| 10 | |||
| 11 | This fix does not affect the intended context switch tracing. | ||
| 12 | |||
| 13 | |||
| 14 | Upstream-Status: Pending | ||
| 15 | |||
| 16 | Signed-off-by: George Nita <george.nita@enea.com> | ||
| 17 | |||
| 18 | |||
| 19 | diff --git a/tapset/linux/scheduler.stp b/tapset/linux/scheduler.stp | ||
| 20 | index 7596a46..3fb5b4b 100644 | ||
| 21 | --- a/tapset/linux/scheduler.stp | ||
| 22 | +++ b/tapset/linux/scheduler.stp | ||
| 23 | @@ -120,7 +120,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
| 24 | %( arch != "x86_64" && arch != "ia64" && arch != "arm" %? | ||
| 25 | kernel.function("__switch_to") | ||
| 26 | %: | ||
| 27 | - kernel.function("context_switch") | ||
| 28 | + kernel.function("prepare_task_switch") | ||
| 29 | %) | ||
| 30 | { | ||
| 31 | name = "ctxswitch" | ||
| 32 | @@ -140,7 +140,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
| 33 | prev_task_name = task_execname($prev_p) | ||
| 34 | prevtsk_state = $prev_p->state | ||
| 35 | } | ||
| 36 | - else { | ||
| 37 | + else if (@defined($prev)) { | ||
| 38 | prev_priority = $prev->prio | ||
| 39 | prev_pid = $prev->tgid | ||
| 40 | prev_tid = $prev->pid | ||
| 41 | @@ -148,6 +148,15 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
| 42 | prev_task_name = task_execname($prev) | ||
| 43 | prevtsk_state = $prev->state | ||
| 44 | } | ||
| 45 | + else { | ||
| 46 | + prev_priority = 0 | ||
| 47 | + prev_pid = 0 | ||
| 48 | + prev_tid = 0 | ||
| 49 | + /* No prev_task, dummy */ | ||
| 50 | + prev_task = task_current() | ||
| 51 | + prev_task_name = "UNAVAILABLE" | ||
| 52 | + prevtsk_state = 0 | ||
| 53 | + } | ||
| 54 | |||
| 55 | if (@defined($next)) { | ||
| 56 | next_priority = $next->prio | ||
| 57 | @@ -165,7 +174,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
| 58 | next_task_name = task_execname($next_p) | ||
| 59 | nexttsk_state = $next_p->state | ||
| 60 | } | ||
| 61 | - else { | ||
| 62 | + else if (@defined($new)) { | ||
| 63 | next_priority = $new->prio | ||
| 64 | next_pid = $new->tgid | ||
| 65 | next_tid = $new->pid | ||
| 66 | @@ -173,6 +182,14 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
| 67 | next_task_name = task_execname($new) | ||
| 68 | nexttsk_state = $new->state | ||
| 69 | } | ||
| 70 | + else { | ||
| 71 | + next_task = task_current() | ||
| 72 | + next_priority = task_prio(next_task) | ||
| 73 | + next_pid = task_pid(next_task) | ||
| 74 | + next_tid = task_tid(next_task) | ||
| 75 | + next_task_name = task_execname(next_task) | ||
| 76 | + nexttsk_state = task_state(next_task) | ||
| 77 | + } | ||
| 78 | } | ||
| 79 | |||
| 80 | |||
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb new file mode 100644 index 0000000000..bcc826a62e --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap_git.bb | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | DESCRIPTION = "SystemTap - script-directed dynamic tracing and performance analysis tool for Linux" | ||
| 2 | |||
| 3 | require systemtap_git.inc | ||
| 4 | |||
| 5 | DEPENDS = "elfutils sqlite3 systemtap-native" | ||
| 6 | DEPENDS_class-native = "elfutils-native sqlite3-native gettext-native" | ||
| 7 | DEPENDS_class-nativesdk = "nativesdk-elfutils nativesdk-sqlite3 nativesdk-gettext" | ||
| 8 | |||
| 9 | RDEPENDS_${PN} += "python bash" | ||
| 10 | RDEPENDS_${PN}_class-native += "python-native" | ||
| 11 | RDEPENDS_${PN}_class-nativesdk += "python-native" | ||
| 12 | |||
| 13 | EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \ | ||
| 14 | --without-nss --without-avahi --without-dyninst \ | ||
| 15 | --disable-server --disable-grapher \ | ||
| 16 | ac_cv_prog_have_javac=no \ | ||
| 17 | ac_cv_prog_have_jar=no " | ||
| 18 | |||
| 19 | STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs" | ||
| 20 | |||
| 21 | EXTRA_OECONF += "${STAP_DOCS} " | ||
| 22 | |||
| 23 | inherit autotools gettext pkgconfig | ||
| 24 | |||
| 25 | BBCLASSEXTEND = "native nativesdk" | ||
| 26 | |||
| 27 | FILES_${PN}-dbg += "${libexecdir}/systemtap/.debug" | ||
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc new file mode 100644 index 0000000000..4b6857ee96 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap_git.inc | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | LICENSE = "GPLv2" | ||
| 2 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
| 3 | |||
| 4 | SRCREV = "e58138572ebddac9498b93c76770eeca7d45e3b1" | ||
| 5 | PV = "2.3+git${SRCPV}" | ||
| 6 | |||
| 7 | SRC_URI = "git://sourceware.org/git/systemtap.git \ | ||
| 8 | file://docproc-build-fix.patch \ | ||
| 9 | file://obsolete_automake_macros.patch \ | ||
| 10 | file://scheduler-stp.patch \ | ||
| 11 | " | ||
| 12 | |||
| 13 | FILESPATH = "${FILE_DIRNAME}/systemtap" | ||
| 14 | |||
| 15 | SRC_URI[md5sum] = "cb202866ed704c44a876d041f788bdee" | ||
| 16 | SRC_URI[sha256sum] = "8ffe35caec0d937bd23fd78a3a8d94b58907cc0de0330b35e38f9f764815c459" | ||
| 17 | |||
| 18 | # systemtap doesn't support mips | ||
| 19 | COMPATIBLE_HOST = '(x86_64.*|i.86.*|powerpc.*|arm.*)-linux' | ||
| 20 | |||
| 21 | S = "${WORKDIR}/git" | ||
| 22 | |||
| 23 | # systemtap can't be built without optimization, if someone tries to compile an | ||
| 24 | # entire image as -O0, we override it with -O2 here and give a note about it. | ||
| 25 | def get_optimization(d): | ||
| 26 | selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True) | ||
| 27 | if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x": | ||
| 28 | bb.note("systemtap can't be built with -O0, -O2 will be used instead.") | ||
| 29 | return selected_optimization.replace("-O0", "-O2") | ||
| 30 | return selected_optimization | ||
| 31 | |||
| 32 | SELECTED_OPTIMIZATION := "${@get_optimization(d)}" | ||
| 33 | |||
