summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/systemtap
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2014-06-26 14:36:22 +0200
committerAdrian Dudau <adrian.dudau@enea.com>2014-06-26 15:32:53 +0200
commitf4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch)
tree487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-kernel/systemtap
downloadpoky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-kernel/systemtap')
-rw-r--r--meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb42
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch19
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch15
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch109
-rw-r--r--meta/recipes-kernel/systemtap/systemtap_git.bb27
-rw-r--r--meta/recipes-kernel/systemtap/systemtap_git.inc28
6 files changed, 240 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..ab9acba023
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
@@ -0,0 +1,42 @@
1SUMMARY = "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
14FILES_${PN} += "${datadir}/systemtap/runtime/uprobes"
15
16EXTRA_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.
21do_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
36do_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 @@
1Upstream-Status: Inappropriate [configuration]
2
3Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
4
5Index: 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 @@
1Upstream-Status: Pending
2
3Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
4Index: 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..9897e481a3
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch
@@ -0,0 +1,109 @@
1scheduler.stp: Handle missing symbols.
2
3Compiler output code optimization leads to missing debug data for some
4target variables, in particular some inline functions parameters, e.g.
5context_switch.
6
7Handle this by testing for variable name resolvability and provide default
8variable values in case no suitable target data is available through variable
9name. Affected functions: ctxswitch,wakeup.
10
11This fix does not affect the intended context switch tracing.
12
13
14Upstream-Status: Pending
15
16Signed-off-by: George Nita <george.nita@enea.com>
17
18
19diff --git a/tapset/linux/scheduler.stp b/tapset/linux/scheduler.stp
20index 7596a46..539a0f1 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
81@@ -254,12 +271,22 @@ probe scheduler.wakeup =
82 kernel.function("try_to_wake_up")
83 {
84 name = "wakeup"
85- task = $p
86- task_pid = $p->tgid
87- task_tid = $p->pid
88- task_priority = $p->prio
89- task_cpu = task_cpu($p)
90- task_state = task_state($p)
91+ if (@defined($p)) {
92+ task = $p
93+ task_pid = $p->tgid
94+ task_tid = $p->pid
95+ task_priority = $p->prio
96+ task_cpu = task_cpu($p)
97+ task_state = task_state($p)
98+ }
99+ else {
100+ task = task_current()
101+ task_pid = task_pid(task)
102+ task_tid = task_tid(task)
103+ task_priority = task_prio(task)
104+ task_cpu = task_cpu(task)
105+ task_state = task_state(task)
106+ }
107 }
108
109 /**
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb
new file mode 100644
index 0000000000..488d417150
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap_git.bb
@@ -0,0 +1,27 @@
1SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
2
3require systemtap_git.inc
4
5DEPENDS = "elfutils sqlite3 systemtap-native"
6DEPENDS_class-native = "elfutils-native sqlite3-native gettext-native"
7DEPENDS_class-nativesdk = "nativesdk-elfutils nativesdk-sqlite3 nativesdk-gettext"
8
9RDEPENDS_${PN} += "python bash"
10RDEPENDS_${PN}_class-native += "python-native"
11RDEPENDS_${PN}_class-nativesdk += "python-native"
12
13EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
14 --without-nss --without-avahi --without-dyninst \
15 --disable-server --disable-grapher --enable-prologues \
16 ac_cv_prog_have_javac=no \
17 ac_cv_prog_have_jar=no "
18
19STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs"
20
21EXTRA_OECONF += "${STAP_DOCS} "
22
23inherit autotools gettext pkgconfig
24
25BBCLASSEXTEND = "native nativesdk"
26
27FILES_${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..e5f4da9830
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -0,0 +1,28 @@
1LICENSE = "GPLv2"
2LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
3SRCREV = "ae91e3d552aff4f0e74662d055dae06ea55eb6bc"
4PV = "2.5+git${SRCPV}"
5
6SRC_URI = "git://sourceware.org/git/systemtap.git \
7 file://docproc-build-fix.patch \
8 file://obsolete_automake_macros.patch \
9 file://scheduler-stp.patch \
10 "
11
12FILESPATH = "${FILE_DIRNAME}/systemtap"
13
14# systemtap doesn't support mips
15COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64).*-linux'
16
17S = "${WORKDIR}/git"
18
19# systemtap can't be built without optimization, if someone tries to compile an
20# entire image as -O0, we override it with -O2 here and give a note about it.
21def get_optimization(d):
22 selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
23 if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
24 bb.note("systemtap can't be built with -O0, -O2 will be used instead.")
25 return selected_optimization.replace("-O0", "-O2")
26 return selected_optimization
27
28SELECTED_OPTIMIZATION := "${@get_optimization(d)}"