summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
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
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')
-rw-r--r--meta/recipes-kernel/blktrace/blktrace/ldflags.patch89
-rw-r--r--meta/recipes-kernel/blktrace/blktrace_git.bb28
-rw-r--r--meta/recipes-kernel/dtc/dtc.inc18
-rw-r--r--meta/recipes-kernel/dtc/dtc/make_install.patch17
-rw-r--r--meta/recipes-kernel/dtc/dtc_git.bb11
-rw-r--r--meta/recipes-kernel/kern-tools/kern-tools-native_git.bb23
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools.inc17
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools_2.0.4.bb11
-rw-r--r--meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb46
-rw-r--r--meta/recipes-kernel/kmod/kmod-native_git.bb18
-rw-r--r--meta/recipes-kernel/kmod/kmod.inc38
-rw-r--r--meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch39
-rw-r--r--meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch21
-rw-r--r--meta/recipes-kernel/kmod/kmod/depmod-search.conf6
-rw-r--r--meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch38
-rw-r--r--meta/recipes-kernel/kmod/kmod/ptest.patch25
-rwxr-xr-xmeta/recipes-kernel/kmod/kmod/run-ptest3
-rw-r--r--meta/recipes-kernel/kmod/kmod_git.bb71
-rw-r--r--meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch49
-rw-r--r--meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch39
-rw-r--r--meta/recipes-kernel/latencytop/latencytop_0.5.bb24
-rw-r--r--meta/recipes-kernel/libpfm/libpfm4_4.3.0.bb29
-rw-r--r--meta/recipes-kernel/linux-firmware/linux-firmware_git.bb223
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc73
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.14.bb7
-rw-r--r--meta/recipes-kernel/linux/linux-dtb.inc69
-rw-r--r--meta/recipes-kernel/linux/linux-dummy.bb51
-rw-r--r--meta/recipes-kernel/linux/linux-dummy/COPYING.GPL339
-rw-r--r--meta/recipes-kernel/linux/linux-yocto-dev.bb58
-rw-r--r--meta/recipes-kernel/linux/linux-yocto-rt_3.10.bb27
-rw-r--r--meta/recipes-kernel/linux/linux-yocto-rt_3.4.bb30
-rw-r--r--meta/recipes-kernel/linux/linux-yocto-tiny_3.10.bb22
-rw-r--r--meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb21
-rw-r--r--meta/recipes-kernel/linux/linux-yocto-tiny_3.4.bb26
-rw-r--r--meta/recipes-kernel/linux/linux-yocto.inc45
-rw-r--r--meta/recipes-kernel/linux/linux-yocto_3.10.bb38
-rw-r--r--meta/recipes-kernel/linux/linux-yocto_3.14.bb37
-rw-r--r--meta/recipes-kernel/linux/linux-yocto_3.4.bb38
-rw-r--r--meta/recipes-kernel/lttng/babeltrace_1.1.1.bb22
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/bio-bvec-iter.patch156
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules/lttng-modules-replace-KERNELDIR-with-KERNEL_SRC.patch81
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules_2.3.3.bb35
-rw-r--r--meta/recipes-kernel/lttng/lttng-modules_2.4.0.bb38
-rwxr-xr-xmeta/recipes-kernel/lttng/lttng-tools/run-ptest4
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch27
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/runtest.patch52
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools_2.3.1.bb59
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools_2.4.0.bb59
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch18
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust_2.3.1.bb32
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust_2.4.0.bb32
-rw-r--r--meta/recipes-kernel/modutils-initscripts/files/PD.patch8
-rwxr-xr-xmeta/recipes-kernel/modutils-initscripts/files/modutils.sh52
-rw-r--r--meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb20
-rw-r--r--meta/recipes-kernel/oprofile/oprofile.inc36
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-AArch64-architecture.patch31
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-Allow-ppc64-events-to-be-specified-with-or-without-_.patch208
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch49
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-Fix-PPC64-specific-libpfm-usage-so-it-doesn-t-break-.patch132
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-Fix-up-configure-to-handle-architectures-that-do-not.patch163
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-Handle-early-perf_events-kernel-without-PERF_RECORD_.patch107
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-OProfile-doesn-t-build-for-32-bit-ppc-the-operf_util.patch32
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-ophelp-lists-events-Fix-doc-URL-for-ppc64-arch.patch36
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/acinclude.m4581
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/oprofile-no-query-modules.patch29
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch113
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/opstart.patch245
-rw-r--r--meta/recipes-kernel/oprofile/oprofile_0.9.8.bb22
-rw-r--r--meta/recipes-kernel/oprofile/oprofile_git.bb11
-rwxr-xr-xmeta/recipes-kernel/oprofile/oprofileui-server/init37
-rw-r--r--meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service6
-rw-r--r--meta/recipes-kernel/oprofile/oprofileui-server_git.bb32
-rw-r--r--meta/recipes-kernel/oprofile/oprofileui.inc16
-rw-r--r--meta/recipes-kernel/oprofile/oprofileui_git.bb17
-rw-r--r--meta/recipes-kernel/perf/perf-features.inc22
-rw-r--r--meta/recipes-kernel/perf/perf.bb160
-rw-r--r--meta/recipes-kernel/powertop/powertop_2.5.bb30
-rw-r--r--meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch22
-rw-r--r--meta/recipes-kernel/sysprof/files/rmb-arm.patch21
-rw-r--r--meta/recipes-kernel/sysprof/files/rmb-mips.patch22
-rw-r--r--meta/recipes-kernel/sysprof/sysprof_git.bb20
-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
-rw-r--r--meta/recipes-kernel/trace-cmd/kernelshark_1.2.bb30
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/addldflags.patch51
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch29
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/kernelshark-fix-syntax-error-of-shell.patch30
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/make-docs-optional.patch36
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch61
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch38
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch96
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-fix-syntax-error-of-shell.patch30
-rw-r--r--meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb31
97 files changed, 5331 insertions, 0 deletions
diff --git a/meta/recipes-kernel/blktrace/blktrace/ldflags.patch b/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
new file mode 100644
index 0000000000..b9c7c20c2b
--- /dev/null
+++ b/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
@@ -0,0 +1,89 @@
1blktrace: obey LDFLAGS
2
3Upstream-Status: Pending
4
5Signed-off-by: Christopher Larson <chris_larson@mentor.com>
6
7the patch was imported from meta-mentor layer on yoctoproject git server
8http://git.yoctoproject.org/cgit/cgit.cgi/meta-mentor as of commit id
9aed463414e2e2bf8ca44ba54ee5973e7ed599e57
10
11Signed-off-by: Fahad Usman <fahad_usman@mentor.com>
12---
13 Makefile | 11 ++++++-----
14 btreplay/Makefile | 3 ++-
15 btt/Makefile | 3 ++-
16 3 files changed, 10 insertions(+), 7 deletions(-)
17
18--- git.orig/Makefile
19+++ git/Makefile
20@@ -1,5 +1,6 @@
21 CC = gcc
22 CFLAGS = -Wall -O2 -g -W
23+LDFLAGS =
24 ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
25 PROGS = blkparse blktrace verify_blkparse blkrawverify blkiomon
26 LIBS = -lpthread
27@@ -23,19 +24,19 @@ btreplay/btreplay:
28 $(CC) -o $*.o -c $(ALL_CFLAGS) $<
29
30 blkparse: blkparse.o blkparse_fmt.o rbtree.o act_mask.o
31- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
32+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
33
34 blktrace: blktrace.o act_mask.o
35- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
36+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
37
38 verify_blkparse: verify_blkparse.o
39- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
40+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
41
42 blkrawverify: blkrawverify.o
43- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
44+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
45
46 blkiomon: blkiomon.o rbtree.o
47- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt
48+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt $(LDFLAGS)
49
50 $(PROGS): | depend
51
52--- git.orig/btreplay/Makefile
53+++ git/btreplay/Makefile
54@@ -7,6 +7,7 @@
55
56 CC = gcc
57 CFLAGS = -Wall -W -O2 -g
58+LDFLAGS =
59 INCS = -I. -I.. -I../btt
60 OCFLAGS = -UCOUNT_IOS -UDEBUG -DNDEBUG
61 XCFLAGS = -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
62@@ -35,7 +36,7 @@ btrecord: btrecord.o
63 $(CC) $(CFLAGS) -o $@ $(filter %.o,$^)
64
65 btreplay: btreplay.o
66- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
67+ $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
68
69 depend:
70 @$(CC) -MM $(CFLAGS) *.c 1> .depend
71--- git.orig/btt/Makefile
72+++ git/btt/Makefile
73@@ -7,6 +7,7 @@
74
75 CC = gcc
76 CFLAGS = -Wall -W -O2 -g
77+LDFLAGS =
78 INCS = -I. -I..
79 XCFLAGS = -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
80 override CFLAGS += $(INCS) $(XCFLAGS)
81@@ -38,7 +39,7 @@ clean: docsclean
82 $(CC) $(CFLAGS) -c -o $*.o $<
83
84 btt: $(OBJS)
85- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
86+ $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
87
88 ifneq ($(wildcard .depend),)
89 include .depend
diff --git a/meta/recipes-kernel/blktrace/blktrace_git.bb b/meta/recipes-kernel/blktrace/blktrace_git.bb
new file mode 100644
index 0000000000..7a329934b8
--- /dev/null
+++ b/meta/recipes-kernel/blktrace/blktrace_git.bb
@@ -0,0 +1,28 @@
1SUMMARY = "Generates traces of I/O traffic on block devices"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
4
5DEPENDS = "libaio"
6
7SRCREV = "d6918c8832793b4205ed3bfede78c2f915c23385"
8
9PR = "r6"
10PV = "1.0.5+git${SRCPV}"
11
12SRC_URI = "git://git.kernel.dk/blktrace.git \
13 file://ldflags.patch"
14
15S = "${WORKDIR}/git"
16
17EXTRA_OEMAKE = "\
18 'CC=${CC}' \
19 'CFLAGS=${CFLAGS}' \
20 'LDFLAGS=${LDFLAGS}' \
21"
22PARALLEL_MAKE = ""
23
24do_install() {
25 oe_runmake ARCH="${ARCH}" prefix=${prefix} \
26 mandir=${mandir} DESTDIR=${D} install
27}
28
diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
new file mode 100644
index 0000000000..3eca25fe41
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc.inc
@@ -0,0 +1,18 @@
1SUMMARY = "Device Tree Compiler"
2DESCRIPTION = "The Device Tree Compiler is a tool used to manipulate the Open-Firmware-like device tree used by PowerPC kernels."
3SECTION = "bootloader"
4LICENSE = "GPLv2 | BSD"
5DEPENDS = "flex-native bison-native"
6
7inherit autotools-brokensep
8
9SRC_URI = "git://www.jdl.com/software/dtc.git \
10 file://make_install.patch \
11 "
12
13EXTRA_OEMAKE='PREFIX="${prefix}" LIBDIR="${libdir}"'
14
15S = "${WORKDIR}/git"
16
17PACKAGES =+ "${PN}-misc"
18FILES_${PN}-misc = "${bindir}/convert-dtsv0 ${bindir}/ftdump ${bindir}/dtdiff"
diff --git a/meta/recipes-kernel/dtc/dtc/make_install.patch b/meta/recipes-kernel/dtc/dtc/make_install.patch
new file mode 100644
index 0000000000..1120617e7b
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc/make_install.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Inappropriate [configuration]
2
3Index: git/Makefile
4===================================================================
5--- git.orig/Makefile 2011-11-02 14:52:17.243104779 -0700
6+++ git/Makefile 2011-11-02 15:06:01.555104982 -0700
7@@ -161,8 +161,8 @@
8 $(INSTALL) -d $(DESTDIR)$(BINDIR)
9 $(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR)
10 $(INSTALL) -d $(DESTDIR)$(LIBDIR)
11- $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
12- ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
13+ $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
14+ ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/$(notdir $(LIBFDT_lib))
15 ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT)
16 $(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR)
17 $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
diff --git a/meta/recipes-kernel/dtc/dtc_git.bb b/meta/recipes-kernel/dtc/dtc_git.bb
new file mode 100644
index 0000000000..0bd3acf6c0
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc_git.bb
@@ -0,0 +1,11 @@
1require dtc.inc
2
3LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
4 file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c"
5
6SRCREV = "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf"
7PV = "1.4.0+git${SRCPV}"
8
9S = "${WORKDIR}/git"
10
11BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
new file mode 100644
index 0000000000..1a2f881c7a
--- /dev/null
+++ b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -0,0 +1,23 @@
1SUMMARY = "Tools for managing Yocto Project style branched kernels"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=d8d1d729a70cd5f52972f8884b80743d"
4
5DEPENDS = "git-native"
6
7SRCREV = "a42509b01ccfe5020a226b23d3a52c07b3fb2051"
8PR = "r12"
9PV = "0.2+git${SRCPV}"
10
11inherit native
12
13SRC_URI = "git://git.yoctoproject.org/yocto-kernel-tools.git"
14S = "${WORKDIR}"
15
16do_compile() {
17 :
18}
19
20do_install() {
21 cd ${S}/git
22 make DESTDIR=${D}${bindir} install
23}
diff --git a/meta/recipes-kernel/kexec/kexec-tools.inc b/meta/recipes-kernel/kexec/kexec-tools.inc
new file mode 100644
index 0000000000..50b448caed
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools.inc
@@ -0,0 +1,17 @@
1SUMMARY = "Kexec fast reboot tools"
2DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
3AUTHOR = "Eric Biederman"
4HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
5SECTION = "kernel/userland"
6LICENSE = "GPLv2"
7LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
8 file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
9DEPENDS = "zlib xz"
10
11SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz"
12
13inherit autotools-brokensep
14
15COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*|mips.*)-(linux|freebsd.*)'
16
17INSANE_SKIP_${PN} = "arch"
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.4.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.4.bb
new file mode 100644
index 0000000000..de44cf0c74
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.4.bb
@@ -0,0 +1,11 @@
1require kexec-tools.inc
2export LDFLAGS = "-L${STAGING_LIBDIR}"
3EXTRA_OECONF = " --with-zlib=yes"
4
5SRC_URI[md5sum] = "b9f2a3ba0ba9c78625ee7a50532500d8"
6SRC_URI[sha256sum] = "6ba1872c58434b8e92506ff515c7ef64555671af54097bae51b833bda3f5126c"
7
8PACKAGES =+ "kexec kdump"
9
10FILES_kexec = "${sbindir}/kexec"
11FILES_kdump = "${sbindir}/kdump"
diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
new file mode 100644
index 0000000000..ec20bf8d30
--- /dev/null
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -0,0 +1,46 @@
1SUMMARY = "Wrapper script for the Linux kernel module dependency indexer"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5INHIBIT_DEFAULT_DEPS = "1"
6# The kernel and the staging dir for it is machine specific
7PACKAGE_ARCH = "${MACHINE_ARCH}"
8
9# We need the following for the sstate code to process the wrapper
10SSTATE_SCAN_FILES += "depmodwrapper"
11
12do_install() {
13 install -d ${D}${bindir_crossscripts}/
14
15 cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF
16#!/bin/sh
17# Expected to be called as: depmodwrapper -a KERNEL_VERSION
18if [ "\$1" != "-a" -o "\$2" != "-b" ]; then
19 echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2
20 exit 1
21fi
22if [ ! -r ${STAGING_KERNEL_DIR}/kernel-abiversion ]; then
23 echo "Unable to read: ${STAGING_KERNEL_DIR}/kernel-abiversion" >&2
24else
25 kernelabi=\$(cat ${STAGING_KERNEL_DIR}/kernel-abiversion)
26 if [ "\$kernelabi" != "\$4" ]; then
27 echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2
28 exit 1
29 fi
30fi
31
32if [ ! -r ${STAGING_KERNEL_DIR}/System.map-\$4 ]; then
33 echo "Unable to read: ${STAGING_KERNEL_DIR}/System.map-\$4" >&2
34 exec env depmod "\$1" "\$2" "\$3" "\$4"
35else
36 exec env depmod "\$1" "\$2" "\$3" -F "${STAGING_KERNEL_DIR}/System.map-\$4" "\$4"
37fi
38EOF
39 chmod +x ${D}${bindir_crossscripts}/depmodwrapper
40}
41
42SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess"
43
44depmodwrapper_sysroot_preprocess () {
45 sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
46}
diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb
new file mode 100644
index 0000000000..f0e274ed79
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod-native_git.bb
@@ -0,0 +1,18 @@
1# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4require kmod.inc
5
6DEPENDS += "zlib-native"
7
8inherit native
9
10SRC_URI += "file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \
11 "
12
13do_install_append (){
14 for tool in depmod insmod lsmod modinfo modprobe rmmod
15 do
16 ln -s kmod ${D}${bindir}/$tool
17 done
18}
diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc
new file mode 100644
index 0000000000..47445eb8bf
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod.inc
@@ -0,0 +1,38 @@
1# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4SUMMARY = "Tools for managing Linux kernel modules"
5DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \
6 insert, remove, list, check properties, resolve dependencies and aliases."
7HOMEPAGE = "http://packages.profusion.mobi/kmod/"
8LICENSE = "GPL-2.0+ & LGPL-2.1+"
9LICENSE_libkmod = "LGPL-2.1+"
10SECTION = "base"
11
12DEPENDS += "pkgconfig-native"
13
14LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
15 file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
16 "
17inherit autotools gtk-doc ptest
18
19SRCREV = "36c4bb928a6a7962dd0ad3aa64c0b18120ca5b46"
20# Lookout for PV bump too when SRCREV is changed
21PV = "16+git${SRCPV}"
22
23SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \
24 file://depmod-search.conf \
25 file://run-ptest \
26 file://ptest.patch \
27 file://avoid_parallel_tests.patch \
28 file://fix-O_CLOEXEC.patch \
29 "
30
31S = "${WORKDIR}/git"
32
33EXTRA_AUTORECONF += "--install --symlink"
34EXTRA_OECONF +="--enable-debug --enable-logging --enable-tools --disable-manpages --with-zlib"
35
36do_configure_prepend () {
37 gtkdocize --docdir ${S}/libkmod/docs || touch ${S}/libkmod/docs/gtk-doc.make
38}
diff --git a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
new file mode 100644
index 0000000000..82b83b36b7
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
@@ -0,0 +1,39 @@
1From 0c4dbadc9db3cda1cfca64e44ea08c6e89919ea7 Mon Sep 17 00:00:00 2001
2From: Ting Liu <b28495@freescale.com>
3Date: Tue, 10 Sep 2013 13:44:18 +0800
4Subject: [PATCH] Change to calling bswap_* instead of htobe* and be*toh
5
6We can't use htobe* and be*toh functions because they are not
7available on older versions of glibc, For example, shipped on Centos 5.5.
8
9Change to directly calling bswap_* as defined in+byteswap.h.
10
11Signed-off-by: Ting Liu <b28495@freescale.com>
12---
13 libkmod/libkmod-signature.c | 3 ++-
14 1 files changed, 2 insertions(+), 1 deletions(-)
15
16diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
17index 6b80caa..3544a36 100644
18--- a/libkmod/libkmod-signature.c
19+++ b/libkmod/libkmod-signature.c
20@@ -19,6 +19,7 @@
21 */
22
23 #include <endian.h>
24+#include <byteswap.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 #include <string.h>
28@@ -121,7 +122,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
29 modsig->hash >= PKEY_HASH__LAST ||
30 modsig->id_type >= PKEY_ID_TYPE__LAST)
31 return false;
32- sig_len = be32toh(modsig->sig_len);
33+ sig_len = bswap_32(modsig->sig_len);
34 if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len))
35 return false;
36
37--
381.7.5.4
39
diff --git a/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
new file mode 100644
index 0000000000..4c37d44836
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
@@ -0,0 +1,21 @@
1Avoid parallel-tests as it remove
2buildtest-TESTS and runtest-TESTS targets required by ptest.
3In automake 1.13.4 parallel-tests is assumed by defauls.
4In order to have buildtest-TESTS and runtest-TESTS targets
5serial-tests is now required
6
7Signed-off-by: Tudor Florea <tudor.florea@enea.com>
8Upstream-Status: Inappropriate (disable feature incompatible with ptest)
9
10diff -ruN a/configure.ac b/configure.ac
11--- a/configure.ac 2013-09-02 15:05:18.662366800 +0200
12+++ b/configure.ac 2013-11-28 09:26:49.557066764 +0200
13@@ -8,7 +8,7 @@
14 AC_CONFIG_SRCDIR([libkmod/libkmod.c])
15 AC_CONFIG_AUX_DIR([build-aux])
16 AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules
17- tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests])
18+ tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests])
19 AC_PROG_CC_STDC
20 AC_USE_SYSTEM_EXTENSIONS
21 AC_SYS_LARGEFILE
diff --git a/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/meta/recipes-kernel/kmod/kmod/depmod-search.conf
new file mode 100644
index 0000000000..527c0bb6ee
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/depmod-search.conf
@@ -0,0 +1,6 @@
1#
2# /etc/depmod.d/depmod.conf
3#
4
5search updates extramodules built-in
6
diff --git a/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
new file mode 100644
index 0000000000..8161d6128d
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
@@ -0,0 +1,38 @@
1From bd43367eee868059770188fd9e9db38520dc6fff Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Wed, 22 Jan 2014 01:06:40 -0500
4Subject: [PATCH] libkmod/libkmod-internal.h: check whether O_CLOEXEC is
5 defined or not
6
7O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
8it, we need check before use.
9
10This patch is much more like a workaround, since it may need fcntl() use
11FD_CLOEXEC to replace.
12
13This problem was reported by "Ting Liu <b28495@freescale.com>"
14Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15
16Upstream-Status: Pending
17---
18 libkmod/libkmod-internal.h | 4 ++++
19 1 file changed, 4 insertions(+)
20
21diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h
22index 0180124..100b40f 100644
23--- a/libkmod/libkmod-internal.h
24+++ b/libkmod/libkmod-internal.h
25@@ -9,6 +9,10 @@
26 #include "macro.h"
27 #include "libkmod.h"
28
29+#ifndef O_CLOEXEC
30+#define O_CLOEXEC 0
31+#endif
32+
33 static _always_inline_ _printf_format_(2, 3) void
34 kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {}
35
36--
371.7.10.4
38
diff --git a/meta/recipes-kernel/kmod/kmod/ptest.patch b/meta/recipes-kernel/kmod/kmod/ptest.patch
new file mode 100644
index 0000000000..831dbcb909
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/ptest.patch
@@ -0,0 +1,25 @@
1Add 'install-ptest' rule.
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/Makefile.am b/Makefile.am
7--- a/Makefile.am 2013-07-12 17:11:05.278331557 +0200
8+++ b/Makefile.am 2013-07-12 17:14:27.033788016 +0200
9@@ -204,6 +204,16 @@
10
11 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
12
13+install-ptest:
14+ @$(MKDIR_P) $(DESTDIR)/testsuite
15+ @for file in $(TESTSUITE); do \
16+ install $$file $(DESTDIR)/testsuite; \
17+ done;
18+ @sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile
19+ @$(MKDIR_P) $(DESTDIR)/tools
20+ @cp $(noinst_SCRIPTS) $(noinst_PROGRAMS) $(DESTDIR)/tools
21+ @cp -r testsuite/rootfs testsuite/.libs $(DESTDIR)/testsuite
22+
23 # ------------------------------------------------------------------------------
24 # custom release helpers
25 # ------------------------------------------------------------------------------
diff --git a/meta/recipes-kernel/kmod/kmod/run-ptest b/meta/recipes-kernel/kmod/kmod/run-ptest
new file mode 100755
index 0000000000..37adec3d2f
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2touch testsuite/stamp-rootfs
3make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL
diff --git a/meta/recipes-kernel/kmod/kmod_git.bb b/meta/recipes-kernel/kmod/kmod_git.bb
new file mode 100644
index 0000000000..c55cbd3e1e
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod_git.bb
@@ -0,0 +1,71 @@
1# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4require kmod.inc
5
6DEPENDS += "zlib"
7PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
8RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
9RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
10RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
11
12# to force user to remove old module-init-tools and replace them with kmod variants
13RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
14
15# autotools set prefix to /usr, however we want them in /bin and /sbin
16bindir = "${base_bindir}"
17sbindir = "${base_sbindir}"
18# libdir = "${base_libdir}"
19
20do_install_append () {
21 install -dm755 ${D}${base_bindir}
22 install -dm755 ${D}${base_sbindir}
23 # add symlinks to kmod
24 ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod
25 for tool in insmod rmmod depmod modinfo modprobe; do
26 ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool}
27 done
28 # configuration directories
29 install -dm755 ${D}${base_libdir}/depmod.d
30 install -dm755 ${D}${base_libdir}/modprobe.d
31 install -dm755 ${D}${sysconfdir}/depmod.d
32 install -dm755 ${D}${sysconfdir}/modprobe.d
33
34 # install depmod.d file for search/ dir
35 install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
36
37}
38
39do_compile_prepend() {
40 sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status
41}
42
43do_compile_ptest () {
44 oe_runmake buildtest-TESTS rootfs
45}
46
47INHIBIT_PACKAGE_STRIP = "${@base_contains("DISTRO_FEATURES", "ptest", "1", "0", d)}"
48INSANE_SKIP_${PN}-ptest = "arch"
49
50inherit update-alternatives
51
52ALTERNATIVE_PRIORITY = "60"
53
54ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
55
56ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
57ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
58ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
59ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
60ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
61
62ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
63ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
64
65ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
66
67PACKAGES =+ "libkmod ${PN}-bash-completion"
68
69FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
70FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d"
71FILES_${PN}-bash-completion = "${datadir}/bash-completion"
diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch
new file mode 100644
index 0000000000..7848ccf2ae
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch
@@ -0,0 +1,49 @@
1linux: sysfs: use tracing_on as tracing_enabled is deprecated
2
3tracing_enabled use in the kernel is being deprecated as per commit
46752ab4a9c30 [tracing: Deprecate tracing_enabled for tracing_on] in
5the linux mainline kernel. tracing_enabled use will generate a warning
6and may no longer function as expected, therefore move to use tracing_on.
7
8Upstream-Status: Pending
9
10Signed-off-by: Dennis Hall <dennis.hall@windriver.com>
11
12Index: latencytop-0.5/fsync.c
13===================================================================
14--- latencytop-0.5.orig/fsync.c 2012-08-03 10:45:49.000000000 -0400
15+++ latencytop-0.5/fsync.c 2012-08-03 10:48:39.000000000 -0400
16@@ -149,19 +149,19 @@
17 * cd /sys/kernel/debug/tracing
18 * echo fsync > current_tracer
19 * echo ftrace_printk > iter_ctrl
20- * echo 1 > tracing_enabled
21+ * echo 1 > tracing_on
22 */
23 ret = system("/bin/mount -t debugfs none /sys/kernel/debug/");
24 if (!ret)
25 return -1;
26 write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");
27 write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");
28- write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "1");
29+ write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
30 }
31
32 int disable_fsync_tracer(void)
33 {
34- write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "0");
35+ write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
36 }
37
38
39@@ -339,8 +339,8 @@
40 if (curduration > 5)
41 curduration = 5;
42 /* clear the ftrace buffer */
43- write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "0");
44- write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "1");
45+ write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
46+ write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
47 key = select(1, &rfds, NULL, NULL, &end);
48 parse_ftrace();
49 print_global_list();
diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch
new file mode 100644
index 0000000000..0cf217fa0b
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch
@@ -0,0 +1,39 @@
1diff --git a/Makefile.orig b/Makefile
2index 16a2369..fa797a2 100644
3--- a/Makefile.orig
4+++ b/Makefile
5@@ -1,10 +1,11 @@
6-# FIXME: Use autoconf ?
7-HAS_GTK_GUI = 1
8+# Upstream-Status: Inappropriate [configuration]
9+# Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
10
11 DESTDIR =
12 SBINDIR = /usr/sbin
13 XCFLAGS = -W -g `pkg-config --cflags glib-2.0` -D_FORTIFY_SOURCE=2 -Wno-sign-compare
14-LDF = -Wl,--as-needed `pkg-config --libs glib-2.0` -lncursesw
15+LDF = -Wl,--as-needed `pkg-config --libs glib-2.0` -lncurses
16+CC ?= gcc
17
18 OBJS= latencytop.o text_display.o translate.o fsync.o
19
20@@ -26,16 +27,17 @@ endif
21
22 # We write explicity this "implicit rule"
23 %.o : %.c
24- gcc -c $(CFLAGS) $(XCFLAGS) $< -o $@
25+ $(CC) -c $(CFLAGS) $(XCFLAGS) $< -o $@
26
27 latencytop: $(OBJS) latencytop.h Makefile
28- gcc $(CFLAGS) $(OBJS) $(LDF) -o latencytop
29+ $(CC) $(CFLAGS) $(OBJS) $(LDF) -o latencytop
30
31 clean:
32 rm -f *~ latencytop DEADJOE *.o
33
34 install: latencytop
35 mkdir -p $(DESTDIR)/usr/share/latencytop
36+ mkdir -p $(DESTDIR)/$(SBINDIR)
37 install -m 0644 latencytop.trans $(DESTDIR)/usr/share/latencytop/latencytop.trans
38 install -m 0644 *.png $(DESTDIR)/usr/share/latencytop/
39 install -m 0755 latencytop $(DESTDIR)$(SBINDIR)/
diff --git a/meta/recipes-kernel/latencytop/latencytop_0.5.bb b/meta/recipes-kernel/latencytop/latencytop_0.5.bb
new file mode 100644
index 0000000000..af44eb64e1
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop_0.5.bb
@@ -0,0 +1,24 @@
1SUMMARY = "Linux tool for measuring and fixing latency"
2HOMEPAGE = "http://www.latencytop.org/"
3
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://latencytop.c;endline=23;md5=ee9ea9b1415356e5734adad4a87dc7fa"
6
7DEPENDS = "virtual/libintl ncurses glib-2.0 ${@base_contains('DISTRO_FEATURES', 'x11', 'gtk+', '', d)}"
8
9PR = "r3"
10
11SRC_URI = "http://www.latencytop.org/download/latencytop-${PV}.tar.gz \
12 file://latencytop-makefile.patch \
13 file://latencytop-fsync.patch"
14
15SRC_URI[md5sum] = "73bb3371c6ee0b0e68e25289027e865c"
16SRC_URI[sha256sum] = "9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef"
17
18EXTRA_OEMAKE_X = "${@base_contains('DISTRO_FEATURES', 'x11', 'HAS_GTK_GUI=1', '', d)}"
19
20CFLAGS += "${LDFLAGS}"
21
22do_install() {
23 oe_runmake install DESTDIR=${D} ${EXTRA_OEMAKE_X}
24}
diff --git a/meta/recipes-kernel/libpfm/libpfm4_4.3.0.bb b/meta/recipes-kernel/libpfm/libpfm4_4.3.0.bb
new file mode 100644
index 0000000000..98852f6a9a
--- /dev/null
+++ b/meta/recipes-kernel/libpfm/libpfm4_4.3.0.bb
@@ -0,0 +1,29 @@
1SUMMARY = "Monitoring tools exploiting the performance monitoring events"
2DESCRIPTION = "This package provides a library, called libpfm4 which is used to develop \
3monitoring tools exploiting the performance monitoring events such as those \
4provided by the Performance Monitoring Unit (PMU) of modern processors."
5HOMEPAGE = "http://perfmon2.sourceforge.net/"
6BUGTRACKER = "http://sourceforge.net/tracker/?group_id=144822&atid=759953&source=navbar"
7
8LICENSE = "MIT"
9LIC_FILES_CHKSUM = "file://COPYING;md5=0de488f3bd4424e308e2e399cb99c788"
10
11SECTION = "devel"
12
13PR = "r1"
14COMPATIBLE_HOST = "powerpc64"
15
16SRC_URI = "http://downloads.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.3.0.tar.gz"
17
18SRC_URI[md5sum] = "0ab272dbdbb759b852ba8bd06db030ef"
19SRC_URI[sha256sum] = "a23eb9affbff279e13563a39317c0ad71c4de28908d4243c8bc109138430cc3b"
20
21EXTRA_OEMAKE = "DESTDIR=\"${D}\" PREFIX=\"${prefix}\" LIBDIR=\"${libdir}\" LDCONFIG=\"true\""
22EXTRA_OEMAKE_append_powerpc = " ARCH=\"powerpc\""
23EXTRA_OEMAKE_append_powerpc64 = " ARCH=\"powerpc\" BITMODE=\"64\""
24
25S = "${WORKDIR}/libpfm-${PV}"
26
27do_install () {
28 oe_runmake install
29}
diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
new file mode 100644
index 0000000000..c1483364f2
--- /dev/null
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -0,0 +1,223 @@
1SUMMARY = "Firmware files for use with Linux kernel"
2SECTION = "kernel"
3# Notes:
4# This is kind of a mess. Each bit of firmware has their own license. Some free
5# some not. Leaving this as Proprietary for now, but this recipe should be probably
6# be rethought out a bit more around how it deals with licenses.
7
8LICENSE = "Proprietary"
9
10LIC_FILES_CHKSUM = "file://LICENSE.radeon;md5=9c2faab1bfca55e1510d6bde67206f9c \
11 file://LICENSE.dib0700;md5=f7411825c8a555a1a3e5eab9ca773431 \
12 file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \
13 file://LICENCE.ralink-firmware.txt;md5=ab2c269277c45476fb449673911a2dfd \
14 file://LICENCE.qla2xxx;md5=4005328a134054f0fa077bdc37aa64f2 \
15 file://LICENCE.iwlwifi_firmware;md5=8b938534f77ffd453690eb34ed84ae8b \
16 file://LICENCE.i2400m;md5=14b901969e23c41881327c0d9e4b7d36 \
17 file://LICENCE.atheros_firmware;md5=30a14c7823beedac9fa39c64fdd01a13 \
18 file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
19 file://LICENCE.rtlwifi_firmware.txt;md5=00d06cfd3eddd5a2698948ead2ad54a5 \
20 file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc \
21 file://LICENCE.ti-connectivity;md5=186e7a43cf6c274283ad81272ca218ea \
22 file://LICENCE.atheros_firmware;md5=30a14c7823beedac9fa39c64fdd01a13 \
23 file://LICENCE.via_vt6656;md5=e4159694cba42d4377a912e78a6e850f \
24 file://LICENCE.Marvell;md5=9ddea1734a4baf3c78d845151f42a37a \
25 "
26
27SRCREV = "600caefd83a406540b2a789be6415e44c9b87add"
28PE = "1"
29PV = "0.0+git${SRCPV}"
30
31SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
32
33S = "${WORKDIR}/git"
34
35inherit allarch update-alternatives
36
37do_compile() {
38 :
39}
40
41do_install() {
42 install -d ${D}/lib/firmware/
43 cp -r * ${D}/lib/firmware/
44
45 # Avoid Makefile to be deplyed
46 rm ${D}/lib/firmware/Makefile
47
48 # Remove unbuild firmware which needs cmake and bash
49 rm ${D}/lib/firmware/carl9170fw -rf
50
51 # Remove pointless bash script
52 rm ${D}/lib/firmware/configure
53
54 # Libertas sd8686
55 ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
56 ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
57
58 # fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
59 ( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
60}
61
62
63PACKAGES =+ "${PN}-ralink \
64 ${PN}-radeon \
65 ${PN}-marvell-license ${PN}-sd8686 ${PN}-sd8787 ${PN}-sd8797 \
66 ${PN}-wl12xx ${PN}-vt6656 \
67 ${PN}-rtl-license ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su \
68 ${PN}-broadcom-license ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 \
69 ${PN}-atheros-license ${PN}-ar9170 ${PN}-ar3k ${PN}-ath6k ${PN}-ath9k \
70 ${PN}-iwlwifi-license ${PN}-iwlwifi-6000g2a-5 ${PN}-iwlwifi-6000g2b-6 ${PN}-iwlwifi-7260-7 \
71 ${PN}-iwlwifi-6000g2a-6 ${PN}-iwlwifi-135-6"
72
73
74FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
75
76LICENSE_${PN}-9170 = "Firmware-atheros_firmware"
77FILES_${PN}-ar9170 = " \
78 /lib/firmware/ar9170*.fw \
79"
80RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
81
82LICENSE_${PN}-ar3k = "Firmware-atheros_firmware"
83FILES_${PN}-ar3k = " \
84 /lib/firmware/ar3k \
85"
86RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
87
88LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
89FILES_${PN}-ath6k = " \
90 /lib/firmware/ath6k \
91"
92RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
93
94LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
95FILES_${PN}-ath9k = " \
96 /lib/firmware/ar9271.fw \
97 /lib/firmware/ar7010*.fw \
98 /lib/firmware/htc_9271.fw \
99 /lib/firmware/htc_7010.fw \
100"
101RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
102
103LICENSE_${PN}-ralink = "Firmware-ralink"
104FILES_${PN}-ralink = " \
105 /lib/firmware/rt*.bin \
106 /lib/firmware/LICENCE.ralink-firmware.txt \
107"
108
109LICENSE_${PN}-radeon = "Firmware-radeon"
110FILES_${PN}-radeon = " \
111 /lib/firmware/radeon \
112 /lib/firmware/LICENCE.radeon \
113"
114
115FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
116
117LICENSE_${PN}-sd8686 = "Firmware-Marvell"
118FILES_${PN}-sd8686 = " \
119 /lib/firmware/libertas/sd8686_v9* \
120 /lib/firmware/sd8686* \
121"
122RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
123
124LICENSE_${PN}-sd8787 = "Firmware-Marvell"
125FILES_${PN}-sd8787 = " \
126 /lib/firmware/mrvl/sd8787_uapsta.bin \
127"
128RDEPENDS_${PN}-sd8787 += "${PN}-marvell-license"
129
130LICENSE_${PN}-sd8797 = "Firmware-Marvell"
131FILES_${PN}-sd8797 = " \
132 /lib/firmware/mrvl/sd8797_uapsta.bin \
133"
134RDEPENDS_${PN}-sd8797 += "${PN}-marvell-license"
135
136FILES_${PN}-rtl-license = " \
137 /lib/firmware/LICENCE.rtlwifi_firmware.txt \
138"
139
140LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi"
141FILES_${PN}-rtl8192cu = " \
142 /lib/firmware/rtlwifi/rtl8192cufw.bin \
143"
144RDEPENDS_${PN}-rtl8192cu += "${PN}-rtl-license"
145
146LICENSE_${PN}-rtl8192ce = "Firmware-rtlwifi"
147FILES_${PN}-rtl8192ce = " \
148 /lib/firmware/rtlwifi/rtl8192cfw.bin \
149"
150RDEPENDS_${PN}-rtl8192ce += "${PN}-rtl-license"
151
152
153LICENSE_${PN}-rtl8192su = "Firmware-rtlwifi"
154FILES_${PN}-rtl8192su = " \
155 /lib/firmware/rtlwifi/rtl8712u.bin \
156"
157
158LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
159FILES_${PN}-wl12xx = " \
160 /lib/firmware/wl12* \
161 /lib/firmware/TI* \
162 /lib/firmware/ti-connectivity \
163"
164
165LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"
166FILES_${PN}-vt6656 = " \
167 /lib/firmware/vntwusb.fw \
168"
169
170# WARNING: The ALTERNATIVE_* variables are not using ${PN} because of
171# a bug in bitbake; when this is fixed and bitbake learns how to proper
172# pass variable flags with expansion we can rework this patch.
173
174ALTERNATIVE_LINK_NAME[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac-sdio.bin"
175
176FILES_${PN}-broadcom-license = " \
177 /lib/firmware/LICENCE.broadcom_bcm43xx \
178"
179
180LICENSE_${PN}-bcm4329 = "Firmware-bcm4329"
181FILES_${PN}-bcm4329 = " \
182 /lib/firmware/brcm/brcmfmac4329.bin \
183"
184RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
185ALTERNATIVE_linux-firmware-bcm4329 = "brcmfmac-sdio.bin"
186ALTERNATIVE_TARGET_linux-firmware-bcm4329[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4329.bin"
187
188LICENSE_${PN}-bcm4330 = "Firmware-bcm4330"
189FILES_${PN}-bcm4330 = " \
190 /lib/firmware/brcm/brcmfmac4330.bin \
191"
192RDEPENDS_${PN}-bcm4330 += "${PN}-broadcom-license"
193ALTERNATIVE_linux-firmware-bcm4330 = "brcmfmac-sdio.bin"
194ALTERNATIVE_TARGET_linux-firmware-bcm4330[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4330.bin"
195
196LICENSE_${PN}-bcm4334 = "Firmware-bcm4334"
197FILES_${PN}-bcm4334 = " \
198 /lib/firmware/brcm/brcmfmac4334.bin \
199"
200RDEPENDS_${PN}-bcm4334 += "${PN}-broadcom-license"
201ALTERNATIVE_linux-firmware-bcm4334 = "brcmfmac-sdio.bin"
202ALTERNATIVE_TARGET_linux-firmware-bcm4334[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4334.bin"
203
204RDEPENDS_${PN}-iwlwifi-6000g2a-5 = "${PN}-iwlwifi-license"
205RDEPENDS_${PN}-iwlwifi-6000g2a-6 = "${PN}-iwlwifi-license"
206RDEPENDS_${PN}-iwlwifi-6000g2b-6 = "${PN}-iwlwifi-license"
207RDEPENDS_${PN}-iwlwifi-135-6 = "${PN}-iwlwifi-license"
208RDEPENDS_${PN}-iwlwifi-7260-7 = "${PN}-iwlwifi-license"
209
210FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
211FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
212FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
213FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
214FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
215FILES_${PN}-iwlwifi-7260-7 = "/lib/firmware/iwlwifi-7260-7.ucode"
216
217FILES_${PN} += "/lib/firmware/*"
218
219# Make linux-firmware depend on all of the split-out packages.
220python populate_packages_prepend () {
221 firmware_pkgs = oe.utils.packages_filter_out_system(d)
222 d.appendVar('RDEPENDS_linux-firmware', ' ' + ' '.join(firmware_pkgs))
223}
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
new file mode 100644
index 0000000000..b18d09fd6c
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -0,0 +1,73 @@
1SUMMARY = "Sanitized set of kernel headers for the C library's use"
2SECTION = "devel"
3LICENSE = "GPLv2"
4
5#########################################################################
6#### PLEASE READ
7#########################################################################
8#
9# You're probably looking here thinking you need to create some new copy
10# of linux-libc-headers since you have your own custom kernel. To put
11# this simply, you DO NOT.
12#
13# Why? These headers are used to build the libc. If you customise the
14# headers you are customising the libc and the libc becomes machine
15# specific. Most people do not add custom libc extensions to the kernel
16# and have a machine specific libc.
17#
18# But you have some kernel headers you need for some driver? That is fine
19# but get them from STAGING_KERNEL_DIR where the kernel installs itself.
20# This will make the package using them machine specific but this is much
21# better than having a machine specific C library. This does mean your
22# recipe needs a DEPENDS += "virtual/kernel" but again, that is fine and
23# makes total sense.
24#
25# There can also be a case where your kernel extremely old and you want
26# an older libc ABI for that old kernel. The headers installed by this
27# recipe should still be a standard mainline kernel, not your own custom
28# one.
29#
30# -- RP
31
32LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
33
34python __anonymous () {
35 major = d.getVar("PV",True).split('.')[0]
36 if major == "3":
37 d.setVar("HEADER_FETCH_VER", "3.0")
38 else:
39 d.setVar("HEADER_FETCH_VER", "2.6")
40}
41
42inherit kernel-arch
43
44KORG_ARCHIVE_COMPRESSION ?= "bz2"
45
46SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}"
47
48S = "${WORKDIR}/linux-${PV}"
49
50do_configure() {
51 oe_runmake allnoconfig
52}
53
54do_compile () {
55}
56
57do_install() {
58 oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}
59 # Kernel should not be exporting this header
60 rm -f ${D}${exec_prefix}/include/scsi/scsi.h
61
62 # The ..install.cmd conflicts between various configure runs
63 find ${D}${includedir} -name ..install.cmd | xargs rm -f
64}
65
66BBCLASSEXTEND = "nativesdk"
67
68#DEPENDS = "cross-linkage"
69RDEPENDS_${PN}-dev = ""
70RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
71
72INHIBIT_DEFAULT_DEPS = "1"
73DEPENDS += "unifdef-native"
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.14.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.14.bb
new file mode 100644
index 0000000000..9ac70af942
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.14.bb
@@ -0,0 +1,7 @@
1KORG_ARCHIVE_COMPRESSION = "xz"
2
3require linux-libc-headers.inc
4
5SRC_URI[md5sum] = "b621207b3f6ecbb67db18b13258f8ea8"
6SRC_URI[sha256sum] = "61558aa490855f42b6340d1a1596be47454909629327c49a5e4e10268065dffa"
7
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
new file mode 100644
index 0000000000..6b8f1a54b8
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -0,0 +1,69 @@
1# Support for device tree generation
2FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/devicetree*"
3
4python __anonymous () {
5 d.appendVar("PACKAGES", " kernel-devicetree")
6}
7
8do_install_append() {
9 if test -n "${KERNEL_DEVICETREE}"; then
10 for DTB in ${KERNEL_DEVICETREE}; do
11 if echo ${DTB} | grep -q '/dts/'; then
12 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
13 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
14 fi
15 DTB_BASE_NAME=`basename ${DTB} .dtb`
16 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
17 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
18 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
19 oe_runmake ${DTB}
20 if [ ! -e "${DTB_PATH}" ]; then
21 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
22 fi
23 install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
24 done
25 fi
26}
27
28do_deploy_append() {
29 if test -n "${KERNEL_DEVICETREE}"; then
30 for DTB in ${KERNEL_DEVICETREE}; do
31 if echo ${DTB} | grep -q '/dts/'; then
32 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
33 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
34 fi
35 DTB_BASE_NAME=`basename ${DTB} .dtb`
36 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
37 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
38 DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
39 if [ ! -e "${DTB_PATH}" ]; then
40 DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
41 fi
42 install -d ${DEPLOYDIR}
43 install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
44 cd ${DEPLOYDIR}
45 ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
46 cd -
47 done
48 fi
49}
50
51pkg_postinst_kernel-devicetree () {
52 cd /${KERNEL_IMAGEDEST}
53 for DTB_FILE in ${KERNEL_DEVICETREE}
54 do
55 DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'`
56 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
57 update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
58 done
59}
60
61pkg_postrm_kernel-devicetree () {
62 cd /${KERNEL_IMAGEDEST}
63 for DTB_FILE in ${KERNEL_DEVICETREE}
64 do
65 DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'`
66 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
67 update-alternatives --remove ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
68 done
69}
diff --git a/meta/recipes-kernel/linux/linux-dummy.bb b/meta/recipes-kernel/linux/linux-dummy.bb
new file mode 100644
index 0000000000..5d29f5cc12
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dummy.bb
@@ -0,0 +1,51 @@
1SUMMARY = "Dummy Linux kernel"
2DESCRIPTION = "Dummy Linux kernel, to be selected as the preferred \
3provider for virtual/kernel to satisfy dependencies for situations \
4where you wish to build the kernel externally from the build system."
5SECTION = "kernel"
6
7LICENSE = "GPLv2"
8LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
9
10PROVIDES += "virtual/kernel"
11
12PACKAGES_DYNAMIC += "^kernel-module-.*"
13PACKAGES_DYNAMIC += "^kernel-image-.*"
14PACKAGES_DYNAMIC += "^kernel-firmware-.*"
15
16PACKAGES += "kernel-modules"
17FILES_kernel-modules = ""
18ALLOW_EMPTY_kernel-modules = "1"
19DESCRIPTION_kernel-modules = "Kernel modules meta package"
20
21#COMPATIBLE_MACHINE = "your_machine"
22
23PR = "r1"
24
25SRC_URI = "file://COPYING.GPL"
26S = "${WORKDIR}"
27
28do_configure() {
29 :
30}
31
32do_compile () {
33 :
34}
35
36do_install() {
37 :
38}
39
40do_bundle_initramfs() {
41 :
42}
43
44do_deploy() {
45 :
46}
47
48do_bundle_initramfs[nostamp] = "1"
49addtask bundle_initramfs after do_compile
50addtask deploy after do_install
51
diff --git a/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL b/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
new file mode 100644
index 0000000000..d511905c16
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
@@ -0,0 +1,339 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40(2) offer you this license which gives you legal permission to copy,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification follow.
58
59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62 0. This License applies to any program or other work which contains
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you may at your option offer warranty protection in exchange for a fee.
89
90 2. You may modify your copy or copies of the Program or any portion
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, provided that you also meet all of these conditions:
94
95 a) You must cause the modified files to carry prominent notices
96 stating that you changed the files and the date of any change.
97
98 b) You must cause any work that you distribute or publish, that in
99 whole or in part contains or is derived from the Program or any
100 part thereof, to be licensed as a whole at no charge to all third
101 parties under the terms of this License.
102
103 c) If the modified program normally reads commands interactively
104 when run, you must cause it, when started running for such
105 interactive use in the most ordinary way, to print or display an
106 announcement including an appropriate copyright notice and a
107 notice that there is no warranty (or else, saying that you provide
108 a warranty) and that users may redistribute the program under
109 these conditions, and telling the user how to view a copy of this
110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.)
113
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 1 and 2 above provided that you also do one of the following:
137
138 a) Accompany it with the complete corresponding machine-readable
139 source code, which must be distributed under the terms of Sections
140 1 and 2 above on a medium customarily used for software interchange; or,
141
142 b) Accompany it with a written offer, valid for at least three
143 years, to give any third party, for a charge no more than your
144 cost of physically performing source distribution, a complete
145 machine-readable copy of the corresponding source code, to be
146 distributed under the terms of Sections 1 and 2 above on a medium
147 customarily used for software interchange; or,
148
149 c) Accompany it with the information you received as to the offer
150 to distribute corresponding source code. (This alternative is
151 allowed only for noncommercial distribution and only if you
152 received the program in object code or executable form with such
153 an offer, in accord with Subsection b above.)
154
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of promoting the sharing and reuse of software generally.
257
258 NO WARRANTY
259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES.
279
280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285possible use to the public, the best way to achieve this is to make it
286free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or
299 (at your option) any later version.
300
301 This program is distributed in the hope that it will be useful,
302 but WITHOUT ANY WARRANTY; without even the implied warranty of
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details.
305
306 You should have received a copy of the GNU General Public License along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Lesser General
339Public License instead of this License.
diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
new file mode 100644
index 0000000000..5e097203e2
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -0,0 +1,58 @@
1# This recipe tracks the linux-yocto-dev repository as its upstream source.
2# Since this tree is frequently updated, and periodically rebuilt, AUTOREV is
3# used to track its contents.
4#
5# This recipe is just like other linux-yocto variants, with the only difference
6# being that to avoid network access during initial parsing, static SRCREVs are
7# provided and overridden if the preferred kernel provider is linux-yocto-dev.
8#
9# To enable this recipe, set PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
10
11inherit kernel
12require recipes-kernel/linux/linux-yocto.inc
13
14USE_MACHINE_AUTOREV ?= "1"
15USE_META_AUTOREV ?= "1"
16
17# provide this .inc to set specific revisions
18include recipes-kernel/linux/linux-yocto-dev-revisions.inc
19
20KBRANCH = "standard/base"
21KBRANCH_DEFAULT = "${KBRANCH}"
22KMETA = "meta"
23
24SRC_URI = "git://git.pokylinux.org/linux-yocto-dev.git;nocheckout=1;branch=${KBRANCH},${KMETA};name=machine,meta"
25
26# Set default SRCREVs. Both the machine and meta SRCREVs are statically set
27# to the korg v3.7 tag, and hence prevent network access during parsing. If
28# linux-yocto-dev is the preferred provider, they will be overridden to
29# AUTOREV in following anonymous python routine and resolved when the
30# variables are finalized.
31SRCREV_machine ?= "29594404d7fe73cd80eaa4ee8c43dcc53970c60e"
32SRCREV_meta ?= "29594404d7fe73cd80eaa4ee8c43dcc53970c60e"
33
34python () {
35 if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-dev":
36 raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-dev to enable it")
37 else:
38 # if the revisions have been changed from the defaults above we leave them
39 # alone. But if the defaults are left, we change to AUTOREV.
40 if d.getVar("USE_MACHINE_AUTOREV", True) == "1":
41 d.setVar("SRCREV_machine", "${AUTOREV}")
42 if d.getVar("USE_META_AUTOREV", True) == "1":
43 d.setVar("SRCREV_meta", "${AUTOREV}")
44}
45
46LINUX_VERSION ?= "3.14+"
47LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}"
48PV = "${LINUX_VERSION}+git${SRCPV}"
49
50COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64)"
51
52# Functionality flags
53KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
54KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
55KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
56KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
57KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
58
diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_3.10.bb b/meta/recipes-kernel/linux/linux-yocto-rt_3.10.bb
new file mode 100644
index 0000000000..4087d02f6b
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_3.10.bb
@@ -0,0 +1,27 @@
1require recipes-kernel/linux/linux-yocto.inc
2
3KBRANCH = "standard/preempt-rt/base"
4KBRANCH_qemuppc = "standard/preempt-rt/qemuppc"
5
6SRCREV_machine ?= "d1e73a1e09f9641c44e7d713d1a6b5b088411459"
7SRCREV_machine_qemuppc ?= "9a34d9c957e69f28e89e879d9dd6e8fe5c7270c5"
8SRCREV_meta ?= "7df9ef8ee47dc9023044614210f4c1d9d916dd5f"
9
10SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.10.git;bareclone=1;branch=${KBRANCH},meta;name=machine,meta"
11
12LINUX_VERSION ?= "3.10.35"
13
14PV = "${LINUX_VERSION}+git${SRCPV}"
15
16KMETA = "meta"
17
18LINUX_KERNEL_TYPE = "preempt-rt"
19
20COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
21
22# Functionality flags
23KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
24KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
25KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
26KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
27KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_3.4.bb b/meta/recipes-kernel/linux/linux-yocto-rt_3.4.bb
new file mode 100644
index 0000000000..dc3813ca6d
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_3.4.bb
@@ -0,0 +1,30 @@
1require recipes-kernel/linux/linux-yocto.inc
2
3KBRANCH = "standard/preempt-rt/base"
4KBRANCH_qemuppc = "standard/preempt-rt/qemuppc"
5
6LINUX_VERSION ?= "3.4.85"
7LINUX_KERNEL_TYPE = "preempt-rt"
8
9KMETA = "meta"
10
11SRCREV_machine ?= "fd1626cc2a1144a7760bcfc9c6e48a14de28624e"
12SRCREV_machine_qemuppc ?= "605cdff89f2d36d44ebfc75d6427eea5f236a940"
13SRCREV_meta ?= "7c9e1e0117e7ca1f7451870dad5db50adc21732e"
14
15PR = "${INC_PR}.1"
16PV = "${LINUX_VERSION}+git${SRCPV}"
17
18SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.4.git;bareclone=1;branch=${KBRANCH},meta;name=machine,meta"
19
20# Omit broken machines from COMPATIBLE_MACHINE
21# qemuppc hangs at boot
22# qemumips panics at boot
23COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm)"
24
25# Functionality flags
26KERNEL_FEATURES_append = " features/netfilter/netfilter.scc"
27KERNEL_FEATURES_append = " features/taskstats/taskstats.scc"
28KERNEL_FEATURES_append_qemux86 = " cfg/sound.scc"
29KERNEL_FEATURES_append_qemux86-64 = " cfg/sound.scc"
30KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_3.10.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_3.10.bb
new file mode 100644
index 0000000000..099655f381
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_3.10.bb
@@ -0,0 +1,22 @@
1require recipes-kernel/linux/linux-yocto.inc
2
3KBRANCH_DEFAULT = "standard/tiny/base"
4KBRANCH = "${KBRANCH_DEFAULT}"
5LINUX_KERNEL_TYPE = "tiny"
6KCONFIG_MODE = "--allnoconfig"
7
8LINUX_VERSION ?= "3.10.35"
9
10KMETA = "meta"
11
12SRCREV_machine ?= "cee957655fe67826b2e827e2db41f156fa8f0cc4"
13SRCREV_meta ?= "7df9ef8ee47dc9023044614210f4c1d9d916dd5f"
14
15PV = "${LINUX_VERSION}+git${SRCPV}"
16
17SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.10.git;bareclone=1;branch=${KBRANCH},meta;name=machine,meta"
18
19COMPATIBLE_MACHINE = "(qemux86)"
20
21# Functionality flags
22KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb
new file mode 100644
index 0000000000..a441a53fb9
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb
@@ -0,0 +1,21 @@
1require recipes-kernel/linux/linux-yocto.inc
2
3KBRANCH = "standard/tiny/base"
4LINUX_KERNEL_TYPE = "tiny"
5KCONFIG_MODE = "--allnoconfig"
6
7LINUX_VERSION ?= "3.14"
8
9KMETA = "meta"
10
11SRCREV_machine ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0"
12SRCREV_meta ?= "928d7b2ddad0abc8827055c51ba34225878344a0"
13
14PV = "${LINUX_VERSION}+git${SRCPV}"
15
16SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.14.git;bareclone=1;branch=${KBRANCH},meta;name=machine,meta"
17
18COMPATIBLE_MACHINE = "(qemux86)"
19
20# Functionality flags
21KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_3.4.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_3.4.bb
new file mode 100644
index 0000000000..f22a3f46a0
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_3.4.bb
@@ -0,0 +1,26 @@
1require recipes-kernel/linux/linux-yocto.inc
2
3# We need lzma (as CONFIG_KERNEL_LZMA=y)
4DEPENDS += "xz-native"
5
6KBRANCH_DEFAULT = "standard/tiny/base"
7KBRANCH = "${KBRANCH_DEFAULT}"
8LINUX_KERNEL_TYPE = "tiny"
9KCONFIG_MODE = "--allnoconfig"
10
11LINUX_VERSION ?= "3.4.85"
12
13KMETA = "meta"
14
15SRCREV_machine ?= "95a3ff6e3c2eec2fafe9d1813048fcdb468a678e"
16SRCREV_meta ?= "7c9e1e0117e7ca1f7451870dad5db50adc21732e"
17
18PR = "${INC_PR}.1"
19PV = "${LINUX_VERSION}+git${SRCPV}"
20
21SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.4.git;bareclone=1;branch=${KBRANCH},meta;name=machine,meta"
22
23COMPATIBLE_MACHINE = "(qemux86)"
24
25# Functionality flags
26KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
new file mode 100644
index 0000000000..4ed318886f
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -0,0 +1,45 @@
1DESCRIPTION = "Yocto Kernel"
2SECTION = "kernel"
3LICENSE = "GPLv2"
4
5LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
6
7INC_PR = "r4"
8
9DEPENDS += "xz-native bc-native"
10
11# A KMACHINE is the mapping of a yocto $MACHINE to what is built
12# by the kernel. This is typically the branch that should be built,
13# and it can be specific to the machine or shared
14# KMACHINE = "UNDEFINED"
15
16LINUX_KERNEL_TYPE ?= "standard"
17
18# KMETA ?= ""
19KBRANCH ?= "master"
20KMACHINE ?= "${MACHINE}"
21SRCREV_FORMAT ?= "meta_machine"
22
23LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE}"
24
25do_patch[depends] = "kern-tools-native:do_populate_sysroot"
26
27addtask kernel_configme before do_configure after do_patch
28
29# Pick up shared functions
30inherit kernel
31inherit kernel-yocto
32require linux-dtb.inc
33
34B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build"
35
36do_install_append(){
37 if [ -n "${KMETA}" ]; then
38 rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
39 fi
40}
41
42# extra tasks
43addtask kernel_link_vmlinux after do_compile before do_install
44addtask validate_branches before do_patch after do_kernel_checkout
45addtask kernel_configcheck after do_configure before do_compile
diff --git a/meta/recipes-kernel/linux/linux-yocto_3.10.bb b/meta/recipes-kernel/linux/linux-yocto_3.10.bb
new file mode 100644
index 0000000000..89263d98b9
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_3.10.bb
@@ -0,0 +1,38 @@
1require recipes-kernel/linux/linux-yocto.inc
2
3KBRANCH_DEFAULT = "standard/base"
4KBRANCH = "${KBRANCH_DEFAULT}"
5
6# board specific branches
7KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
8KBRANCH_qemumips = "standard/mti-malta32"
9KBRANCH_qemuppc = "standard/qemuppc"
10KBRANCH_qemux86 = "standard/common-pc/base"
11KBRANCH_qemux86-64 = "standard/common-pc-64/base"
12KBRANCH_qemumips64 = "standard/mti-malta64"
13
14SRCREV_machine_qemuarm ?= "7b466aae62395490769f96635bd077ee8f313f18"
15SRCREV_machine_qemumips ?= "cc5059ae360e0586375bbd1ed46e1e6f3e267dea"
16SRCREV_machine_qemuppc ?= "663a3068c9756137a84bbfb3a76eeae7cb4373e1"
17SRCREV_machine_qemux86 ?= "cee957655fe67826b2e827e2db41f156fa8f0cc4"
18SRCREV_machine_qemux86-64 ?= "cee957655fe67826b2e827e2db41f156fa8f0cc4"
19SRCREV_machine_qemumips64 ?= "a1491c3b367a75c7003b2fb58706e3631413b337"
20SRCREV_machine ?= "cee957655fe67826b2e827e2db41f156fa8f0cc4"
21SRCREV_meta ?= "7df9ef8ee47dc9023044614210f4c1d9d916dd5f"
22
23SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.10.git;bareclone=1;branch=${KBRANCH},${KMETA};name=machine,meta"
24
25LINUX_VERSION ?= "3.10.35"
26
27PV = "${LINUX_VERSION}+git${SRCPV}"
28
29KMETA = "meta"
30
31COMPATIBLE_MACHINE = "qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
32
33# Functionality flags
34KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
35KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
36KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
37KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
38KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto_3.14.bb b/meta/recipes-kernel/linux/linux-yocto_3.14.bb
new file mode 100644
index 0000000000..7f0ec2b559
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_3.14.bb
@@ -0,0 +1,37 @@
1require recipes-kernel/linux/linux-yocto.inc
2
3KBRANCH = "standard/base"
4
5# board specific branches
6KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
7KBRANCH_qemumips = "standard/mti-malta32"
8KBRANCH_qemuppc = "standard/qemuppc"
9KBRANCH_qemux86 = "standard/common-pc/base"
10KBRANCH_qemux86-64 = "standard/common-pc-64/base"
11KBRANCH_qemumips64 = "standard/mti-malta64"
12
13SRCREV_machine_qemuarm ?= "c966987f88a0ee5753c3dee87e7a962d0cad5376"
14SRCREV_machine_qemumips ?= "61811c215c601ee96ccbf79333bbc73482b0f017"
15SRCREV_machine_qemuppc ?= "0d5cf5e938f4e6d3c6a398e98c8ece3ce05539f7"
16SRCREV_machine_qemux86 ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0"
17SRCREV_machine_qemux86-64 ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0"
18SRCREV_machine_qemumips64 ?= "ccb2a788551a7951563ac44a27175c6f28501008"
19SRCREV_machine ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0"
20SRCREV_meta ?= "928d7b2ddad0abc8827055c51ba34225878344a0"
21
22SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.14.git;bareclone=1;branch=${KBRANCH},${KMETA};name=machine,meta"
23
24LINUX_VERSION ?= "3.14"
25
26PV = "${LINUX_VERSION}+git${SRCPV}"
27
28KMETA = "meta"
29
30COMPATIBLE_MACHINE = "qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
31
32# Functionality flags
33KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
34KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
35KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
36KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
37KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto_3.4.bb b/meta/recipes-kernel/linux/linux-yocto_3.4.bb
new file mode 100644
index 0000000000..3a2ff2f504
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_3.4.bb
@@ -0,0 +1,38 @@
1require recipes-kernel/linux/linux-yocto.inc
2
3KBRANCH_DEFAULT = "standard/base"
4KBRANCH = "${KBRANCH_DEFAULT}"
5
6# board specific branches
7KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
8KBRANCH_qemumips = "standard/mti-malta32"
9KBRANCH_qemuppc = "standard/qemuppc"
10KBRANCH_qemux86 = "standard/common-pc/base"
11KBRANCH_qemux86-64 = "standard/common-pc-64/base"
12KBRANCH_qemumips64 = "standard/mti-malta64"
13
14SRCREV_machine_qemuarm ?= "64f9a290683b1ab08136ef5d54d1845a961a6940"
15SRCREV_machine_qemumips ?= "ad7aa3ecf8ab00055d31c3f7b059c8b8a8633e19"
16SRCREV_machine_qemuppc ?= "7aaa5a4debe4b1987d2d11707313e682b185e876"
17SRCREV_machine_qemux86 ?= "95a3ff6e3c2eec2fafe9d1813048fcdb468a678e"
18SRCREV_machine_qemux86-64 ?= "95a3ff6e3c2eec2fafe9d1813048fcdb468a678e"
19SRCREV_machine ?= "95a3ff6e3c2eec2fafe9d1813048fcdb468a678e"
20SRCREV_meta ?= "7c9e1e0117e7ca1f7451870dad5db50adc21732e"
21
22SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.4.git;bareclone=1;branch=${KBRANCH},${KMETA};name=machine,meta"
23
24LINUX_VERSION ?= "3.4.85"
25
26PR = "${INC_PR}.5"
27PV = "${LINUX_VERSION}+git${SRCPV}"
28
29KMETA = "meta"
30
31COMPATIBLE_MACHINE = "qemuarm|qemux86|qemuppc|qemumips|qemux86-64"
32
33# Functionality flags
34KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
35KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
36KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
37KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
38KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/lttng/babeltrace_1.1.1.bb b/meta/recipes-kernel/lttng/babeltrace_1.1.1.bb
new file mode 100644
index 0000000000..a6b8a97410
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace_1.1.1.bb
@@ -0,0 +1,22 @@
1SUMMARY = "Babeltrace - Trace Format Babel Tower"
2DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
3HOMEPAGE = "http://www.efficios.com/babeltrace/"
4BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
5
6LICENSE = "MIT & GPLv2"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
8
9inherit autotools
10
11DEPENDS = "glib-2.0 util-linux popt"
12
13SRCREV = "a386e24609752742b100120db6798d311fab512a"
14PV = "1.1.1+git${SRCPV}"
15
16SRC_URI = "git://git.efficios.com/babeltrace.git"
17
18S = "${WORKDIR}/git"
19
20do_configure_prepend () {
21 ( cd ${S}; ${S}/bootstrap )
22}
diff --git a/meta/recipes-kernel/lttng/lttng-modules/bio-bvec-iter.patch b/meta/recipes-kernel/lttng/lttng-modules/bio-bvec-iter.patch
new file mode 100644
index 0000000000..d6c66e4f2b
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/bio-bvec-iter.patch
@@ -0,0 +1,156 @@
1Upstream-Status: Pending
2
3In 3.14, bi_sector and bi_size were moved into an iterator, thus
4breaking any tracepoints that still expect them in the bio. Fix up
5the lttng-module tracepoints to use the new scheme when the kernel
6version is >= 3.14.
7
8Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
9
10diff --git a/instrumentation/events/lttng-module/block.h b/instrumentation/events/lttng-module/block.h
11index f3b8bff..0a61543 100644
12--- a/instrumentation/events/lttng-module/block.h
13+++ b/instrumentation/events/lttng-module/block.h
14@@ -341,9 +341,15 @@ TRACE_EVENT(block_bio_bounce,
15 TP_fast_assign(
16 tp_assign(dev, bio->bi_bdev ?
17 bio->bi_bdev->bd_dev : 0)
18+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
19+ tp_assign(sector, bio->bi_iter.bi_sector)
20+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
21+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
22+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
23 tp_assign(sector, bio->bi_sector)
24 tp_assign(nr_sector, bio->bi_size >> 9)
25 blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
26+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
27 tp_memcpy(comm, current->comm, TASK_COMM_LEN)
28 ),
29
30@@ -385,14 +391,24 @@ TRACE_EVENT(block_bio_complete,
31
32 TP_fast_assign(
33 tp_assign(dev, bio->bi_bdev->bd_dev)
34+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
35+ tp_assign(sector, bio->bi_iter.bi_sector)
36+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
37+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
38 tp_assign(sector, bio->bi_sector)
39 tp_assign(nr_sector, bio->bi_size >> 9)
40+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
41+
42 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
43 tp_assign(error, error)
44 #else
45 tp_assign(error, 0)
46 #endif
47+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
48+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
49+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
50 blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
51+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
52 ),
53
54 TP_printk("%d,%d %s %llu + %u [%d]",
55@@ -419,9 +435,15 @@ DECLARE_EVENT_CLASS(block_bio_merge,
56
57 TP_fast_assign(
58 tp_assign(dev, bio->bi_bdev->bd_dev)
59+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
60+ tp_assign(sector, bio->bi_iter.bi_sector)
61+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
62+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
63+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
64 tp_assign(sector, bio->bi_sector)
65 tp_assign(nr_sector, bio->bi_size >> 9)
66 blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
67+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
68 tp_memcpy(comm, current->comm, TASK_COMM_LEN)
69 ),
70
71@@ -485,9 +507,15 @@ TRACE_EVENT(block_bio_queue,
72
73 TP_fast_assign(
74 tp_assign(dev, bio->bi_bdev->bd_dev)
75+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
76+ tp_assign(sector, bio->bi_iter.bi_sector)
77+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
78+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
79+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
80 tp_assign(sector, bio->bi_sector)
81 tp_assign(nr_sector, bio->bi_size >> 9)
82 blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
83+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
84 tp_memcpy(comm, current->comm, TASK_COMM_LEN)
85 ),
86
87@@ -513,9 +541,15 @@ DECLARE_EVENT_CLASS(block_bio,
88
89 TP_fast_assign(
90 tp_assign(dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
91+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
92+ tp_assign(sector, bio->bi_iter.bi_sector)
93+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
94+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
95+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
96 tp_assign(sector, bio->bi_sector)
97 tp_assign(nr_sector, bio->bi_size >> 9)
98 blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
99+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
100 tp_memcpy(comm, current->comm, TASK_COMM_LEN)
101 ),
102
103@@ -587,10 +621,17 @@ DECLARE_EVENT_CLASS(block_get_rq,
104
105 TP_fast_assign(
106 tp_assign(dev, bio ? bio->bi_bdev->bd_dev : 0)
107+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
108+ tp_assign(sector, bio ? bio->bi_iter.bi_sector : 0)
109+ tp_assign(nr_sector, bio ? bio->bi_iter.bi_size >> 9 : 0)
110+ blk_fill_rwbs(rwbs, bio ? bio->bi_rw : 0,
111+ bio ? bio->bi_iter.bi_size >> 9 : 0)
112+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
113 tp_assign(sector, bio ? bio->bi_sector : 0)
114 tp_assign(nr_sector, bio ? bio->bi_size >> 9 : 0)
115 blk_fill_rwbs(rwbs, bio ? bio->bi_rw : 0,
116 bio ? bio->bi_size >> 9 : 0)
117+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
118 tp_memcpy(comm, current->comm, TASK_COMM_LEN)
119 ),
120
121@@ -759,9 +800,15 @@ TRACE_EVENT(block_split,
122
123 TP_fast_assign(
124 tp_assign(dev, bio->bi_bdev->bd_dev)
125+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
126+ tp_assign(sector, bio->bi_iter.bi_sector)
127+ tp_assign(new_sector, new_sector)
128+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
129+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
130 tp_assign(sector, bio->bi_sector)
131 tp_assign(new_sector, new_sector)
132 blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
133+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
134 tp_memcpy(comm, current->comm, TASK_COMM_LEN)
135 ),
136
137@@ -805,11 +852,19 @@ TRACE_EVENT(block_remap,
138
139 TP_fast_assign(
140 tp_assign(dev, bio->bi_bdev->bd_dev)
141+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
142+ tp_assign(sector, bio->bi_iter.bi_sector)
143+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
144+ tp_assign(old_dev, dev)
145+ tp_assign(old_sector, from)
146+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
147+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
148 tp_assign(sector, bio->bi_sector)
149 tp_assign(nr_sector, bio->bi_size >> 9)
150 tp_assign(old_dev, dev)
151 tp_assign(old_sector, from)
152 blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
153+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
154 ),
155
156 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
diff --git a/meta/recipes-kernel/lttng/lttng-modules/lttng-modules-replace-KERNELDIR-with-KERNEL_SRC.patch b/meta/recipes-kernel/lttng/lttng-modules/lttng-modules-replace-KERNELDIR-with-KERNEL_SRC.patch
new file mode 100644
index 0000000000..30f825c414
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules/lttng-modules-replace-KERNELDIR-with-KERNEL_SRC.patch
@@ -0,0 +1,81 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3lttng-modules: replace KERNELDIR with KERNEL_SRC
4
5Since lttng-modules uses the default way of module.bbclass to
6build and install lttng-modules, we do this replacement for
7it as-is.
8
9Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
10
11diff --git a/Makefile b/Makefile
12index a9d1cb1..c1b65b9 100644
13--- a/Makefile
14+++ b/Makefile
15@@ -43,19 +43,19 @@ obj-m += lib/
16 endif # CONFIG_TRACEPOINTS
17
18 else # KERNELRELEASE
19- KERNELDIR ?= /lib/modules/$(shell uname -r)/build
20+ KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
21 PWD := $(shell pwd)
22 CFLAGS = $(EXTCFLAGS)
23
24 default:
25- $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
26+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
27
28 modules_install:
29- $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
30+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install
31
32 clean:
33- $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
34+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
35
36 %.i: %.c
37- $(MAKE) -C $(KERNELDIR) M=$(PWD) $@
38+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) $@
39 endif # KERNELRELEASE
40diff --git a/README b/README
41index 8c5dd46..6bd3334 100644
42--- a/README
43+++ b/README
44@@ -27,8 +27,8 @@ access to your full kernel source tree), and use:
45 If you need to specify the target directory to the kernel you want to build
46 against, use:
47
48-% KERNELDIR=path_to_kernel_dir make
49-# KERNELDIR=path_to_kernel_dir make modules_install
50+% KERNEL_SRC=path_to_kernel_dir make
51+# KERNEL_SRC=path_to_kernel_dir make modules_install
52 # depmod -a kernel_version
53
54 Use lttng-tools to control the tracer. LTTng tools should automatically load
55diff --git a/probes/Makefile b/probes/Makefile
56index 225803c..3449866 100644
57--- a/probes/Makefile
58+++ b/probes/Makefile
59@@ -212,18 +212,18 @@ endif
60 endif
61
62 else
63- KERNELDIR ?= /lib/modules/$(shell uname -r)/build
64+ KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
65 PWD := $(shell pwd)
66 CFLAGS = $(EXTCFLAGS)
67
68 default:
69- $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
70+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
71
72 modules_install:
73- $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
74+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install
75 /sbin/depmod -a
76
77 clean:
78- $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
79+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
80
81 endif
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.3.3.bb b/meta/recipes-kernel/lttng/lttng-modules_2.3.3.bb
new file mode 100644
index 0000000000..4f18ddc367
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.3.3.bb
@@ -0,0 +1,35 @@
1SECTION = "devel"
2SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
3DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
4LICENSE = "LGPLv2.1 & GPLv2"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
6 file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \
7 file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
8
9DEPENDS = "virtual/kernel"
10
11inherit module
12
13SRCREV = "eef112db0e63feff6cbf0a98cda9af607cefb377"
14PV = "2.3.3"
15
16SRC_URI = "git://git.lttng.org/lttng-modules.git;branch=stable-2.3 \
17 file://lttng-modules-replace-KERNELDIR-with-KERNEL_SRC.patch \
18 file://bio-bvec-iter.patch"
19
20export INSTALL_MOD_DIR="kernel/lttng-modules"
21export KERNEL_SRC="${STAGING_KERNEL_DIR}"
22
23
24S = "${WORKDIR}/git"
25
26do_install_append() {
27 # Delete empty directories to avoid QA failures if no modules were built
28 find ${D}/lib -depth -type d -empty -exec rmdir {} \;
29}
30
31python do_package_prepend() {
32 if not os.path.exists(os.path.join(d.getVar('D', True), 'lib/modules')):
33 bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN', True))
34}
35
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.4.0.bb b/meta/recipes-kernel/lttng/lttng-modules_2.4.0.bb
new file mode 100644
index 0000000000..aa01a8dd6f
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.4.0.bb
@@ -0,0 +1,38 @@
1SECTION = "devel"
2SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
3DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
4LICENSE = "LGPLv2.1 & GPLv2"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
6 file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \
7 file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
8
9DEPENDS = "virtual/kernel"
10
11inherit module
12
13SRCREV = "fb2c37799306d16fb590aebee6fad8be431264b7"
14PV = "2.4.0"
15
16# lttng currently blacklists arm with gcc-4.8
17COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips).*-linux'
18
19SRC_URI = "git://git.lttng.org/lttng-modules.git;branch=stable-2.4 \
20 file://lttng-modules-replace-KERNELDIR-with-KERNEL_SRC.patch \
21 file://bio-bvec-iter.patch"
22
23export INSTALL_MOD_DIR="kernel/lttng-modules"
24export KERNEL_SRC="${STAGING_KERNEL_DIR}"
25
26
27S = "${WORKDIR}/git"
28
29do_install_append() {
30 # Delete empty directories to avoid QA failures if no modules were built
31 find ${D}/lib -depth -type d -empty -exec rmdir {} \;
32}
33
34python do_package_prepend() {
35 if not os.path.exists(os.path.join(d.getVar('D', True), 'lib/modules')):
36 bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN', True))
37}
38
diff --git a/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
new file mode 100755
index 0000000000..e758815c77
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3make -C tests installcheck
4
diff --git a/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch b/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
new file mode 100644
index 0000000000..958bce48e0
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
@@ -0,0 +1,27 @@
1diff --git a/Makefile.am b/Makefile.am
2index 584f59b..c2bcabd 100644
3--- a/Makefile.am
4+++ b/Makefile.am
5@@ -12,3 +12,9 @@ dist_doc_DATA = LICENSE \
6 dist_noinst_DATA = CodingStyle
7
8 EXTRA_DIST = extras/lttng-bash_completion gpl-2.0.txt lgpl-2.1.txt
9+
10+install-ptest:
11+ cp -r $(srcdir)/tests $(DESTDIR)
12+ for m in $$(find $(DESTDIR)/tests -name Makefile); do \
13+ sed -i -e 's|^Makefile:|_Makefile:|' $$m; \
14+ done
15diff --git a/tests/run.sh b/tests/run.sh
16index c6c50fd..6455359 100755
17--- a/tests/run.sh
18+++ b/tests/run.sh
19@@ -19,4 +19,7 @@
20
21 [ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
22
23-prove --merge --exec '' - < $1
24+prove --merge -v --exec '' - < $1 | sed \
25+ -e 's|^ok \(.*\)|PASS: \1|' \
26+ -e 's|^not ok \(.*\)|FAIL: \1|' \
27+ | egrep -h 'PASS|FAIL'
diff --git a/meta/recipes-kernel/lttng/lttng-tools/runtest.patch b/meta/recipes-kernel/lttng/lttng-tools/runtest.patch
new file mode 100644
index 0000000000..545a5dc083
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/runtest.patch
@@ -0,0 +1,52 @@
1diff --git a/Makefile.am b/Makefile.am
2index 584f59b..c2bcabd 100644
3--- a/Makefile.am
4+++ b/Makefile.am
5@@ -12,3 +12,9 @@ dist_doc_DATA = LICENSE \
6 dist_noinst_DATA = CodingStyle
7
8 EXTRA_DIST = extras/lttng-bash_completion gpl-2.0.txt lgpl-2.1.txt
9+
10+install-ptest:
11+ cp -r $(srcdir)/tests $(DESTDIR)
12+ for m in $$(find $(DESTDIR)/tests -name Makefile); do \
13+ sed -i -e 's|^Makefile:|_Makefile:|' $$m; \
14+ done
15diff --git a/tests/Makefile.am b/tests/Makefile.am
16index 6d5b00d..3774f9d 100644
17--- a/tests/Makefile.am
18+++ b/tests/Makefile.am
19@@ -1,14 +1,17 @@
20 SUBDIRS = utils regression unit stress
21
22-if USE_PYTHON
23-check-am:
24+installcheck-am:
25 ./run.sh unit_tests
26 ./run.sh fast_regression
27+if USE_PYTHON
28 ./run.sh with_bindings_regression
29-else
30+endif
31+
32 check-am:
33 ./run.sh unit_tests
34 ./run.sh fast_regression
35+if USE_PYTHON
36+ ./run.sh with_bindings_regression
37 endif
38
39 dist_noinst_SCRIPTS = run.sh unit_tests fast_regression long_regression root_regression with_bindings_regression
40diff --git a/tests/run.sh b/tests/run.sh
41index c6c50fd..6455359 100755
42--- a/tests/run.sh
43+++ b/tests/run.sh
44@@ -19,4 +19,7 @@
45
46 [ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
47
48-prove --merge --exec '' - < $1
49+prove --merge -v --exec '' - < $1 | sed \
50+ -e 's|^ok \(.*\)|PASS: \1|' \
51+ -e 's|^not ok \(.*\)|FAIL: \1|' \
52+ | egrep -h 'PASS|FAIL'
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.3.1.bb b/meta/recipes-kernel/lttng/lttng-tools_2.3.1.bb
new file mode 100644
index 0000000000..ee59a4645b
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.3.1.bb
@@ -0,0 +1,59 @@
1SECTION = "devel"
2SUMMARY = "Linux Trace Toolkit Control"
3DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
4to extract program execution details from the Linux operating system \
5and interpret them."
6
7LICENSE = "GPLv2 & LGPLv2.1"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
9 file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
10 file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
11
12DEPENDS = "liburcu popt lttng-ust"
13RDEPENDS_${PN}-ptest += "make"
14
15SRCREV = "5d985544a7ad54afa0514ea7f522a89d8d844860"
16PV = "v2.3.1"
17
18SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.3 \
19 file://runtest.patch \
20 file://run-ptest \
21 "
22
23S = "${WORKDIR}/git"
24
25inherit autotools-brokensep ptest
26
27export KERNELDIR="${STAGING_KERNEL_DIR}"
28
29FILES_${PN} += "${libdir}/lttng/libexec/*"
30FILES_${PN}-dbg += "${libdir}/lttng/libexec/.debug"
31
32# Since files are installed into ${libdir}/lttng/libexec we match
33# the libexec insane test so skip it.
34INSANE_SKIP_${PN} = "libexec"
35INSANE_SKIP_${PN}-dbg = "libexec"
36
37
38do_install_ptest () {
39 chmod +x ${D}/${libdir}/${PN}/ptest/tests/utils/utils.sh
40 for i in `find ${D}/${libdir}/${PN}/ptest -perm /u+x -type f`; do
41 sed -e "s:\$TESTDIR.*/src/bin/lttng/\$LTTNG_BIN:\$LTTNG_BIN:g" \
42 -e "s:\$TESTDIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
43 -e "s:\$DIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
44 -e "s:\$TESTDIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
45 -e "s:\$DIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
46 -e "s:\$TESTDIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
47 -e "s:\$DIR/../src/bin/lttng-sessiond/lttng-sessiond:\$SESSIOND_BIN:g" \
48 -e "s:\$DIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
49 -e "s:\$DIR/../bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
50 -i $i
51 done
52
53 sed -e "s:src/bin/lttng-sessiond:$bindir:g" \
54 -e "s:src/bin/lttng-consumerd:${libexecdir}/libexec/:g" \
55 -i ${D}/${libdir}/${PN}/ptest/tests/regression/run-report.py
56 sed -e "s:src/bin:bin:g" \
57 -i ${D}/${libdir}/${PN}/ptest/tests/utils/utils.sh
58
59}
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.4.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.4.0.bb
new file mode 100644
index 0000000000..223b52e8ae
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.4.0.bb
@@ -0,0 +1,59 @@
1SECTION = "devel"
2SUMMARY = "Linux Trace Toolkit Control"
3DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
4to extract program execution details from the Linux operating system \
5and interpret them."
6
7LICENSE = "GPLv2 & LGPLv2.1"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
9 file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
10 file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
11
12DEPENDS = "liburcu popt lttng-ust"
13RDEPENDS_${PN}-ptest += "make"
14
15SRCREV = "8e3234eea2d81f8a962214c570532f8e096a9a8d"
16PV = "v2.4.0"
17
18SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.4 \
19 file://runtest-2.4.0.patch \
20 file://run-ptest \
21 "
22
23S = "${WORKDIR}/git"
24
25inherit autotools-brokensep ptest
26
27export KERNELDIR="${STAGING_KERNEL_DIR}"
28
29FILES_${PN} += "${libdir}/lttng/libexec/*"
30FILES_${PN}-dbg += "${libdir}/lttng/libexec/.debug"
31
32# Since files are installed into ${libdir}/lttng/libexec we match
33# the libexec insane test so skip it.
34INSANE_SKIP_${PN} = "libexec"
35INSANE_SKIP_${PN}-dbg = "libexec"
36
37
38do_install_ptest () {
39 chmod +x ${D}/${libdir}/${PN}/ptest/tests/utils/utils.sh
40 for i in `find ${D}/${libdir}/${PN}/ptest -perm /u+x -type f`; do
41 sed -e "s:\$TESTDIR.*/src/bin/lttng/\$LTTNG_BIN:\$LTTNG_BIN:g" \
42 -e "s:\$TESTDIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
43 -e "s:\$DIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
44 -e "s:\$TESTDIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
45 -e "s:\$DIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
46 -e "s:\$TESTDIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
47 -e "s:\$DIR/../src/bin/lttng-sessiond/lttng-sessiond:\$SESSIOND_BIN:g" \
48 -e "s:\$DIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
49 -e "s:\$DIR/../bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
50 -i $i
51 done
52
53 sed -e "s:src/bin/lttng-sessiond:$bindir:g" \
54 -e "s:src/bin/lttng-consumerd:${libexecdir}/libexec/:g" \
55 -i ${D}/${libdir}/${PN}/ptest/tests/regression/run-report.py
56 sed -e "s:src/bin:bin:g" \
57 -i ${D}/${libdir}/${PN}/ptest/tests/utils/utils.sh
58
59}
diff --git a/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
new file mode 100644
index 0000000000..b68a9899c9
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
@@ -0,0 +1,18 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Don't build the doc examples - we don't need them and in fact they
4never successfully built in previous iterations of the lttng-ust
5recipe anyway.
6
7Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
8
9Index: doc/Makefile.am
10===================================================================
11--- a/doc/Makefile.am
12+++ b/doc/Makefile.am
13@@ -1,4 +1,4 @@
14-SUBDIRS = . examples
15+SUBDIRS = .
16
17 dist_man_MANS = man/lttng-gen-tp.1 \
18 man/lttng-ust.3 \
diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.3.1.bb b/meta/recipes-kernel/lttng/lttng-ust_2.3.1.bb
new file mode 100644
index 0000000000..44e3e2bc9c
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust_2.3.1.bb
@@ -0,0 +1,32 @@
1SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x"
2DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes."
3HOMEPAGE = "http://lttng.org/ust"
4BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust"
5
6LICENSE = "LGPLv2.1+ & BSD & GPLv2"
7LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \
8 file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \
9 file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44"
10
11inherit autotools lib_package
12
13DEPENDS = "liburcu util-linux"
14RDEPENDS_${PN} = "python"
15
16# For backwards compatibility after rename
17RPROVIDES_${PN} = "lttng2-ust"
18RREPLACES_${PN} = "lttng2-ust"
19RCONFLICTS_${PN} = "lttng2-ust"
20
21SRCREV = "535d0408caee93577c2b4d8ad3cd672fa97eac1d"
22PV = "2.3.1"
23PE = "2"
24
25SRC_URI = "git://git.lttng.org/lttng-ust.git;branch=stable-2.3 \
26 "
27
28S = "${WORKDIR}/git"
29
30do_configure_prepend () {
31 ( cd ${S}; ${S}/bootstrap )
32}
diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.4.0.bb b/meta/recipes-kernel/lttng/lttng-ust_2.4.0.bb
new file mode 100644
index 0000000000..1629554b09
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust_2.4.0.bb
@@ -0,0 +1,32 @@
1SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x"
2DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes."
3HOMEPAGE = "http://lttng.org/ust"
4BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust"
5
6LICENSE = "LGPLv2.1+ & BSD & GPLv2"
7LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \
8 file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \
9 file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44"
10
11inherit autotools lib_package
12
13DEPENDS = "liburcu util-linux"
14
15# For backwards compatibility after rename
16RPROVIDES_${PN} = "lttng2-ust"
17RREPLACES_${PN} = "lttng2-ust"
18RCONFLICTS_${PN} = "lttng2-ust"
19
20SRCREV = "5ba5bf7fba804d2de773ae1c71106a8ed856c56a"
21PV = "2.4.0"
22PE = "2"
23
24SRC_URI = "git://git.lttng.org/lttng-ust.git;branch=stable-2.4 \
25 file://lttng-ust-doc-examples-disable.patch \
26 "
27
28S = "${WORKDIR}/git"
29
30do_configure_prepend () {
31 ( cd ${S}; ${S}/bootstrap )
32}
diff --git a/meta/recipes-kernel/modutils-initscripts/files/PD.patch b/meta/recipes-kernel/modutils-initscripts/files/PD.patch
new file mode 100644
index 0000000000..21ac49cbd8
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/files/PD.patch
@@ -0,0 +1,8 @@
1Upstream-Status: Inappropriate [licensing]
2
3Index: modutils-initscripts-1.0/LICENSE
4===================================================================
5--- /dev/null 1970-01-01 00:00:00.000000000 +0000
6+++ modutils-initscripts-1.0/LICENSE 2010-12-06 14:26:03.570339002 -0800
7@@ -0,0 +1 @@
8+Public Domain
diff --git a/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
new file mode 100755
index 0000000000..a78adf5729
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
@@ -0,0 +1,52 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: module-init-tools
4# Required-Start:
5# Required-Stop:
6# Should-Start: checkroot
7# Should-stop:
8# Default-Start: S
9# Default-Stop:
10# Short-Description: Process /etc/modules.
11# Description: Load the modules listed in /etc/modules.
12### END INIT INFO
13
14LOAD_MODULE=modprobe
15[ -f /proc/modules ] || exit 0
16[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0
17[ -e /sbin/modprobe ] || LOAD_MODULE=insmod
18
19if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then
20 [ "$VERBOSE" != no ] && echo "Calculating module dependencies ..."
21 depmod -Ae
22fi
23
24loaded_modules=" "
25
26process_file() {
27 file=$1
28
29 (cat $file; echo; ) |
30 while read module args
31 do
32 case "$module" in
33 \#*|"") continue ;;
34 esac
35 [ -n "$(echo $loaded_modules | grep " $module ")" ] && continue
36 [ "$VERBOSE" != no ] && echo -n "$module "
37 eval "$LOAD_MODULE $module $args >/dev/null 2>&1"
38 loaded_modules="${loaded_modules}${module} "
39 done
40}
41
42[ "$VERBOSE" != no ] && echo -n "Loading modules: "
43[ -f /etc/modules ] && process_file /etc/modules
44
45[ -d /etc/modules-load.d ] || exit 0
46
47for f in /etc/modules-load.d/*.conf; do
48 process_file $f
49done
50[ "$VERBOSE" != no ] && echo
51
52exit 0
diff --git a/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb b/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
new file mode 100644
index 0000000000..125f5fb073
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
@@ -0,0 +1,20 @@
1SUMMARY = "Initscript for auto-loading kernel modules on boot"
2SECTION = "base"
3LICENSE = "PD"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=7bf87fc37976e93ec66ad84fac58c098"
5SRC_URI = "file://modutils.sh \
6 file://PD.patch"
7PR = "r7"
8
9INITSCRIPT_NAME = "modutils.sh"
10INITSCRIPT_PARAMS = "start 05 S ."
11
12inherit update-rc.d
13
14do_compile () {
15}
16
17do_install () {
18 install -d ${D}${sysconfdir}/init.d/
19 install -m 0755 ${WORKDIR}/modutils.sh ${D}${sysconfdir}/init.d/
20}
diff --git a/meta/recipes-kernel/oprofile/oprofile.inc b/meta/recipes-kernel/oprofile/oprofile.inc
new file mode 100644
index 0000000000..080219ed3d
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile.inc
@@ -0,0 +1,36 @@
1SUMMARY = "System-Wide Profiler"
2DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
3of profiling all running code at low overhead."
4HOMEPAGE = "http://oprofile.sourceforge.net/news/"
5BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191"
6
7LICENSE = "LGPLv2.1+ & GPLv2"
8LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
9 file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \
10 file://daemon/liblegacy/p_module.h;beginline=2;endline=20;md5=fc23a43455edf185307274a99730b6e4"
11
12SECTION = "devel"
13
14DEPENDS = "popt binutils"
15RDEPENDS_${PN} = "binutils-symlinks"
16RRECOMMENDS_${PN} = "kernel-vmlinux"
17
18FILES_${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}"
19FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la"
20FILES_${PN}-staticdev += "${libdir}/${BPN}/lib*.a"
21
22INC_PR = "r2"
23
24SRC_URI = "file://opstart.patch \
25 file://oprofile-no-query-modules.patch \
26 file://oprofile-root.patch \
27 file://acinclude.m4"
28
29inherit autotools-brokensep
30
31EXTRA_OECONF = "--with-kernel=${STAGING_KERNEL_DIR} --without-x"
32do_configure () {
33 find ${S} -wholename '${S}/.pc' -prune -o -type f -print | xargs sed -i 's#ROOTHOME#${ROOT_HOME}#'
34 cp ${WORKDIR}/acinclude.m4 ${S}/
35 autotools_do_configure
36}
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-AArch64-architecture.patch b/meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-AArch64-architecture.patch
new file mode 100644
index 0000000000..a2385cd2b2
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-AArch64-architecture.patch
@@ -0,0 +1,31 @@
1From 27edaef9c6d66dfc324630ef40cb27e78031eeeb Mon Sep 17 00:00:00 2001
2From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
3Date: Tue, 15 Jan 2013 07:37:33 +0100
4Subject: [PATCH] Add rmb() definition for AArch64 architecture
5
6Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
7
8Upstream-Status: backport
9---
10 libperf_events/operf_utils.h | 5 +++++
11 1 file changed, 5 insertions(+)
12
13diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h
14index 815d51d..2df00b7 100644
15--- a/libperf_events/operf_utils.h
16+++ b/libperf_events/operf_utils.h
17@@ -148,6 +148,11 @@ void op_release_resources(void);
18 #define cpu_relax() asm volatile("":::"memory")
19 #endif
20
21+#ifdef __aarch64__
22+#define rmb() asm volatile("dmb ld" ::: "memory")
23+#define cpu_relax() asm volatile("yield" ::: "memory")
24+#endif
25+
26 #ifdef __mips__
27 #include <asm/unistd.h>
28 #define rmb() asm volatile( \
29--
301.8.0
31
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-Allow-ppc64-events-to-be-specified-with-or-without-_.patch b/meta/recipes-kernel/oprofile/oprofile/0001-Allow-ppc64-events-to-be-specified-with-or-without-_.patch
new file mode 100644
index 0000000000..d19948a4f8
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-Allow-ppc64-events-to-be-specified-with-or-without-_.patch
@@ -0,0 +1,208 @@
1Upstream-Status: Accepted
2
3From 36028035555297695f52e856f21920012fd64f79 Mon Sep 17 00:00:00 2001
4From: Maynard Johnson <maynardj@us.ibm.com>
5Date: Fri, 11 Jan 2013 13:29:57 -0600
6Subject: [PATCH] Allow ppc64 events to be specified with or without _GRP<n>
7 suffix
8
9All events for IBM PowerPC server processors (except CYCLES) have
10a _GRP<n> suffix. This is because the legacy opcontrol profiler
11can only profile events in the same group (i.e., having the same
12_GRP<n> suffix). But operf has no such restriction because it
13can multiplex events; thus, so we should allow the user to pass
14event names without the _GRP<n> suffix.
15
16Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
17---
18 doc/operf.1.in | 6 +++
19 doc/oprofile.xml | 12 +++++-
20 pe_profiling/operf.cpp | 107 ++++++++++++++++++++++++++++++++++++++++++++++++
21 utils/ophelp.c | 4 ++
22 4 files changed, 127 insertions(+), 2 deletions(-)
23
24diff --git a/doc/operf.1.in b/doc/operf.1.in
25index b109324..03027ca 100644
26--- a/doc/operf.1.in
27+++ b/doc/operf.1.in
28@@ -110,6 +110,12 @@ be specified using the symbolic name. If no unit mask is specified, 0x0 will be
29 used as the default.
30 .P
31 .RS
32+On IBM PowerPC systems, events may be specified with or without the
33+.I _GRP<n>
34+suffix. If no group number suffix is given, one will be automatically
35+assigned; thus, OProfile post-processing tools will always show real event
36+names that include the group number suffix.
37+.P
38 When no event specification is given, the default event for the running
39 processor type will be used for profiling.
40 Use
41diff --git a/doc/oprofile.xml b/doc/oprofile.xml
42index 0ae2b0b..0f74726 100644
43--- a/doc/oprofile.xml
44+++ b/doc/oprofile.xml
45@@ -1106,10 +1106,18 @@ shown by the output of <command>ophelp</command>. Unit masks with "extra:" para
46 specified using the symbolic name.
47 </para>
48 <note><para>
49-When using legacy mode <command>opcontrol</command> on PowerPC platforms, all events specified must be in the same group;
50+When using legacy mode <command>opcontrol</command> on IBM PowerPC platforms, all events specified must be in the same group;
51 i.e., the group number appended to the event name (e.g. <constant>&lt;<emphasis>some-event-name</emphasis>&gt;_GRP9
52 </constant>) must be the same.
53-</para></note>
54+</para>
55+<para>
56+When profiling with <command>operf</command> on IBM PowerPC platforms, the above restriction
57+regarding the same group number does not apply, and events may be
58+specified with or without the group number suffix. If no group number suffix is given, one will be automatically
59+assigned; thus, OProfile post-processing tools will always show real event
60+names that include the group number suffix.
61+</para>
62+</note>
63 <para>
64 If OProfile is using timer-interrupt mode, there is no event configuration possible.
65 </para>
66diff --git a/pe_profiling/operf.cpp b/pe_profiling/operf.cpp
67index 4416b29..a776e71 100644
68--- a/pe_profiling/operf.cpp
69+++ b/pe_profiling/operf.cpp
70@@ -1146,6 +1146,108 @@ static void _get_event_code(operf_event_t * event)
71 event->evt_code = config;
72 }
73
74+#if (defined(__powerpc__) || defined(__powerpc64__))
75+/* All ppc64 events (except CYCLES) have a _GRP<n> suffix. This is
76+ * because the legacy opcontrol profiler can only profile events in
77+ * the same group (i.e., having the same _GRP<n> suffix). But operf
78+ * can multiplex events, so we should allow the user to pass event
79+ * names without the _GRP<n> suffix.
80+ *
81+ * If event name is not CYCLES or does not have a _GRP<n> suffix,
82+ * we'll call ophelp and scan the list of events, searching for one
83+ * that matches up to the _GRP<n> suffix. If we don't find a match,
84+ * then we'll exit with the expected error message for invalid event name.
85+ */
86+static string _handle_powerpc_event_spec(string event_spec)
87+{
88+ FILE * fp;
89+ char line[MAX_INPUT];
90+ size_t grp_pos;
91+ string evt, retval, err_msg;
92+ size_t evt_name_len;
93+ bool first_non_cyc_evt_found = false;
94+ bool event_found = false;
95+ char event_name[OP_MAX_EVT_NAME_LEN], event_spec_str[OP_MAX_EVT_NAME_LEN + 20], * count_str;
96+ string cmd = OP_BINDIR;
97+ cmd += "/ophelp";
98+
99+ strncpy(event_spec_str, event_spec.c_str(), event_spec.length() + 1);
100+
101+ strncpy(event_name, strtok(event_spec_str, ":"), OP_MAX_EVT_NAME_LEN);
102+ count_str = strtok(NULL, ":");
103+ if (!count_str) {
104+ err_msg = "Invalid count for event ";
105+ goto out;
106+ }
107+
108+ if (!strcmp("CYCLES", event_name)) {
109+ event_found = true;
110+ goto out;
111+ }
112+
113+ evt = event_name;
114+ // Need to make sure the event name truly has a _GRP<n> suffix.
115+ grp_pos = evt.rfind("_GRP");
116+ if ((grp_pos != string::npos) && ((evt = evt.substr(grp_pos, string::npos))).length() > 4) {
117+ unsigned long value;
118+ char * end;
119+ value = strtoul(evt.substr(4, string::npos).c_str(), &end, 0);
120+ if (end && (*end == '\0')) {
121+ // Valid group number found after _GRP, so we can skip to the end.
122+ event_found = true;
123+ goto out;
124+ }
125+ }
126+
127+ // If we get here, it implies the user passed a non-CYCLES event without a GRP suffix.
128+ // Lets try to find a valid suffix for it.
129+ fp = popen(cmd.c_str(), "r");
130+ if (fp == NULL) {
131+ cerr << "Unable to execute ophelp to get info for event "
132+ << event_spec << endl;
133+ exit(EXIT_FAILURE);
134+ }
135+ evt_name_len = strlen(event_name);
136+ err_msg = "Cannot find event ";
137+ while (fgets(line, MAX_INPUT, fp)) {
138+ if (!first_non_cyc_evt_found) {
139+ if (!strncmp(line, "PM_", 3))
140+ first_non_cyc_evt_found = true;
141+ else
142+ continue;
143+ }
144+ if (line[0] == ' ' || line[0] == '\t')
145+ continue;
146+ if (!strncmp(line, event_name, evt_name_len)) {
147+ // Found a potential match. Check if it's a perfect match.
148+ string save_event_name = event_name;
149+ size_t full_evt_len = index(line, ':') - line;
150+ memset(event_name, '\0', OP_MAX_EVT_NAME_LEN);
151+ strncpy(event_name, line, full_evt_len);
152+ string candidate = event_name;
153+ if (candidate.rfind("_GRP") == evt_name_len) {
154+ event_found = true;
155+ break;
156+ } else {
157+ memset(event_name, '\0', OP_MAX_EVT_NAME_LEN);
158+ strncpy(event_name, save_event_name.c_str(), evt_name_len);
159+ }
160+ }
161+ }
162+ pclose(fp);
163+
164+out:
165+ if (!event_found) {
166+ cerr << err_msg << event_name << endl;
167+ cerr << "Error retrieving info for event "
168+ << event_spec << endl;
169+ exit(EXIT_FAILURE);
170+ }
171+ retval = event_name;
172+ return retval + ":" + count_str;
173+}
174+#endif
175+
176 static void _process_events_list(void)
177 {
178 string cmd = OP_BINDIR;
179@@ -1154,6 +1256,11 @@ static void _process_events_list(void)
180 FILE * fp;
181 string full_cmd = cmd;
182 string event_spec = operf_options::evts[i];
183+
184+#if (defined(__powerpc__) || defined(__powerpc64__))
185+ event_spec = _handle_powerpc_event_spec(event_spec);
186+#endif
187+
188 if (operf_options::callgraph) {
189 full_cmd += " --callgraph=1 ";
190 }
191diff --git a/utils/ophelp.c b/utils/ophelp.c
192index 53a5dde..63895c8 100644
193--- a/utils/ophelp.c
194+++ b/utils/ophelp.c
195@@ -652,6 +652,10 @@ int main(int argc, char const * argv[])
196 case CPU_PPC64_POWER7:
197 case CPU_PPC64_IBM_COMPAT_V1:
198 event_doc =
199+ "When using operf, events may be specified without a '_GRP<n>' suffix.\n"
200+ "If _GRP<n> (i.e., group number) is not specified, one will be automatically\n"
201+ "selected for use by the profiler. OProfile post-processing tools will\n"
202+ "always show real event names that include the group number suffix.\n\n"
203 "Documentation for IBM POWER7 can be obtained at:\n"
204 "http://www.power.org/events/Power7/\n"
205 "No public performance monitoring doc available for older processors.\n";
206--
2071.7.9.7
208
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch b/meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch
new file mode 100644
index 0000000000..eeec755cb9
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch
@@ -0,0 +1,49 @@
1Upstream-Status: Backport
2
3From 414f4dba2d77f3014755aa58937efb22a4789e9f Mon Sep 17 00:00:00 2001
4From: Maynard Johnson <maynardj@us.ibm.com>
5Date: Fri, 21 Dec 2012 08:27:37 -0600
6Subject: [PATCH] Change configure to look for libpfm4 function first; then
7 fallback to libpfm3
8
9This change only affects ppc64 architecture, since it's the only
10architecture that uses libpfm to obtain the event hex code to pass
11to perf_event_open.
12
13There were bugs in libpfm3 pertaining to POWER7 event definitions that
14have been fixed in libpfm4. So it's likely that some IBM POWER7 users
15may want to install libpfm4 and build oprofile to link with it. For
16example, if libpfm4 were installed in /usr/local, the user would invoke
17oprofile's configure thusly:
18
19LDFLAGS="-L/usr/local/lib64" CPPFLAGS="-I/usr/local/include" ./configure
20
21But if the user happens to also have libpfm3 already installed in /usr,
22then the current order of config tests would result in choosing the libpfm3
23library. This logic seems wrong. The configure checking should go from most
24recent to older library versions. This patch changes the order of checking
25so the libpfm4 library would be found first.
26
27Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
28---
29 configure.ac | 4 ++--
30 1 file changed, 2 insertions(+), 2 deletions(-)
31
32diff --git a/configure.ac b/configure.ac
33index 3078393..a9b1ee4 100644
34--- a/configure.ac
35+++ b/configure.ac
36@@ -160,8 +160,8 @@ if test "$HAVE_PERF_EVENTS" = "1"; then
37 arch="`uname -m`"
38 if test "$arch" = "ppc64" || test "$arch" = "ppc"; then
39 AC_CHECK_HEADER(perfmon/pfmlib.h,,[AC_MSG_ERROR([pfmlib.h not found; usually provided in papi devel package])])
40- AC_CHECK_LIB(pfm,pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1', [
41- AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1',
42+ AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1', [
43+ AC_CHECK_LIB(pfm, pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1',
44 [AC_MSG_ERROR([libpfm not found; usually provided in papi devel package])])])
45 PFM_LIB="-lpfm"
46 AC_DEFINE_UNQUOTED(HAVE_LIBPFM3, $HAVE_LIBPFM3, [Define to 1 if using libpfm3; 0 if using newer libpfm])
47--
481.7.9.7
49
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-Fix-PPC64-specific-libpfm-usage-so-it-doesn-t-break-.patch b/meta/recipes-kernel/oprofile/oprofile/0001-Fix-PPC64-specific-libpfm-usage-so-it-doesn-t-break-.patch
new file mode 100644
index 0000000000..6f5b1c00ee
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-Fix-PPC64-specific-libpfm-usage-so-it-doesn-t-break-.patch
@@ -0,0 +1,132 @@
1Upstream-Status: Accepted
2
3From 8e36ad01ceb1257d05773b684dbe9358aecd3f71 Mon Sep 17 00:00:00 2001
4From: Maynard Johnson <maynardj@us.ibm.com>
5Date: Tue, 26 Feb 2013 13:41:27 -0600
6Subject: [PATCH] Fix PPC64-specific libpfm usage so it doesn't break ppc32
7 architecture
8
9The configure check to determine whether we should use libpfm or not
10is intended only for the ppc64 architecture, but was incorrectly
11hitting on the ppc32 architecture, too. Not only that, but it was using
12'uname' which is not a good idea in cross-compile situtations.
13
14Then, aside from that, we had several instances in the source code
15of the following:
16 #if (defined(__powerpc__) || defined(__powerpc64__))
17which incorrectly included ppc32 architecutre also, when it was intended
18for use as PPC64 architecture.
19
20This patch fixes both errors.
21
22Signed-off-by: Maynard Johnson <maynardj@us.ibm.com
23---
24 configure.ac | 5 ++---
25 libperf_events/operf_utils.cpp | 4 ++--
26 libperf_events/operf_utils.h | 6 ++++++
27 pe_profiling/operf.cpp | 10 +++++-----
28 4 files changed, 15 insertions(+), 10 deletions(-)
29
30diff --git a/configure.ac b/configure.ac
31index a9b1ee4..a0da98c 100644
32--- a/configure.ac
33+++ b/configure.ac
34@@ -154,11 +154,10 @@ else
35 fi
36
37 AC_DEFINE_UNQUOTED(HAVE_PERF_EVENTS, $HAVE_PERF_EVENTS, [Kernel support for perf_events exists])
38-
39+AC_CANONICAL_HOST
40 if test "$HAVE_PERF_EVENTS" = "1"; then
41 PFM_LIB=
42- arch="`uname -m`"
43- if test "$arch" = "ppc64" || test "$arch" = "ppc"; then
44+ if test "$host_cpu" = "powerpc64"; then
45 AC_CHECK_HEADER(perfmon/pfmlib.h,,[AC_MSG_ERROR([pfmlib.h not found; usually provided in papi devel package])])
46 AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1', [
47 AC_CHECK_LIB(pfm, pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1',
48diff --git a/libperf_events/operf_utils.cpp b/libperf_events/operf_utils.cpp
49index da964fd..a17200b 100644
50--- a/libperf_events/operf_utils.cpp
51+++ b/libperf_events/operf_utils.cpp
52@@ -83,7 +83,7 @@ static event_t comm_event;
53 * the following method is to map the operf-record event value to a value that
54 * opreport can understand.
55 */
56-#if (defined(__powerpc__) || defined(__powerpc64__))
57+#if PPC64_ARCH
58 #define NIL_CODE ~0U
59
60 #if HAVE_LIBPFM3
61@@ -716,7 +716,7 @@ static void __handle_sample_event(event_t * event, u64 sample_type)
62 } else if (event->header.misc == PERF_RECORD_MISC_USER) {
63 in_kernel = false;
64 }
65-#if (defined(__powerpc__) || defined(__powerpc64__))
66+#if PPC64_ARCH
67 else if (event->header.misc == PERF_RECORD_MISC_HYPERVISOR) {
68 #define MAX_HYPERVISOR_ADDRESS 0xfffffffULL
69 if (data.ip > MAX_HYPERVISOR_ADDRESS) {
70diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h
71index 2df00b7..ddf05ed 100644
72--- a/libperf_events/operf_utils.h
73+++ b/libperf_events/operf_utils.h
74@@ -45,6 +45,12 @@ extern bool throttled;
75 #define MMAP_WINDOW_SZ (32 * 1024 * 1024ULL)
76 #endif
77
78+/* A macro to be used for ppc64 architecture-specific code. The '__powerpc__' macro
79+ * is defined for both ppc64 and ppc32 architectures, so we must further qualify by
80+ * including the 'HAVE_LIBPFM' macro, since that macro will be defined only for ppc64.
81+ */
82+#define PPC64_ARCH (HAVE_LIBPFM) && ((defined(__powerpc__) || defined(__powerpc64__)))
83+
84 extern unsigned int op_nr_counters;
85
86 static inline size_t align_64bit(u64 x)
87diff --git a/pe_profiling/operf.cpp b/pe_profiling/operf.cpp
88index e7c2eab..e1190c2 100644
89--- a/pe_profiling/operf.cpp
90+++ b/pe_profiling/operf.cpp
91@@ -1177,7 +1177,7 @@ static void _get_event_code(operf_event_t * event)
92 event->evt_code = config;
93 }
94
95-#if (defined(__powerpc__) || defined(__powerpc64__))
96+#if PPC64_ARCH
97 /* All ppc64 events (except CYCLES) have a _GRP<n> suffix. This is
98 * because the legacy opcontrol profiler can only profile events in
99 * the same group (i.e., having the same _GRP<n> suffix). But operf
100@@ -1287,7 +1287,7 @@ static void _process_events_list(void)
101 string full_cmd = cmd;
102 string event_spec = operf_options::evts[i];
103
104-#if (defined(__powerpc__) || defined(__powerpc64__))
105+#if PPC64_ARCH
106 event_spec = _handle_powerpc_event_spec(event_spec);
107 #endif
108
109@@ -1357,9 +1357,9 @@ static void _process_events_list(void)
110 _get_event_code(&event);
111 events.push_back(event);
112 }
113-#if (defined(__powerpc__) || defined(__powerpc64__))
114+#if PPC64_ARCH
115 {
116- /* This section of code is for architectures such as ppc[64] for which
117+ /* This section of code is soley for the ppc64 architecture for which
118 * the oprofile event code needs to be converted to the appropriate event
119 * code to pass to the perf_event_open syscall.
120 */
121@@ -1404,7 +1404,7 @@ static void get_default_event(void)
122 _get_event_code(&dft_evt);
123 events.push_back(dft_evt);
124
125-#if (defined(__powerpc__) || defined(__powerpc64__))
126+#if PPC64_ARCH
127 {
128 /* This section of code is for architectures such as ppc[64] for which
129 * the oprofile event code needs to be converted to the appropriate event
130--
1311.7.9.7
132
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-Fix-up-configure-to-handle-architectures-that-do-not.patch b/meta/recipes-kernel/oprofile/oprofile/0001-Fix-up-configure-to-handle-architectures-that-do-not.patch
new file mode 100644
index 0000000000..5e6d5de355
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-Fix-up-configure-to-handle-architectures-that-do-not.patch
@@ -0,0 +1,163 @@
1Upstream-Status: Backport
2
3From ca6d916a6f8f0f8abbb4c9b6a97dd1a1615bb124 Mon Sep 17 00:00:00 2001
4From: Maynard Johnson <maynardj@us.ibm.com>
5Date: Wed, 5 Dec 2012 10:16:35 -0600
6Subject: [PATCH] Fix up configure to handle architectures that do not
7 implement perf_event_open
8
9This patch fixes the following problems:
10
111) The configure script allows the user to pass a location to kernel
12headers (via --with-kernel option) such that, even if the running
13kernel does not have perf_events support, it may be possible to
14build operf (e.g., in cross-compile environments). But the message
15'This kernel does not have perf_events support; falling back to legacy
16oprofile' was being displayed inappropriately in such cases. This
17patch changes the configure script so that the "falling back to
18legacy oprofile" message will only be displayed if we're running
19on a kernel that does not have perf_events support AND the user
20did not pass specify the "--with-kernel" option.
21
222) Some architectures don't even implement the perf_event_open syscall, so the
23configure script must do more than checking kernel version and whether or not
24perf_event.h is present in order to decide if perf_events is supported.
25This patch provides that extra capability.
26
27These problems were reported by Tony Jones <tonyj@suse.com>.
28
29Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
30---
31 configure.ac | 74 +++++++++++++++++++++++++++++-----------
32 utils/op_perf_events_checker.c | 6 ++--
33 2 files changed, 58 insertions(+), 22 deletions(-)
34
35diff --git a/configure.ac b/configure.ac
36index 5c3d13d..89336ee 100644
37--- a/configure.ac
38+++ b/configure.ac
39@@ -70,34 +70,66 @@ KERNELDIR=$withval)
40
41
42 dnl Check kernel version for perf_events supported
43-AC_MSG_CHECKING([kernel version supports perf_events])
44 if test "$KERNELDIR" != ""; then
45 KINC="$KERNELDIR/include"
46-fi
47-AX_KERNEL_VERSION(2, 6, 31, <=, kernel_has_perf_events_support="yes",
48-kernel_has_perf_events_support="no")
49-
50-if test "$kernel_has_perf_events_support" = "no"; then
51- AC_MSG_RESULT([This kernel does not have perf_events support; falling back to legacy oprofile])
52+ PERF_EVENT_FLAGS=" -I$KERNELDIR/include"
53+ AC_SUBST(PERF_EVENT_FLAGS)
54+ PERF_EVENT_H="$KERNELDIR/include/linux/perf_event.h"
55 else
56- AC_MSG_RESULT([This kernel has perf_events support])
57+ PERF_EVENT_H="/usr/include/linux/perf_event.h"
58 fi
59
60-if test "$KERNELDIR" == ""; then
61- PERF_EVENT_H="/usr/include/linux/perf_event.h"
62+PERF_EVENT_H_EXISTS="no"
63+kernel_may_have_perf_events_support="no"
64+AX_KERNEL_VERSION(2, 6, 31, <=, kernel_may_have_perf_events_support="yes",
65+kernel_has_perf_events_support="no")
66+
67+dnl The AX_KERNEL_VERSION macro may return kernel_may_have_perf_events_support="yes",
68+dnl indicating a partial answer. Some architectures do not implement the Performance
69+dnl Events Kernel Subsystem even with kernel versions > 2.6.31 -- i.e., not even
70+dnl implementing the perf_event_open syscall to return ENOSYS. So the check below
71+dnl will identify and handle such situations.
72+
73+if test "$kernel_may_have_perf_events_support" = "yes"; then
74+ AC_CHECK_HEADER($PERF_EVENT_H,PERF_EVENT_H_EXISTS="yes")
75+ AC_MSG_CHECKING([kernel supports perf_events])
76+ if test "$PERF_EVENT_H_EXISTS" = "yes"; then
77+ rm -f test-for-PERF_EVENT_OPEN
78+ AC_LANG_CONFTEST(
79+ [AC_LANG_PROGRAM([[#include <linux/perf_event.h>
80+ #include <asm/unistd.h>
81+ #include <sys/types.h>
82+ #include <string.h>
83+ ]],
84+ [[struct perf_event_attr attr;
85+ pid_t pid;
86+ memset(&attr, 0, sizeof(attr));
87+ attr.size = sizeof(attr);
88+ attr.sample_type = PERF_SAMPLE_IP;
89+ pid = getpid();
90+ syscall(__NR_perf_event_open, &attr, pid, 0, -1, 0);
91+ ]])
92+ ])
93+ $CC conftest.$ac_ext $CFLAGS $LDFLAGS $LIBS $PERF_EVENT_FLAGS -o test-for-PERF_EVENT_OPEN > /dev/null 2>&1
94+ if test -f test-for-PERF_EVENT_OPEN; then
95+ kernel_has_perf_events_support="yes"
96+ AC_MSG_RESULT(yes)
97+ else
98+ AC_MSG_RESULT(no)
99+ kernel_has_perf_events_support="no"
100+ fi
101+ else
102+ AC_MSG_RESULT(unknown -- perf_event.h not found)
103+ fi
104 else
105- PERF_EVENT_H="$KERNELDIR/include/linux/perf_event.h"
106+ AC_MSG_RESULT(kernel supports perf_events... no)
107+ kernel_has_perf_events_support="no"
108 fi
109-AC_CHECK_HEADER($PERF_EVENT_H,PERF_EVENT_H_EXISTS="yes")
110-AM_CONDITIONAL(BUILD_FOR_PERF_EVENT, test -n "$PERF_EVENT_H_EXISTS")
111-if test "$PERF_EVENT_H_EXISTS" = "yes"; then
112- HAVE_PERF_EVENTS='1'
113
114- if test "$KERNELDIR" != ""; then
115- PERF_EVENT_FLAGS=" -I$KERNELDIR/include"
116- AC_SUBST(PERF_EVENT_FLAGS)
117- fi
118+AM_CONDITIONAL(BUILD_FOR_PERF_EVENT, test "$kernel_has_perf_events_support" = "yes")
119
120+if test "$kernel_has_perf_events_support" = "yes"; then
121+ HAVE_PERF_EVENTS='1'
122 AC_MSG_CHECKING([whether PERF_RECORD_MISC_GUEST_KERNEL is defined in perf_event.h])
123 rm -f test-for-PERF_GUEST
124 AC_LANG_CONFTEST(
125@@ -117,7 +149,9 @@ if test "$PERF_EVENT_H_EXISTS" = "yes"; then
126 rm -f test-for-PERF_GUEST*
127 else
128 HAVE_PERF_EVENTS='0'
129+ AC_MSG_RESULT([No perf_events support available; falling back to legacy oprofile])
130 fi
131+
132 AC_DEFINE_UNQUOTED(HAVE_PERF_EVENTS, $HAVE_PERF_EVENTS, [Kernel support for perf_events exists])
133
134 if test "$HAVE_PERF_EVENTS" = "1"; then
135@@ -433,7 +467,7 @@ elif test "`getent passwd oprofile 2>/dev/null`" == "" || \
136 fi
137 fi
138
139-if test "$PERF_EVENT_H_EXISTS" != "yes" && test "$kernel_has_perf_events_support" = "yes"; then
140+if test "$PERF_EVENT_H_EXISTS" != "yes" && test "$kernel_may_have_perf_events_support" = "yes"; then
141 echo "Warning: perf_event.h not found. Either install the kernel headers package or"
142 echo "use the --with-kernel option if you want the non-root, single application"
143 echo "profiling support provided by operf."
144diff --git a/utils/op_perf_events_checker.c b/utils/op_perf_events_checker.c
145index 519cafa..74a410e 100644
146--- a/utils/op_perf_events_checker.c
147+++ b/utils/op_perf_events_checker.c
148@@ -49,8 +49,10 @@ int main(int argc, char **argv)
149 }
150
151 #if HAVE_PERF_EVENTS
152- /* If perf_events syscall is not implemented, the syscall below will fail
153- * with ENOSYS (38). If implemented, but the processor type on which this
154+ /* Even if the perf_event_open syscall is implemented, the architecture may still
155+ * not provide a full implementation of the perf_events subsystem, in which case,
156+ * the syscall below will fail with ENOSYS (38). If the perf_events subsystem is
157+ * implemented for the architecture, but the processor type on which this
158 * program is running is not supported by perf_events, the syscall returns
159 * ENOENT (2).
160 */
161--
1621.7.9.7
163
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-Handle-early-perf_events-kernel-without-PERF_RECORD_.patch b/meta/recipes-kernel/oprofile/oprofile/0001-Handle-early-perf_events-kernel-without-PERF_RECORD_.patch
new file mode 100644
index 0000000000..894e99aec8
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-Handle-early-perf_events-kernel-without-PERF_RECORD_.patch
@@ -0,0 +1,107 @@
1Upstream-Status: Backport
2
3From dbe24f5f0d98b1fe5517d2b137b4c59766e536ad Mon Sep 17 00:00:00 2001
4From: Maynard Johnson <maynardj@us.ibm.com>
5Date: Mon, 19 Nov 2012 15:16:37 -0600
6Subject: [PATCH] Handle early perf_events kernel without
7 PERF_RECORD_MISC_GUEST* macros
8
9In very early versions of perf_events kernel subsystem, the
10PERF_RECORD_MISC_GUEST_KERNEL and PERF_RECORD_MISC_GUEST_USER
11macros (in perf_event.h) were not yet defined. This patch adds
12a configure check to determine when it's OK for source code to refer
13to those macros.
14
15This patch also does some minor cleanup of the configure script
16help and warning messages relating to the --with-kernel option.
17
18Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
19---
20 configure.ac | 32 ++++++++++++++++++++++++++------
21 libperf_events/operf_utils.cpp | 2 ++
22 2 files changed, 28 insertions(+), 6 deletions(-)
23
24diff --git a/configure.ac b/configure.ac
25index 7449854..18d1169 100644
26--- a/configure.ac
27+++ b/configure.ac
28@@ -60,12 +60,12 @@ test "$LD" || AC_ERROR(ld not found)
29
30 # --with-kernel for cross compilation
31 AC_ARG_WITH(kernel,
32-[AS_HELP_STRING([--with-kernel=dir], [Path to kernel include directory (...include/linux/perf_event.h) to use.
33+[AS_HELP_STRING([--with-kernel=dir], [Path to kernel include directory (e.g. /tmp/linux-xyz) to use.
34 If this option is not specified, configure will look for kernel header files in the usual installation location
35-for a kernel-headers package -- /usr/include. Use this option in cross-compile enviroments
36+for a kernel-headers package -- /usr. Use this option in cross-compile enviroments
37 or in situations where the host system does not support perf_events but you wish to build binaries
38-for a target system that does support perf_events. Because of OProfile's use of syscalls, be sure that the
39-kernel headers used match the architecture of the intended target system.])],
40+for a target system that does support perf_events. Because of OProfile's use of syscalls,
41+kernel headers used during build must match the architecture of the intended target system.])],
42 KERNELDIR=$withval)
43
44
45@@ -92,10 +92,29 @@ AC_CHECK_HEADER($PERF_EVENT_H,PERF_EVENT_H_EXISTS="yes")
46 AM_CONDITIONAL(BUILD_FOR_PERF_EVENT, test -n "$PERF_EVENT_H_EXISTS")
47 if test "$PERF_EVENT_H_EXISTS" = "yes"; then
48 HAVE_PERF_EVENTS='1'
49+
50 if test "$KERNELDIR" != ""; then
51 PERF_EVENT_FLAGS=" -I$KERNELDIR/include"
52 AC_SUBST(PERF_EVENT_FLAGS)
53 fi
54+
55+ AC_MSG_CHECKING([whether PERF_RECORD_MISC_GUEST_KERNEL is defined in perf_event.h])
56+ rm -f test-for-PERF_GUEST
57+ AC_LANG_CONFTEST(
58+ [AC_LANG_PROGRAM([[#include <linux/perf_event.h>]],
59+ [[unsigned int pr_guest_kern = PERF_RECORD_MISC_GUEST_KERNEL;
60+ unsigned int pr_guest_user = PERF_RECORD_MISC_GUEST_USER;]])
61+ ])
62+ $CC conftest.$ac_ext $CFLAGS $LDFLAGS $LIBS $PERF_EVENT_FLAGS -o test-for-PERF_GUEST > /dev/null 2>&1
63+ if test -f test-for-PERF_GUEST; then
64+ echo "yes"
65+ HAVE_PERF_GUEST_MACROS='1'
66+ else
67+ echo "no"
68+ HAVE_PERF_GUEST_MACROS='0'
69+ fi
70+ AC_DEFINE_UNQUOTED(HAVE_PERF_GUEST_MACROS, $HAVE_PERF_GUEST_MACROS, [PERF_RECORD_MISC_GUEST_KERNEL is defined in perf_event.h])
71+ rm -f test-for-PERF_GUEST*
72 else
73 HAVE_PERF_EVENTS='0'
74 fi
75@@ -416,7 +435,8 @@ elif test "`getent passwd oprofile 2>/dev/null`" == "" || \
76 fi
77
78 if test "$PERF_EVENT_H_EXISTS" != "yes" && test "$kernel_has_perf_events_support" = "yes"; then
79- echo "Warning: perf_event.h not found. Please install the kernel headers package if you"
80- echo " want non-root support built into OProfile."
81+ echo "Warning: perf_event.h not found. Either install the kernel headers package or"
82+ echo "use the --with-kernel option if you want the non-root, single application"
83+ echo "profiling support provided by operf."
84 fi
85
86diff --git a/libperf_events/operf_utils.cpp b/libperf_events/operf_utils.cpp
87index 06cd566..470cfba 100644
88--- a/libperf_events/operf_utils.cpp
89+++ b/libperf_events/operf_utils.cpp
90@@ -732,12 +732,14 @@ static void __handle_sample_event(event_t * event, u64 sample_type)
91 case PERF_RECORD_MISC_HYPERVISOR:
92 domain = "hypervisor";
93 break;
94+#if HAVE_PERF_GUEST_MACROS
95 case PERF_RECORD_MISC_GUEST_KERNEL:
96 domain = "guest OS";
97 break;
98 case PERF_RECORD_MISC_GUEST_USER:
99 domain = "guest user";
100 break;
101+#endif
102 default:
103 domain = "unknown";
104 break;
105--
1061.7.9.7
107
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-OProfile-doesn-t-build-for-32-bit-ppc-the-operf_util.patch b/meta/recipes-kernel/oprofile/oprofile/0001-OProfile-doesn-t-build-for-32-bit-ppc-the-operf_util.patch
new file mode 100644
index 0000000000..0f609df0e2
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-OProfile-doesn-t-build-for-32-bit-ppc-the-operf_util.patch
@@ -0,0 +1,32 @@
1Upstream-Status: Backport
2
3From fa889ea74b6b931e241a8cd57e90edc23cd7ab03 Mon Sep 17 00:00:00 2001
4From: William Cohen <wcohen@redhat.com>
5Date: Mon, 15 Oct 2012 15:09:55 -0500
6Subject: [PATCH] OProfile doesn't build for 32-bit ppc; the operf_utils.cpp
7 compile fails. Need to be able to build the 32-bit ppc
8 version of oprofile to provide the 32-bit ppc java support
9 libraries. The configure only handles the case of ppc64
10 with perf support.
11
12Signed-off-by: William Cohen <wcohen@redhat.com>
13---
14 configure.ac | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/configure.ac b/configure.ac
18index b739133..7449854 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -104,7 +104,7 @@ AC_DEFINE_UNQUOTED(HAVE_PERF_EVENTS, $HAVE_PERF_EVENTS, [Kernel support for perf
22 if test "$HAVE_PERF_EVENTS" = "1"; then
23 PFM_LIB=
24 arch="`uname -m`"
25- if test "$arch" = "ppc64"; then
26+ if test "$arch" = "ppc64" || test "$arch" = "ppc"; then
27 AC_CHECK_HEADER(perfmon/pfmlib.h,,[AC_MSG_ERROR([pfmlib.h not found; usually provided in papi devel package])])
28 AC_CHECK_LIB(pfm,pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1', [
29 AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1',
30--
311.7.9.7
32
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-ophelp-lists-events-Fix-doc-URL-for-ppc64-arch.patch b/meta/recipes-kernel/oprofile/oprofile/0001-ophelp-lists-events-Fix-doc-URL-for-ppc64-arch.patch
new file mode 100644
index 0000000000..b155cacd4a
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-ophelp-lists-events-Fix-doc-URL-for-ppc64-arch.patch
@@ -0,0 +1,36 @@
1Upstream-Status: Accepted
2
3From 735d9eb0322b34b3d26302a1dac173100d718d35 Mon Sep 17 00:00:00 2001
4From: Maynard Johnson <maynardj@us.ibm.com>
5Date: Thu, 10 Jan 2013 14:24:26 -0600
6Subject: [PATCH] ophelp lists events: Fix doc URL for ppc64 arch
7
8When ophelp is used to list available events, it displays
9some help text before the event list to direct the user
10where to find more info. For the ppc64 architecture, a
11stale URL was listed. This patch fixes that URL.
12
13Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
14---
15 utils/ophelp.c | 5 +++--
16 1 file changed, 3 insertions(+), 2 deletions(-)
17
18diff --git a/utils/ophelp.c b/utils/ophelp.c
19index f48697b..827f2d0 100644
20--- a/utils/ophelp.c
21+++ b/utils/ophelp.c
22@@ -652,8 +652,9 @@ int main(int argc, char const * argv[])
23 case CPU_PPC64_POWER7:
24 case CPU_PPC64_IBM_COMPAT_V1:
25 event_doc =
26- "Obtain PowerPC64 processor documentation at:\n"
27- "http://www-306.ibm.com/chips/techlib/techlib.nsf/productfamilies/PowerPC\n";
28+ "Documentation for IBM POWER7 can be obtained at:\n"
29+ "http://www.power.org/events/Power7/\n"
30+ "No public performance monitoring doc available for older processors.\n";
31 break;
32
33 case CPU_PPC64_CELL:
34--
351.7.9.7
36
diff --git a/meta/recipes-kernel/oprofile/oprofile/acinclude.m4 b/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
new file mode 100644
index 0000000000..95ecd91b5e
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
@@ -0,0 +1,581 @@
1dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found)
2dnl see if autoconf.h defines the option
3AC_DEFUN([AX_KERNEL_OPTION], [
4SAVE_CFLAGS=$CFLAGS
5CFLAGS="-I$KINC -O2 -D__KERNEL__"
6AC_TRY_COMPILE( [#include <linux/config.h>],
7[
8#ifndef $1
9break_me_hard(\\\);
10#endif
11],[$2],[$3],)
12CFLAGS=$SAVE_CFLAGS
13])
14
15dnl Handle the 2.4 module inside module/
16AC_DEFUN([AX_CONFIG_MODULE],
17[
18if test ! -f $KINC/linux/autoconf.h; then
19 AC_MSG_ERROR([no suitably configured kernel include tree found])
20fi
21
22dnl --- Get Linux kernel version and compile parameters ---
23
24AC_SUBST(KVERS)
25AC_MSG_CHECKING([for kernel version])
26dnl it's like this to handle mandrake's fubar version.h - bug #471448
27eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
28AC_MSG_RESULT([$KVERS])
29case "$KVERS" in
302.2.*|2.4.*) ;;
31*) AC_MSG_ERROR([Unsupported kernel version])
32esac
33
34dnl Check for the minimal kernel version supported
35AC_MSG_CHECKING([kernel version])
36AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
37
38dnl linux/spinlock.h added at some point in past
39AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
40if test -f $KINC/linux/spinlock.h; then
41 EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
42 AC_MSG_RESULT([yes])
43else
44 AC_MSG_RESULT([no])
45fi
46
47AC_MSG_CHECKING([for rtc_lock])
48gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
49if test "$?" -eq 0; then
50 EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
51 AC_MSG_RESULT([yes])
52else
53 AC_MSG_RESULT([no])
54fi
55
56arch="unknown"
57AC_MSG_CHECKING(for x86-64 architecture)
58AX_KERNEL_OPTION(CONFIG_X86_64, x8664=1, x8664=0)
59AX_MSG_RESULT_YN($x8664)
60BUILD_HAMMER=no
61if test "$x8664" -eq 1; then
62 arch="x86"
63 BUILD_HAMMER=yes
64else
65 AC_MSG_CHECKING(for x86 architecture)
66 AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
67 AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
68 AX_MSG_RESULT_YN($x86)
69 test "$x86" = 1 && arch="x86"
70
71 if test "$arch" = "unknown"; then
72 AC_MSG_CHECKING(for ia64 architecture)
73 AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
74 AX_MSG_RESULT_YN($ia64)
75 test "$ia64" = 1 && arch="ia64"
76 fi
77
78fi
79AC_SUBST(BUILD_HAMMER)
80
81test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
82
83dnl check to see if kernel verion appropriate for arch
84AC_MSG_CHECKING(arch/kernel version combination)
85case "$arch" in
86ia64)
87 AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
88 AC_MSG_ERROR([unsupported arch/kernel])) ;;
89*) AC_MSG_RESULT([ok])
90esac
91
92dnl for now we do not support PREEMPT patch
93AC_MSG_CHECKING([for preempt patch])
94AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
95AX_MSG_RESULT_YN([$preempt])
96test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
97
98AC_SUBST(KINC)
99
100MODINSTALLDIR=/lib/modules/$KVERS
101
102OPROFILE_MODULE_ARCH=$arch
103AC_SUBST(OPROFILE_MODULE_ARCH)
104]
105)
106
107dnl AX_MSG_RESULT_YN(a)
108dnl results "yes" iff a==1, "no" else
109AC_DEFUN([AX_MSG_RESULT_YN], [x=no
110test "x$1" = "x1" && x=yes
111AC_MSG_RESULT($x)])
112
113dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
114AC_DEFUN([AX_MALLOC_ATTRIBUTE],
115[
116AC_MSG_CHECKING([whether malloc attribute is understood])
117SAVE_CFLAGS=$CFLAGS
118CFLAGS="-Werror $CFLAGS"
119AC_TRY_COMPILE(,[
120void monkey() __attribute__((malloc));
121],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
122CFLAGS=$SAVE_CFLAGS
123]
124)
125
126dnl builtin_expect is used in module we can't add that in config.h
127AC_DEFUN([AX_BUILTIN_EXPECT],
128[
129AC_MSG_CHECKING([whether __builtin_expect is understood])
130SAVE_CFLAGS=$CFLAGS
131CFLAGS="-Werror $CFLAGS"
132AC_TRY_LINK(,[
133int i;
134if (__builtin_expect(i, 0)) { }
135],
136AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK",
137AC_MSG_RESULT([no]);)
138CFLAGS=$SAVE_CFLAGS
139]
140)
141
142dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs
143AC_DEFUN([AX_EXTRA_DIRS],
144[
145AC_ARG_WITH(extra-includes,
146[ --with-extra-includes=DIR add extra include paths],
147 use_extra_includes="$withval",
148 use_extra_includes=NO
149)
150if test -n "$use_extra_includes" && \
151 test "$use_extra_includes" != "NO"; then
152 ac_save_ifs=$IFS
153 IFS=':'
154 for dir in $use_extra_includes; do
155 extra_includes="$extra_includes -I$dir"
156 done
157 IFS=$ac_save_ifs
158 CPPFLAGS="$CPPFLAGS $extra_includes"
159fi
160
161AC_ARG_WITH(extra-libs,
162[ --with-extra-libs=DIR add extra library paths],
163 use_extra_libs=$withval,
164 use_extra_libs=NO
165)
166if test -n "$use_extra_libs" && \
167 test "$use_extra_libs" != "NO"; then
168 ac_save_ifs=$IFS
169 IFS=':'
170 for dir in $use_extra_libs; do
171 extra_libraries="$extra_libraries -L$dir"
172 done
173 IFS=$ac_save_ifs
174 LDFLAGS="$LDFLAGS $extra_libraries"
175fi
176]
177)
178
179dnl AX_POPT_CONST - check popt prototype
180AC_DEFUN([AX_POPT_CONST],
181[
182AC_MSG_CHECKING([popt prototype])
183SAVE_CXXFLAGS=$CXXFLAGS
184CXXFLAGS="-Werror $CXXFLAGS"
185AC_TRY_COMPILE([#include <popt.h>],
186[
187int c; char **v;
188poptGetContext(0, c, v, 0, 0);
189],
190AC_MSG_RESULT([takes char **]);,
191AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **]))
192CXXFLAGS="$SAVE_CXXFLAGS"
193]
194)
195
196dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK
197AC_DEFUN([AX_CHECK_SSTREAM],
198[
199AC_MSG_CHECKING([whether to use included sstream])
200AC_TRY_COMPILE([#include <sstream>], [],
201AC_MSG_RESULT([no]);,
202AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include")
203]
204)
205
206dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false)
207dnl exec action-if-true if typedef_name is a typedef to type else exec
208dnl action-if-false
209dnl currently work only with type typedef'ed in stddef.h
210AC_DEFUN([AX_CHECK_TYPEDEF], [
211dnl AC_LANG_PUSH(C) not in autoconf 2.13
212AC_LANG_SAVE
213AC_LANG_C
214SAVE_CFLAGS=$CFLAGS
215CFLAGS="-Werror $CFLAGS"
216
217AC_TRY_COMPILE(
218 [
219 #include <stddef.h>
220 ],
221 [
222 typedef void (*fct1)($1);
223 typedef void (*fct2)($2);
224 fct1 f1 = 0;
225 fct2 f2 = 0;
226 if (f1 == f2) {}
227 ],
228[$3],[$4])
229
230CFLAGS=$SAVE_CFLAGS
231AC_LANG_RESTORE
232])
233
234
235dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name)
236dnl set var_name to the typedef name of $1 which must be in canditate_list
237dnl else produce a fatal error
238AC_DEFUN([AX_TYPEDEFED_NAME], [
239 AC_MSG_CHECKING([type of $1])
240 for f in $2; do
241 AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="")
242 if test -n "${$3}"; then
243 break
244 fi
245 done
246 if test -n "${$3}"; then
247 AC_MSG_RESULT([${$3}])
248 else
249 AC_MSG_ERROR([not found])
250 fi
251])
252
253dnl find a binary in the path
254AC_DEFUN([QT_FIND_PATH],
255[
256 AC_MSG_CHECKING([for $1])
257 AC_CACHE_VAL(qt_cv_path_$1,
258 [
259 qt_cv_path_$1="NONE"
260 if test -n "$$2"; then
261 qt_cv_path_$1="$$2";
262 else
263 dirs="$3"
264 qt_save_IFS=$IFS
265 IFS=':'
266 for dir in $PATH; do
267 dirs="$dirs $dir"
268 done
269 IFS=$qt_save_IFS
270
271 for dir in $dirs; do
272 if test -x "$dir/$1"; then
273 if test -n "$5"; then
274 evalstr="$dir/$1 $5 2>&1 "
275 if eval $evalstr; then
276 qt_cv_path_$1="$dir/$1"
277 break
278 fi
279 else
280 qt_cv_path_$1="$dir/$1"
281 break
282 fi
283 fi
284 done
285 fi
286 ])
287
288 if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then
289 AC_MSG_RESULT(not found)
290 $4
291 else
292 AC_MSG_RESULT($qt_cv_path_$1)
293 $2=$qt_cv_path_$1
294 fi
295])
296
297dnl Find the uic compiler on the path or in qt_cv_dir
298AC_DEFUN([QT_FIND_UIC],
299[
300 QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin)
301 if test -z "$ac_uic" -a "$FATAL" = 1; then
302 AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !])
303 fi
304])
305
306dnl Find the right moc in path/qt_cv_dir
307AC_DEFUN([QT_FIND_MOC],
308[
309 QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin)
310 QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin)
311
312 if test -n "$ac_moc1" -a -n "$ac_moc2"; then
313 dnl found both. Prefer Qt3's if it exists else moc2
314 $ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
315 if test "$?" = 0; then
316 ac_moc=$ac_moc1;
317 else
318 ac_moc=$ac_moc2;
319 fi
320 else
321 if test -n "$ac_moc1"; then
322 ac_moc=$ac_moc1;
323 else
324 ac_moc=$ac_moc2;
325 fi
326 fi
327
328 if test -z "$ac_moc" -a "$FATAL" = 1; then
329 AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !])
330 fi
331])
332
333dnl check a particular libname
334AC_DEFUN([QT_TRY_LINK],
335[
336 SAVE_LIBS="$LIBS"
337 LIBS="$LIBS $1"
338 AC_TRY_LINK([
339 #include <qglobal.h>
340 #include <qstring.h>
341 ],
342 [
343 QString s("mangle_failure");
344 #if (QT_VERSION < 221)
345 break_me_(\\\);
346 #endif
347 ],
348 qt_cv_libname=$1,
349 )
350 LIBS="$SAVE_LIBS"
351])
352
353dnl check we can do a compile
354AC_DEFUN([QT_CHECK_COMPILE],
355[
356 AC_MSG_CHECKING([for Qt library name])
357
358 AC_CACHE_VAL(qt_cv_libname,
359 [
360 AC_LANG_CPLUSPLUS
361 SAVE_CXXFLAGS=$CXXFLAGS
362 CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS"
363
364 for libname in -lqt-mt -lqt3 -lqt2 -lqt;
365 do
366 QT_TRY_LINK($libname)
367 if test -n "$qt_cv_libname"; then
368 break;
369 fi
370 done
371
372 CXXFLAGS=$SAVE_CXXFLAGS
373 ])
374
375 if test -z "$qt_cv_libname"; then
376 AC_MSG_RESULT([failed])
377 if test "$FATAL" = 1 ; then
378 AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !])
379 fi
380 else
381 AC_MSG_RESULT([$qt_cv_libname])
382 fi
383])
384
385dnl get Qt version we're using
386AC_DEFUN([QT_GET_VERSION],
387[
388 AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
389 [
390 AC_LANG_CPLUSPLUS
391 SAVE_CPPFLAGS=$CPPFLAGS
392 CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
393
394 cat > conftest.$ac_ext <<EOF
395#line __oline__ "configure"
396#include "confdefs.h"
397#include <qglobal.h>
398"%%%"QT_VERSION_STR"%%%"
399EOF
400 lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
401 grep '^"%%%"' 2>/dev/null | \
402 sed -e 's/"%%%"//g' -e 's/"//g'`
403 rm -f conftest.$ac_ext
404 CPPFLAGS=$SAVE_CPPFLAGS
405 ])
406
407 QT_VERSION=$lyx_cv_qtversion
408 AC_SUBST(QT_VERSION)
409])
410
411dnl start here
412AC_DEFUN([QT_DO_IT_ALL],
413[
414 dnl Please leave this alone. I use this file in
415 dnl oprofile.
416 FATAL=0
417
418 AC_ARG_WITH(qt-dir, [ --with-qt-dir where the root of Qt is installed ],
419 [ qt_cv_dir=`eval echo "$withval"/` ])
420
421 AC_ARG_WITH(qt-includes, [ --with-qt-includes where the Qt includes are. ],
422 [ qt_cv_includes=`eval echo "$withval"` ])
423
424 AC_ARG_WITH(qt-libraries, [ --with-qt-libraries where the Qt library is installed.],
425 [ qt_cv_libraries=`eval echo "$withval"` ])
426
427 dnl pay attention to $QTDIR unless overridden
428 if test -z "$qt_cv_dir"; then
429 qt_cv_dir=$QTDIR
430 fi
431
432 dnl derive inc/lib if needed
433 if test -n "$qt_cv_dir"; then
434 if test -z "$qt_cv_includes"; then
435 qt_cv_includes=$qt_cv_dir/include
436 fi
437 if test -z "$qt_cv_libraries"; then
438 qt_cv_libraries=$qt_cv_dir/lib
439 fi
440 fi
441
442 dnl flags for compilation
443 QT_INCLUDES=
444 QT_LDFLAGS=
445 if test -n "$qt_cv_includes"; then
446 QT_INCLUDES="-I$qt_cv_includes"
447 fi
448 if test -n "$qt_cv_libraries"; then
449 QT_LDFLAGS="-L$qt_cv_libraries"
450 fi
451 AC_SUBST(QT_INCLUDES)
452 AC_SUBST(QT_LDFLAGS)
453
454 QT_FIND_MOC
455 MOC=$ac_moc
456 AC_SUBST(MOC)
457 QT_FIND_UIC
458 UIC=$ac_uic
459 AC_SUBST(UIC)
460
461 QT_CHECK_COMPILE
462
463 QT_LIB=$qt_cv_libname;
464 AC_SUBST(QT_LIB)
465
466 if test -n "$qt_cv_libname"; then
467 QT_GET_VERSION
468 fi
469])
470
471dnl AX_CXXFLAGS_OPTIONS(var-name, option)
472dnl add option to var-name if $CXX support it.
473AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
474AC_MSG_CHECKING([whether ${CXX} support precompiled header])
475AC_LANG_SAVE
476AC_LANG_CPLUSPLUS
477SAVE_CXXFLAGS=$CXXFLAGS
478dnl we consider than if -Winvalid-pch is accepted pch will works ...
479CXXFLAGS=-Winvalid-pch
480dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
481dnl the fact than some pch will be invalid for the given compilation option
482AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
483CXXFLAGS=$SAVE_CXXFLAGS
484AC_LANG_RESTORE
485])
486
487dnl AX_CHECK_DOCBOOK
488AC_DEFUN([AX_CHECK_DOCBOOK], [
489# It's just rude to go over the net to build
490XSLTPROC_FLAGS=--nonet
491DOCBOOK_ROOT=
492if test ! -f /etc/xml/catalog; then
493 for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
494 do
495 if test -d "$i"; then
496 DOCBOOK_ROOT=$i
497 fi
498 done
499
500 # Last resort - try net
501 if test -z "$DOCBOOK_ROOT"; then
502 XSLTPROC_FLAGS=
503 fi
504else
505 XML_CATALOG=/etc/xml/catalog
506 CAT_ENTRY_START='<!--'
507 CAT_ENTRY_END='-->'
508fi
509
510AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
511XSLTPROC_WORKS=no
512if test -n "$XSLTPROC"; then
513 AC_MSG_CHECKING([whether xsltproc works])
514
515 if test -n "$XML_CATALOG"; then
516 DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
517 else
518 DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
519 fi
520
521 $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
522<?xml version="1.0" encoding='ISO-8859-1'?>
523<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
524<book id="test">
525</book>
526END
527 if test "$?" = 0; then
528 XSLTPROC_WORKS=yes
529 fi
530 AC_MSG_RESULT($XSLTPROC_WORKS)
531fi
532AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")
533
534AC_SUBST(XML_CATALOG)
535AC_SUBST(XSLTPROC_FLAGS)
536AC_SUBST(DOCBOOK_ROOT)
537AC_SUBST(CAT_ENTRY_START)
538AC_SUBST(CAT_ENTRY_END)
539])
540
541dnl AX_CFLAGS_OPTIONS(var-name, option)
542dnl add option to var-name if $CC support it.
543AC_DEFUN([AX_CFLAGS_OPTION], [
544AC_MSG_CHECKING([whether ${CC} $2 is understood])
545AC_LANG_SAVE
546AC_LANG_C
547SAVE_CFLAGS=$CFLAGS
548CFLAGS=$2
549AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
550CFLAGS=$SAVE_CFLAGS
551AC_LANG_RESTORE
552])
553
554
555dnl AX_CXXFLAGS_OPTIONS(var-name, option)
556dnl add option to var-name if $CXX support it.
557AC_DEFUN([AX_CXXFLAGS_OPTION], [
558AC_MSG_CHECKING([whether ${CXX} $2 is understood])
559AC_LANG_SAVE
560AC_LANG_CPLUSPLUS
561SAVE_CXXFLAGS=$CXXFLAGS
562CXXFLAGS=$2
563AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
564CXXFLAGS=$SAVE_CXXFLAGS
565AC_LANG_RESTORE
566])
567
568dnl AX_COPY_IF_CHANGE(source, dest)
569dnl copy source to dest if they don't compare equally or if dest doesn't exist
570AC_DEFUN([AX_COPY_IF_CHANGE], [
571if test -r $2; then
572 if cmp $1 $2 > /dev/null; then
573 echo $2 is unchanged
574 else
575 cp -f $1 $2
576 fi
577else
578 cp -f $1 $2
579fi
580])
581
diff --git a/meta/recipes-kernel/oprofile/oprofile/oprofile-no-query-modules.patch b/meta/recipes-kernel/oprofile/oprofile/oprofile-no-query-modules.patch
new file mode 100644
index 0000000000..c9d7cd63e7
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/oprofile-no-query-modules.patch
@@ -0,0 +1,29 @@
1disable portions which use query_module on 2.6 kernel this is not available
2in OE we dont support 2.4 anyway
3
4
5Upstream-Status: Pending
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Index: oprofile-0.9.6/daemon/liblegacy/opd_kernel.c
9===================================================================
10--- oprofile-0.9.6.orig/daemon/liblegacy/opd_kernel.c 2009-11-24 07:25:17.000000000 -0800
11+++ oprofile-0.9.6/daemon/liblegacy/opd_kernel.c 2011-07-18 10:08:39.863798825 -0700
12@@ -270,6 +270,9 @@
13 */
14 static void opd_drop_module_sample(unsigned long eip)
15 {
16+ verbprintf(vmodule, "query_module not available on linux-2.6: %s\n", strerror(EPERM));
17+
18+#if 0
19 char * module_names;
20 char * name;
21 size_t size = 1024;
22@@ -307,6 +310,7 @@
23
24 if (module_names)
25 free(module_names);
26+#endif
27 }
28
29
diff --git a/meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch b/meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch
new file mode 100644
index 0000000000..f3fe4c9cb3
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch
@@ -0,0 +1,113 @@
1Change hardcoded /root to /home/root
2
3Upstream-Status: inappropriate [OE specific]
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7Replace "/home/root" with stub "ROOTHOME", then substitute it with
8real root home directory which is configured dymanically.
9
10Signed-off-by: Kang Kai <kai.kang@windriver.com>
11
12diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.in
13--- oprofile-0.9.7.orig/doc/opcontrol.1.in 2011-07-04 21:25:04.000000000 -0500
14+++ oprofile-0.9.7/doc/opcontrol.1.in 2012-07-02 14:02:16.358865420 -0500
15@@ -171,7 +171,7 @@
16
17 .SH FILES
18 .TP
19-.I /root/.oprofile/daemonrc
20+.I ROOTHOME/.oprofile/daemonrc
21 Configuration file for opcontrol
22 .TP
23 .I /var/lib/oprofile/samples/
24diff -ur oprofile-0.9.7.orig/doc/oprofile.1 oprofile-0.9.7/doc/oprofile.1
25--- oprofile-0.9.7.orig/doc/oprofile.1 2011-08-12 10:23:27.000000000 -0500
26+++ oprofile-0.9.7/doc/oprofile.1 2012-07-02 14:02:29.295862358 -0500
27@@ -150,7 +150,7 @@
28 .I $HOME/.oprofile/
29 Configuration files
30 .TP
31-.I /root/.oprofile/daemonrc
32+.I ROOTHOME/.oprofile/daemonrc
33 Configuration file for opcontrol
34 .TP
35 .I /opt/oprofile-0.9.7-rc3/share/oprofile/
36diff -ur oprofile-0.9.7.orig/doc/oprofile.1.in oprofile-0.9.7/doc/oprofile.1.in
37--- oprofile-0.9.7.orig/doc/oprofile.1.in 2011-07-04 21:25:04.000000000 -0500
38+++ oprofile-0.9.7/doc/oprofile.1.in 2012-07-02 14:01:35.812004623 -0500
39@@ -150,7 +150,7 @@
40 .I $HOME/.oprofile/
41 Configuration files
42 .TP
43-.I /root/.oprofile/daemonrc
44+.I ROOTHOME/.oprofile/daemonrc
45 Configuration file for opcontrol
46 .TP
47 .I @prefix@/share/oprofile/
48diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html
49--- oprofile-0.9.7.orig/doc/oprofile.html 2011-07-04 21:32:35.000000000 -0500
50+++ oprofile-0.9.7/doc/oprofile.html 2012-07-02 14:04:59.804018961 -0500
51@@ -1394,7 +1394,7 @@
52 <dd>
53 <p>
54 Followed by list arguments for profiling set up. List of arguments
55- saved in <code class="filename">/root/.oprofile/daemonrc</code>.
56+ saved in <code class="filename">ROOTHOME/.oprofile/daemonrc</code>.
57 Giving this option is not necessary; you can just directly pass one
58 of the setup options, e.g. <span class="command"><strong>opcontrol --no-vmlinux</strong></span>.
59 </p>
60@@ -1430,7 +1430,7 @@
61 <dd>
62 <p>
63 Start data collection with either arguments provided by <code class="option">--setup</code>
64- or information saved in <code class="filename">/root/.oprofile/daemonrc</code>. Specifying
65+ or information saved in <code class="filename">ROOTHOME/.oprofile/daemonrc</code>. Specifying
66 the addition <code class="option">--verbose</code> makes the daemon generate lots of debug data
67 whilst it is running.
68 </p>
69diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml
70--- oprofile-0.9.7.orig/doc/oprofile.xml 2011-07-04 21:25:04.000000000 -0500
71+++ oprofile-0.9.7/doc/oprofile.xml 2012-07-02 14:02:03.543019283 -0500
72@@ -568,7 +568,7 @@
73 <term><option>--setup</option></term>
74 <listitem><para>
75 Followed by list arguments for profiling set up. List of arguments
76- saved in <filename>/root/.oprofile/daemonrc</filename>.
77+ saved in <filename>ROOTHOME/.oprofile/daemonrc</filename>.
78 Giving this option is not necessary; you can just directly pass one
79 of the setup options, e.g. <command>opcontrol --no-vmlinux</command>.
80 </para></listitem>
81@@ -592,7 +592,7 @@
82 <term><option>--start</option></term>
83 <listitem><para>
84 Start data collection with either arguments provided by <option>--setup</option>
85- or information saved in <filename>/root/.oprofile/daemonrc</filename>. Specifying
86+ or information saved in <filename>ROOTHOME/.oprofile/daemonrc</filename>. Specifying
87 the addition <option>--verbose</option> makes the daemon generate lots of debug data
88 whilst it is running.
89 </para></listitem>
90diff -ur oprofile-0.9.7.orig/gui/oprof_start_util.cpp oprofile-0.9.7/gui/oprof_start_util.cpp
91--- oprofile-0.9.7.orig/gui/oprof_start_util.cpp 2011-07-04 21:25:04.000000000 -0500
92+++ oprofile-0.9.7/gui/oprof_start_util.cpp 2012-07-02 13:55:21.041876096 -0500
93@@ -39,7 +39,7 @@
94 // return the ~ expansion suffixed with a '/'
95 string const get_config_dir()
96 {
97- return "/root";
98+ return "ROOTHOME";
99 }
100
101 string daemon_pid;
102diff -ur oprofile-0.9.7.orig/utils/opcontrol oprofile-0.9.7/utils/opcontrol
103--- oprofile-0.9.7.orig/utils/opcontrol 2011-07-20 14:36:48.000000000 -0500
104+++ oprofile-0.9.7/utils/opcontrol 2012-07-02 13:55:06.232872688 -0500
105@@ -384,7 +384,7 @@
106 OPROFILED="$OPDIR/oprofiled"
107
108 # location for daemon setup information
109- SETUP_DIR="/root/.oprofile"
110+ SETUP_DIR="ROOTHOME/.oprofile"
111 SETUP_FILE="$SETUP_DIR/daemonrc"
112 SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new"
113
diff --git a/meta/recipes-kernel/oprofile/oprofile/opstart.patch b/meta/recipes-kernel/oprofile/oprofile/opstart.patch
new file mode 100644
index 0000000000..8696f4ef4d
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/opstart.patch
@@ -0,0 +1,245 @@
1Upstream-Status: Pending
2
3The patch gives a low overhead way of starting/stopping oprofile which
4doesn't involve script exection.
5
6(written by RP in OpenedHand days)
7
8diff --git a/utils/Makefile.am b/utils/Makefile.am
9index d34b060..dff15f9 100644
10--- oprofile.orig/utils/Makefile.am
11+++ oprofile/utils/Makefile.am
12@@ -7,7 +7,7 @@ AM_LDFLAGS = @OP_LDFLAGS@
13
14 LIBS=@POPT_LIBS@ @LIBERTY_LIBS@
15
16-bin_PROGRAMS = ophelp op-check-perfevents
17+bin_PROGRAMS = ophelp op-check-perfevents opstart
18 dist_bin_SCRIPTS = opcontrol
19
20 op_check_perfevents_SOURCES = op_perf_events_checker.c
21@@ -15,3 +15,10 @@ op_check_perfevents_CPPFLAGS = ${AM_CFLAGS} @PERF_EVENT_FLAGS@
22
23 ophelp_SOURCES = ophelp.c
24 ophelp_LDADD = ../libop/libop.a ../libutil/libutil.a
25+
26+opstart_SOURCES = opstart.c
27+
28+install-exec-local:
29+ cd $(DESTDIR)/$(bindir) && \
30+ rm -f opstop && \
31+ $(LN_S) opstart opstop
32Index: oprofile/utils/opstart.c
33===================================================================
34--- /dev/null 1970-01-01 00:00:00.000000000 +0000
35+++ oprofile/utils/opstart.c 2008-07-02 15:14:07.000000000 +0100
36@@ -0,0 +1,110 @@
37+/**
38+ * @file opstart.c
39+ * Start/Stop oprofile
40+ *
41+ * @remark Copyright 2007 Openedhand Ltd.
42+ * @remark Read the file COPYING
43+ *
44+ * @author Richard Purdie
45+ */
46+
47+#include <signal.h>
48+#include <stdio.h>
49+#include <stdlib.h>
50+#include <string.h>
51+#include <unistd.h>
52+#include <sys/types.h>
53+#include <sys/stat.h>
54+
55+int main(const int argc, const char* argv[])
56+{
57+ const char *enable = "/dev/oprofile/enable";
58+ const char *lockfile;
59+ unsigned long dpid;
60+ struct stat sbuf;
61+ FILE *lfile, *efile;
62+ int sig, enb, err;
63+
64+ if (argc >= 2) {
65+ printf("Error: Invalid options.\n");
66+ return 1;
67+ }
68+
69+ lockfile = getenv("LOCK_FILE");
70+ if (!lockfile)
71+ lockfile = "/var/lib/oprofile/lock";
72+
73+ /* Add SESSION_DIR support? */
74+
75+ if (geteuid()) {
76+ printf("Error: This program must be run as root.\n");
77+ return 1;
78+ }
79+
80+ if (stat(enable, &sbuf)) {
81+ printf("Error: Could not find /dev/oprofile/enable, the"
82+ " kernel module probably isn't loaded.\n");
83+ printf("This binary only works with 2.6 kernels and oprofile"
84+ " must have been initialised with 'opcontrol --start-daemon'.\n");
85+ return 1;
86+ }
87+
88+ if (stat(lockfile, &sbuf)) {
89+ printf("Error: Could not find lockfile %s.\n", lockfile);
90+ printf("The oprofile daemon must be running (oprofile must"
91+ " have been initialised with 'opcontrol --start-daemon').\n");
92+ return 1;
93+ }
94+
95+ lfile = fopen(lockfile, "r");
96+ if (!lfile) {
97+ printf("Error opening lockfile %s.\n", lockfile);
98+ return 1;
99+ }
100+
101+ err = fscanf(lfile, "%lud", (unsigned long *) &dpid);
102+ if (err != 1) {
103+ printf("Error reading pid from lockfile %s.\n", lockfile);
104+ return 1;
105+ }
106+ fclose(lfile);
107+
108+ efile = fopen(enable, "r");
109+ if (!efile) {
110+ printf("Error opening %s.\n", enable);
111+ return 1;
112+ }
113+
114+ if (strstr(argv[0], "opstart")) {
115+ printf("Starting Profiler\n");
116+ sig = SIGUSR1;
117+ enb = 1;
118+ } else if (strstr(argv[0], "opstop")) {
119+ printf("Stopping Oprofile.\n");
120+ printf("You need to run 'opcontrol --dump' when the session"
121+ " is finished.\n");
122+ sig = SIGUSR2;
123+ enb = 0;
124+ } else {
125+ printf("Error: Please call as 'opstart' or 'opstop'\n");
126+ return 1;
127+ }
128+
129+ err = kill(dpid, 0);
130+ if (err) {
131+ printf("Error sending signal to oprofiled. Stale lockfile"
132+ " (%s) ?\n", lockfile);
133+ return 1;
134+ }
135+
136+ fprintf(efile, "%d\n", enb);
137+ err = kill(dpid, sig);
138+ if (err) {
139+ printf("Error sending signal to oprofiled. Stale lockfile"
140+ " (%s) ?\n", lockfile);
141+ return 1;
142+ }
143+
144+ return 0;
145+}
146+
147Index: oprofile/configure.ac
148===================================================================
149--- oprofile.orig/configure.ac 2008-07-02 15:13:58.000000000 +0100
150+++ oprofile/configure.ac 2008-07-02 15:17:37.000000000 +0100
151@@ -16,6 +16,7 @@
152 AM_CONFIG_HEADER(config.h)
153
154 AC_PROG_RANLIB
155+AC_PROG_LN_S
156 AC_PROG_LIBTOOL
157
158 dnl for the man page
159@@ -241,6 +242,8 @@
160 doc/xsl/catalog-1.xml \
161 doc/oprofile.1 \
162 doc/opcontrol.1 \
163+ doc/opstart.1 \
164+ doc/opstop.1 \
165 doc/ophelp.1 \
166 doc/opreport.1 \
167 doc/opannotate.1 \
168Index: oprofile/doc/Makefile.am
169===================================================================
170--- oprofile.orig/doc/Makefile.am 2008-07-02 15:13:59.000000000 +0100
171+++ oprofile/doc/Makefile.am 2008-07-02 15:14:07.000000000 +0100
172@@ -11,6 +11,8 @@
173 man_MANS = \
174 oprofile.1 \
175 opcontrol.1 \
176+ opstart.1 \
177+ opstop.1 \
178 opreport.1 \
179 opannotate.1 \
180 opgprof.1 \
181Index: oprofile/doc/opstart.1.in
182===================================================================
183--- /dev/null 1970-01-01 00:00:00.000000000 +0000
184+++ oprofile/doc/opstart.1.in 2008-07-02 15:14:07.000000000 +0100
185@@ -0,0 +1,27 @@
186+.TH OPSTART 1 "@DATE@" "oprofile @VERSION@"
187+.UC 4
188+.SH NAME
189+opstart \- start OProfile profiling
190+.SH SYNOPSIS
191+.br
192+.B opstart
193+.SH DESCRIPTION
194+.B opstart
195+is a simple optimised command to start profiling with 2.6 Linux kernels.
196+OProfile should have already been initialised by calling "opcontrol --start-daemon".
197+
198+.SH ENVIRONMENT
199+No special environment variables are recognised by opstart.
200+
201+.SH FILES
202+.TP
203+.I /var/lib/oprofile/samples/
204+The location of the generated sample files.
205+
206+.SH VERSION
207+.TP
208+This man page is current for @PACKAGE@-@VERSION@.
209+
210+.SH SEE ALSO
211+.BR @OP_DOCDIR@,
212+.BR oprofile(1)
213Index: oprofile/doc/opstop.1.in
214===================================================================
215--- /dev/null 1970-01-01 00:00:00.000000000 +0000
216+++ oprofile/doc/opstop.1.in 2008-07-02 15:14:07.000000000 +0100
217@@ -0,0 +1,28 @@
218+.TH OPSTOP 1 "@DATE@" "oprofile @VERSION@"
219+.UC 4
220+.SH NAME
221+opstop \- stop OProfile profiling
222+.SH SYNOPSIS
223+.br
224+.B opstop
225+.SH DESCRIPTION
226+.B opstop
227+is a simple optimsed command to stop profiling with 2.6 Linux kernels.
228+You need to run "opcontrol --dump" before being able to view a profile
229+with opreport.
230+
231+.SH ENVIRONMENT
232+No special environment variables are recognised by opstop.
233+
234+.SH FILES
235+.TP
236+.I /var/lib/oprofile/samples/
237+The location of the generated sample files.
238+
239+.SH VERSION
240+.TP
241+This man page is current for @PACKAGE@-@VERSION@.
242+
243+.SH SEE ALSO
244+.BR @OP_DOCDIR@,
245+.BR oprofile(1)
diff --git a/meta/recipes-kernel/oprofile/oprofile_0.9.8.bb b/meta/recipes-kernel/oprofile/oprofile_0.9.8.bb
new file mode 100644
index 0000000000..e8329cd79c
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile_0.9.8.bb
@@ -0,0 +1,22 @@
1require oprofile.inc
2
3PR = "${INC_PR}.3"
4
5DEPENDS += "virtual/kernel"
6DEPENDS_append_powerpc64 = " libpfm4"
7
8SRC_URI += "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
9 file://0001-Add-rmb-definition-for-AArch64-architecture.patch \
10 file://0001-OProfile-doesn-t-build-for-32-bit-ppc-the-operf_util.patch \
11 file://0001-Handle-early-perf_events-kernel-without-PERF_RECORD_.patch \
12 file://0001-Fix-up-configure-to-handle-architectures-that-do-not.patch \
13 file://0001-Change-configure-to-look-for-libpfm4-function-first-.patch \
14 file://0001-ophelp-lists-events-Fix-doc-URL-for-ppc64-arch.patch \
15 file://0001-Allow-ppc64-events-to-be-specified-with-or-without-_.patch \
16 file://0001-Fix-PPC64-specific-libpfm-usage-so-it-doesn-t-break-.patch"
17
18SRC_URI[md5sum] = "6d127023af1dd1cf24e15411229f3cc8"
19SRC_URI[sha256sum] = "ab45900fa1a23e5d5badf3c0a55f26c17efe6e184efcf00b371433751fa761bc"
20
21S = "${WORKDIR}/oprofile-${PV}"
22
diff --git a/meta/recipes-kernel/oprofile/oprofile_git.bb b/meta/recipes-kernel/oprofile/oprofile_git.bb
new file mode 100644
index 0000000000..ca562db121
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile_git.bb
@@ -0,0 +1,11 @@
1require oprofile.inc
2
3SRCREV = "88f43190d412d28ebf5c75a76ba20343d0fe4c41"
4PV = "0.9.7+git${SRCPV}"
5PR = "${INC_PR}.0"
6
7SRC_URI += "git://oprofile.git.sourceforge.net/gitroot/${BPN}/${BPN}"
8
9S = "${WORKDIR}/git"
10
11DEFAULT_PREFERENCE = "-1"
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server/init b/meta/recipes-kernel/oprofile/oprofileui-server/init
new file mode 100755
index 0000000000..2544ea4ac0
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server/init
@@ -0,0 +1,37 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: oprofile-server
4# Required-Start: $network
5# Required-Stop: $network
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: OProfileUI server
9# Description:
10### END INIT INFO
11
12. /etc/init.d/functions
13
14case "$1" in
15 start)
16 echo "Starting OProfileUI server"
17 . /etc/profile
18 /usr/bin/oprofile-server &
19 ;;
20
21 stop)
22 echo "Stopping OProfileUI server"
23 killproc oprofile-server
24 ;;
25
26 restart)
27 $0 stop
28 sleep 1
29 $0 start
30 ;;
31
32 *)
33 echo "usage: $0 { start | stop | restart }"
34 ;;
35esac
36
37exit 0
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service b/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
new file mode 100644
index 0000000000..1a2cbe62ea
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
@@ -0,0 +1,6 @@
1[Unit]
2Description=OProfileUI Server
3After=network.target
4
5[Service]
6ExecStart=/bin/sh -c ". @SYSCONFDIR@/profile; @BINDIR@/oprofile-server"
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server_git.bb b/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
new file mode 100644
index 0000000000..dbb559965a
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
@@ -0,0 +1,32 @@
1require oprofileui.inc
2
3SRCREV = "f168b8bfdc63660033de1739c6ddad1abd97c379"
4PV = "0.0+git${SRCPV}"
5
6S = "${WORKDIR}/git"
7
8SRC_URI = "git://git.yoctoproject.org/oprofileui \
9 file://init \
10 file://oprofileui-server.service "
11
12EXTRA_OECONF += "--disable-client --enable-server"
13
14RDEPENDS_${PN} = "oprofile"
15
16do_install_append() {
17 install -d ${D}${sysconfdir}/init.d
18 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/oprofileui-server
19
20 install -d ${D}${systemd_unitdir}/system
21 install -m 0644 ${WORKDIR}/oprofileui-server.service ${D}${systemd_unitdir}/system/
22 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
23 -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/oprofileui-server.service
24}
25
26inherit update-rc.d systemd
27
28INITSCRIPT_NAME = "oprofileui-server"
29INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
30
31SYSTEMD_SERVICE_${PN} = "oprofileui-server.service"
32SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta/recipes-kernel/oprofile/oprofileui.inc b/meta/recipes-kernel/oprofile/oprofileui.inc
new file mode 100644
index 0000000000..6d59e47213
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui.inc
@@ -0,0 +1,16 @@
1SUMMARY = "User Interface for the System-Wide Profiler"
2DESCRIPTION = "User interface for the OProfile tool"
3HOMEPAGE = "http://labs.o-hand.com/oprofileui/"
4BUGTRACKER = "http://bugzilla.yoctoproject.org/"
5
6SECTION = "x11"
7
8LICENSE = "GPLv2"
9LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
10
11DEPENDS = "glib-2.0 avahi"
12
13inherit autotools pkgconfig
14
15EXTRA_OECONF = "--with-avahi"
16
diff --git a/meta/recipes-kernel/oprofile/oprofileui_git.bb b/meta/recipes-kernel/oprofile/oprofileui_git.bb
new file mode 100644
index 0000000000..316c61a696
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui_git.bb
@@ -0,0 +1,17 @@
1require oprofileui.inc
2
3DEPENDS += "gtk+ libglade libxml2 avahi-ui gconf"
4
5SRCREV = "f168b8bfdc63660033de1739c6ddad1abd97c379"
6PV = "0.0+git${SRCPV}"
7
8S = "${WORKDIR}/git"
9
10SRC_URI = "git://git.yoctoproject.org/oprofileui"
11
12EXTRA_OECONF += "--enable-client --disable-server"
13
14PACKAGES =+ "oprofileui-viewer"
15
16FILES_oprofileui-viewer = "${bindir}/oparchconv ${bindir}/oprofile-viewer ${datadir}/applications/ ${datadir}/oprofileui/ ${datadir}/icons"
17RDEPENDS_oprofileui-viewer = "oprofile"
diff --git a/meta/recipes-kernel/perf/perf-features.inc b/meta/recipes-kernel/perf/perf-features.inc
new file mode 100644
index 0000000000..b8859ab7d5
--- /dev/null
+++ b/meta/recipes-kernel/perf/perf-features.inc
@@ -0,0 +1,22 @@
1PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui"
2
3def perf_feature_enabled(feature, trueval, falseval, d):
4 """
5 Check which perf features are enabled.
6
7 The PERF_FEATURES_ENABLE variable lists the perf features to
8 enable. Override it if you want something different from what's
9 listed above, which is the default. If empty, the build won't
10 enable any features (which may be exactly what you want, just a
11 barebones perf without any extra baggage, what you get if you
12 specify an empty feature list).
13
14 Available perf features:
15 perf-scripting: enable support for Perl and Python bindings
16 perf-tui: enable support for the perf TUI (via libnewt)
17
18 """
19 enabled_features = d.getVar("PERF_FEATURES_ENABLE", True) or ""
20 if feature in enabled_features:
21 return trueval
22 return falseval
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
new file mode 100644
index 0000000000..ef21b6c9c2
--- /dev/null
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -0,0 +1,160 @@
1SUMMARY = "Performance analysis tools for Linux"
2DESCRIPTION = "Performance counters for Linux are a new kernel-based \
3subsystem that provide a framework for all things \
4performance analysis. It covers hardware level \
5(CPU/PMU, Performance Monitoring Unit) features \
6and software features (software counters, tracepoints) \
7as well."
8
9LICENSE = "GPLv2"
10LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
11
12PR = "r8"
13
14require perf-features.inc
15
16BUILDPERF_libc-uclibc = "no"
17
18TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt', '',d)}"
19SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}"
20
21DEPENDS = "virtual/kernel \
22 virtual/${MLPREFIX}libc \
23 ${MLPREFIX}elfutils \
24 ${MLPREFIX}binutils \
25 ${TUI_DEPENDS} \
26 ${SCRIPTING_DEPENDS} \
27 bison flex \
28 "
29
30SCRIPTING_RDEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl perl-modules python', '',d)}"
31RDEPENDS_${PN} += "elfutils bash ${SCRIPTING_RDEPENDS}"
32
33PROVIDES = "virtual/perf"
34
35inherit linux-kernel-base kernel-arch pythonnative
36
37# needed for building the tools/perf Python bindings
38inherit python-dir
39export STAGING_INCDIR
40export STAGING_LIBDIR
41export BUILD_SYS
42export HOST_SYS
43
44#kernel 3.1+ supports WERROR to disable warnings as errors
45export WERROR = "0"
46
47do_populate_lic[depends] += "virtual/kernel:do_populate_sysroot"
48
49# needed for building the tools/perf Perl binding
50inherit perlnative cpan-base
51# Env var which tells perl if it should use host (no) or target (yes) settings
52export PERLCONFIGTARGET = "${@is_target(d)}"
53export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
54export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
55export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
56
57S = "${STAGING_KERNEL_DIR}"
58# The source should be ready after the do_unpack
59do_unpack[depends] += "virtual/kernel:do_populate_sysroot"
60
61B = "${WORKDIR}/${BPN}-${PV}"
62
63SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
64TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
65
66# The LDFLAGS is required or some old kernels fails due missing
67# symbols and this is preferred than requiring patches to every old
68# supported kernel.
69LDFLAGS="-ldl -lutil"
70
71EXTRA_OEMAKE = \
72 '-C ${S}/tools/perf \
73 O=${B} \
74 CROSS_COMPILE=${TARGET_PREFIX} \
75 ARCH=${ARCH} \
76 CC="${CC}" \
77 AR="${AR}" \
78 perfexecdir=${libexecdir} \
79 NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${SCRIPTING_DEFINES} \
80 '
81
82EXTRA_OEMAKE += "\
83 'prefix=${prefix}' \
84 'bindir=${bindir}' \
85 'sharedir=${datadir}' \
86 'sysconfdir=${sysconfdir}' \
87 'perfexecdir=${libexecdir}/perf-core' \
88 \
89 'ETC_PERFCONFIG=${@os.path.relpath(sysconfdir, prefix)}' \
90 'sharedir=${@os.path.relpath(datadir, prefix)}' \
91 'mandir=${@os.path.relpath(mandir, prefix)}' \
92 'infodir=${@os.path.relpath(infodir, prefix)}' \
93"
94
95# PPC64 uses long long for u64 in the kernel, but powerpc's asm/types.h
96# prevents 64-bit userland from seeing this definition, instead defaulting
97# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get
98# int-ll64.h included. And MIPS64 has the same issue.
99EXTRA_OEMAKE_append_powerpc64 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
100EXTRA_OEMAKE_append_mips64 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
101
102PARALLEL_MAKE = ""
103
104do_compile() {
105 # Linux kernel build system is expected to do the right thing
106 unset CFLAGS
107 oe_runmake all
108}
109
110do_install() {
111 # Linux kernel build system is expected to do the right thing
112 unset CFLAGS
113 oe_runmake DESTDIR=${D} install
114 # we are checking for this make target to be compatible with older perf versions
115 if [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" -a $(grep install-python_ext ${S}/tools/perf/Makefile) = "0"]; then
116 oe_runmake DESTDIR=${D} install-python_ext
117 fi
118}
119
120do_configure_prepend () {
121 #kernels before 3.1 do not support WERROR env variable
122 sed -i 's,-Werror ,,' ${S}/tools/perf/Makefile
123 if [ -e "${S}/tools/perf/config/Makefile" ]; then
124 sed -i 's,-Werror ,,' ${S}/tools/perf/config/Makefile
125 fi
126
127 # If building a multlib based perf, the incorrect library path will be
128 # detected by perf, since it triggers via: ifeq ($(ARCH),x86_64). In a 32 bit
129 # build, with a 64 bit multilib, the arch won't match and the detection of a
130 # 64 bit build (and library) are not exected. To ensure that libraries are
131 # installed to the correct location, we can make the substitution in the
132 # config/Makefile. For non multilib builds, this has no impact.
133 if [ -e "${S}/tools/perf/config/Makefile" ]; then
134 sed -i 's,libdir = $(prefix)/$(lib),libdir = $(prefix)/${baselib},' ${S}/tools/perf/config/Makefile
135 fi
136 # We need to ensure the --sysroot option in CC is preserved
137 if [ -e "${S}/tools/perf/Makefile.perf" ]; then
138 sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf
139 sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf
140 fi
141 if [ -e "${S}/tools/lib/api/Makefile" ]; then
142 sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile
143 sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/api/Makefile
144 fi
145 if [ -e "${S}/tools/perf/config/feature-checks/Makefile" ]; then
146 sed -i 's,CC := $(CROSS_COMPILE)gcc -MD,CC += -MD,' ${S}/tools/perf/config/feature-checks/Makefile
147 fi
148}
149
150python do_package_prepend() {
151 bb.data.setVar('PKGV', get_kernelversion('${S}').split("-")[0], d)
152}
153
154PACKAGE_ARCH = "${MACHINE_ARCH}"
155
156FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent"
157FILES_${PN}-dbg += "${libdir}/python*/site-packages/.debug"
158FILES_${PN} += "${libdir}/python*/site-packages"
159
160INHIBIT_PACKAGE_DEBUG_SPLIT="1"
diff --git a/meta/recipes-kernel/powertop/powertop_2.5.bb b/meta/recipes-kernel/powertop/powertop_2.5.bb
new file mode 100644
index 0000000000..f37d7a76e0
--- /dev/null
+++ b/meta/recipes-kernel/powertop/powertop_2.5.bb
@@ -0,0 +1,30 @@
1SUMMARY = "Power usage tool"
2DESCRIPTION = "Linux tool to diagnose issues with power consumption and power management."
3HOMEPAGE = "http://01.org/powertop/"
4BUGTRACKER = "http://bugzilla.lesswatts.org/"
5DEPENDS = "ncurses libnl pciutils"
6LICENSE = "GPLv2"
7LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
8
9SRC_URI = "http://01.org/powertop/sites/default/files/downloads/powertop-${PV}.tar.gz"
10
11SRC_URI[md5sum] = "806bbcbd44fcea1f807c9582fc1f7d3e"
12SRC_URI[sha256sum] = "8b2c08a555d79e1c428863470c41cb023971d74ba4801d80a05e35adeec23c0b"
13
14inherit autotools gettext
15
16# we need to explicitly link with libintl in uClibc systems
17LDFLAGS += "${EXTRA_LDFLAGS}"
18EXTRA_LDFLAGS_libc-uclibc = "-lintl"
19
20# we do not want libncursesw if we can
21do_configure_prepend() {
22 # configure.ac checks for delwin() in "ncursesw ncurses" so let's drop first one
23 sed -i -e "s/ncursesw//g" ${S}/configure.ac
24}
25
26inherit update-alternatives
27ALTERNATIVE_${PN} = "powertop"
28ALTERNATIVE_TARGET[powertop] = "${sbindir}/powertop"
29ALTERNATIVE_LINK_NAME[powertop] = "${sbindir}/powertop"
30ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch b/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
new file mode 100644
index 0000000000..dcc2cbe67c
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
@@ -0,0 +1,22 @@
1On uclibc elf.h does not have GNU extentions but we need this define
2so we define it locally if its not getting it from elf.h
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Upstream-Status: Pending
7
8Index: git/elfparser.h
9===================================================================
10--- git.orig/elfparser.h 2011-07-16 18:57:41.000000000 -0700
11+++ git/elfparser.h 2011-07-16 20:28:54.733829895 -0700
12@@ -17,6 +17,10 @@
13 */
14 #include <glib.h>
15
16+#ifndef NT_GNU_BUILD_ID
17+#define NT_GNU_BUILD_ID 3
18+#endif
19+
20 typedef struct ElfSym ElfSym;
21 typedef struct ElfParser ElfParser;
22
diff --git a/meta/recipes-kernel/sysprof/files/rmb-arm.patch b/meta/recipes-kernel/sysprof/files/rmb-arm.patch
new file mode 100644
index 0000000000..c53ac6427c
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/rmb-arm.patch
@@ -0,0 +1,21 @@
1
2Upstream-Status: Pending
3
4Index: git/util.h
5===================================================================
6--- git.orig/util.h 2010-12-07 22:41:57.156243001 -0600
7+++ git/util.h 2010-12-07 22:43:47.616243002 -0600
8@@ -37,4 +37,13 @@
9 #define cpu_relax() asm volatile("" ::: "memory");
10 #endif
11
12+#ifdef __arm__
13+/*
14+ * Use the __kuser_memory_barrier helper in the CPU helper page. See
15+ * arch/arm/kernel/entry-armv.S in the kernel source for details.
16+ */
17+#define rmb() ((void(*)(void))0xffff0fa0)()
18+#define cpu_relax() asm volatile("":::"memory")
19+#endif
20+
21 #endif
diff --git a/meta/recipes-kernel/sysprof/files/rmb-mips.patch b/meta/recipes-kernel/sysprof/files/rmb-mips.patch
new file mode 100644
index 0000000000..e055b8ad8b
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/rmb-mips.patch
@@ -0,0 +1,22 @@
1Upstream-Status: Pending
2
3Index: git/util.h
4===================================================================
5--- git.orig/util.h 2010-12-08 01:22:44.486243001 -0600
6+++ git/util.h 2010-12-08 01:23:27.836243001 -0600
7@@ -37,4 +37,15 @@
8 #define cpu_relax() asm volatile("" ::: "memory");
9 #endif
10
11+#ifdef __mips__
12+#define rmb() asm volatile( \
13+ ".set mips2\n\t" \
14+ "sync\n\t" \
15+ ".set mips0" \
16+ : /* no output */ \
17+ : /* no input */ \
18+ : "memory")
19+#define cpu_relax() asm volatile("" ::: "memory")
20+#endif
21+
22 #endif
diff --git a/meta/recipes-kernel/sysprof/sysprof_git.bb b/meta/recipes-kernel/sysprof/sysprof_git.bb
new file mode 100644
index 0000000000..73e617f219
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/sysprof_git.bb
@@ -0,0 +1,20 @@
1SUMMARY = "System-wide Performance Profiler for Linux"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
4
5DEPENDS = "gtk+ libglade"
6
7SRCREV = "cd44ee6644c3641507fb53b8a2a69137f2971219"
8PV = "1.2.0+git${SRCPV}"
9
10SRC_URI = "git://git.gnome.org/sysprof \
11 file://define-NT_GNU_BUILD_ID.patch \
12 "
13
14SRC_URI_append_arm = " file://rmb-arm.patch"
15SRC_URI_append_mips = " file://rmb-mips.patch"
16SRC_URI_append_mips64 = " file://rmb-mips.patch"
17
18S = "${WORKDIR}/git"
19
20inherit autotools
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)}"
diff --git a/meta/recipes-kernel/trace-cmd/kernelshark_1.2.bb b/meta/recipes-kernel/trace-cmd/kernelshark_1.2.bb
new file mode 100644
index 0000000000..d61097df91
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/kernelshark_1.2.bb
@@ -0,0 +1,30 @@
1SUMMARY = "Graphical trace viewer for Ftrace"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
4 file://kernel-shark.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e"
5
6SRCREV = "7055ffd37beeb44714e86a4abc703f7e175a0db5"
7PR = "r3"
8PV = "1.2+git${SRCPV}"
9
10DEPENDS = "gtk+"
11RDEPENDS_${PN} = "trace-cmd"
12
13inherit pkgconfig pythonnative
14
15SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git \
16 file://addldflags.patch \
17 file://make-docs-optional.patch \
18 file://blktrace-api-compatibility.patch \
19 file://kernelshark-fix-syntax-error-of-shell.patch"
20S = "${WORKDIR}/git"
21
22EXTRA_OEMAKE = "'CC=${CC}' 'AR=${AR}' 'prefix=${prefix}' gui"
23
24FILESPATH = "${FILE_DIRNAME}/trace-cmd"
25
26do_install() {
27 oe_runmake CC="${CC}" AR="${AR}" prefix="${prefix}" DESTDIR="${D}" install_gui
28 rm -rf ${D}${datadir}/trace-cmd
29 rmdir ${D}${datadir}
30}
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/addldflags.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/addldflags.patch
new file mode 100644
index 0000000000..14730db905
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/addldflags.patch
@@ -0,0 +1,51 @@
1trace-cmd: Cross-compile fixes for LDFLAGS and include path
2
3Add ability for the Makefile to respect LDFLAGS.
4Also remove hardcoded /usr/local/include include path.
5
6Upstream-Status: Accepted [Post 1.2: 5f576e9af7ad706774d9764a9ae3989376797c0e]
7
8Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9Signed-off-by: Darren Hart <dvhart@linux.intel.com>
10
11---
12 Makefile | 7 ++++---
13 1 file changed, 4 insertions(+), 3 deletions(-)
14
15Index: git/Makefile
16===================================================================
17--- git.orig/Makefile
18+++ git/Makefile
19@@ -202,12 +202,13 @@ export Q VERBOSE
20 TRACECMD_VERSION = $(TC_VERSION).$(TC_PATCHLEVEL).$(TC_EXTRAVERSION)
21 KERNELSHARK_VERSION = $(KS_VERSION).$(KS_PATCHLEVEL).$(KS_EXTRAVERSION)
22
23-INCLUDES = -I. -I/usr/local/include $(CONFIG_INCLUDES)
24+INCLUDES = -I. $(CONFIG_INCLUDES)
25
26 include features.mk
27
28 # Set compile option CFLAGS if not set elsewhere
29 CFLAGS ?= -g -Wall
30+LDFLAGS ?=
31
32 ifndef NO_PTRACE
33 ifneq ($(call try-cc,$(SOURCE_PTRACE),),y)
34@@ -251,7 +252,7 @@ do_fpic_compile = \
35
36 do_app_build = \
37 ($(print_app_build) \
38- $(CC) $^ -rdynamic -o $@ $(CONFIG_LIBS) $(LIBS))
39+ $(CC) $^ -rdynamic -o $@ $(LDFLAGS) $(CONFIG_LIBS) $(LIBS))
40
41 do_compile_shared_library = \
42 ($(print_shared_lib_compile) \
43@@ -263,7 +264,7 @@ do_compile_plugin_obj = \
44
45 do_plugin_build = \
46 ($(print_plugin_build) \
47- $(CC) $(CFLAGS) -shared -nostartfiles -o $@ $<)
48+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -nostartfiles -o $@ $<)
49
50 do_build_static_lib = \
51 ($(print_static_lib_build) \
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
new file mode 100644
index 0000000000..0789e9fdf7
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
@@ -0,0 +1,29 @@
1trace-cmd: Add blktrace_api compatibility for TC_BARRIER
2
3Newer kernels replace TC_BARRIER with TC_FLUSH. Ensure trace-cmd
4can build regardless of the linux-kernel-headers version.
5
6Upstream-Status: Innapropriate [Stop gap]
7
8Signed-off-by: Darren Hart <dvhart@linux.intel.com>
9
10diff --git a/plugin_blk.c b/plugin_blk.c
11index 9327b17..c8e5e1c 100644
12--- a/plugin_blk.c
13+++ b/plugin_blk.c
14@@ -44,6 +44,15 @@ struct blk_data {
15 unsigned short pdu_len;
16 };
17
18+/*
19+ * Newer kernels don't define BLK_TC_BARRIER and have replaced it with
20+ * BLK_TC_FLUSH. In this case, define it here and report FLUSHES as BARRIERS as
21+ * a workaround, as described in:
22+ * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=c09c47caedc9854d59378d6e34c989e51cfdd2b4
23+ */
24+#ifndef BLK_TC_BARRIER
25+#define BLK_TC_BARRIER 1<<2
26+#endif
27 static void fill_rwbs(char *rwbs, int action, unsigned int bytes)
28 {
29 int i = 0;
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/kernelshark-fix-syntax-error-of-shell.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/kernelshark-fix-syntax-error-of-shell.patch
new file mode 100644
index 0000000000..351b24b82f
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/kernelshark-fix-syntax-error-of-shell.patch
@@ -0,0 +1,30 @@
1kernelshark: fix syntax error of shell
2
3Delete "<<<" syntax of bash in Makefile, else we would get following error:
4
5 Syntax error: redirection unexpected
6
7Upstream-status: Pending
8
9Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
10---
11 Makefile | 3 +--
12 1 file changed, 1 insertion(+), 2 deletions(-)
13
14diff --git a/Makefile b/Makefile
15index c1fa906..be84415 100644
16--- a/Makefile
17+++ b/Makefile
18@@ -89,8 +89,7 @@ endif
19
20 # $(call test-build, snippet, ret) -> ret if snippet compiles
21 # -> empty otherwise
22-test-build = $(if $(shell $(CC) -o /dev/null -c -x c - > /dev/null 2>&1 \
23- <<<'$1' && echo y), $2)
24+test-build = $(if $(shell echo '$1' |$(CC) -o /dev/null -c -x c - > /dev/null 2>&1 && echo y), $2)
25
26 # have udis86 disassembler library?
27 udis86-flags := $(call test-build,\#include <udis86.h>,-DHAVE_UDIS86 -ludis86)
28--
291.7.9.5
30
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/make-docs-optional.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/make-docs-optional.patch
new file mode 100644
index 0000000000..8402426c5f
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/make-docs-optional.patch
@@ -0,0 +1,36 @@
1Disable building docs until we have asciidocs available as a recipe.
2
3Upstream-Status: Inappropriate [Account for missing dependency, the lazy way]
4
5Signed-off-by: Darren Hart <dvhart@linux.intel.com>
6
7---
8 Makefile | 8 ++++++--
9 1 file changed, 6 insertions(+), 2 deletions(-)
10
11Index: git/Makefile
12===================================================================
13--- git.orig/Makefile
14+++ git/Makefile
15@@ -327,7 +327,9 @@ TARGETS = $(CMD_TARGETS) $(GUI_TARGETS)
16 # If you want kernelshark, then do: make gui
17 ###
18
19-all: all_cmd doc show_gui_make
20+# Make doc optional
21+#all: all_cmd doc show_gui_make
22+all: all_cmd show_gui_make
23
24 all_cmd: $(CMD_TARGETS)
25
26@@ -503,7 +505,9 @@ install_python: $(PYTHON_SO_INSTALL) $(P
27 install_cmd: all_cmd install_plugins install_python
28 $(Q)$(call do_install,trace-cmd,$(bindir_SQ))
29
30-install: install_cmd install_doc
31+# Make doc optional
32+#install: install_cmd install_doc
33+install: install_cmd
34 @echo "Note: to install the gui, type \"make install_gui\""
35
36 install_gui: install_cmd gui
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch
new file mode 100644
index 0000000000..8fdeedb008
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch
@@ -0,0 +1,61 @@
1From a6e259b2cd43db3c0f69441f627a8cf214f88506 Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Thu, 5 Apr 2012 15:19:44 -0400
4Subject: [PATCH] trace-cmd: Add checks for invalid pointers to fix segfaults
5
6Upstream-Status: Backport
7
8Running 'trace-cmd report' after running latency tracers will cause a
9segfault due to invalid pointers. Adding checks to ensure
10pointers/lists are initialized before attempting to use them prevents
11these segfaults.
12
13Link: http://lkml.kernel.org/r/1333653586-3379-2-git-send-email-mark.asselstine@windriver.com
14
15Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
16Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
17---
18 trace-input.c | 12 +++++++++---
19 1 file changed, 9 insertions(+), 3 deletions(-)
20
21diff --git a/trace-input.c b/trace-input.c
22index b6af1e6..5151c1e 100644
23--- a/trace-input.c
24+++ b/trace-input.c
25@@ -695,7 +695,8 @@ static void __free_page(struct tracecmd_input *handle, struct page *page)
26
27 static void free_page(struct tracecmd_input *handle, int cpu)
28 {
29- if (!handle->cpu_data[cpu].page)
30+ if (!handle->cpu_data || cpu >= handle->cpus ||
31+ !handle->cpu_data[cpu].page)
32 return;
33
34 __free_page(handle, handle->cpu_data[cpu].page);
35@@ -746,8 +747,12 @@ void tracecmd_record_ref(struct record *record)
36
37 static void free_next(struct tracecmd_input *handle, int cpu)
38 {
39- struct record *record = handle->cpu_data[cpu].next;
40+ struct record *record;
41+
42+ if (!handle->cpu_data || cpu >= handle->cpus)
43+ return;
44
45+ record = handle->cpu_data[cpu].next;
46 if (!record)
47 return;
48
49@@ -2337,7 +2342,8 @@ void tracecmd_close(struct tracecmd_input *handle)
50 /* The tracecmd_peek_data may have cached a record */
51 free_next(handle, cpu);
52 free_page(handle, cpu);
53- if (!list_empty(&handle->cpu_data[cpu].pages))
54+ if (handle->cpu_data &&
55+ !list_empty(&handle->cpu_data[cpu].pages))
56 warning("pages still allocated on cpu %d%s",
57 cpu, show_records(&handle->cpu_data[cpu].pages));
58 }
59--
601.7.10.4
61
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch
new file mode 100644
index 0000000000..4c00c512bb
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch
@@ -0,0 +1,38 @@
1From 356dee73d9ced3e019dea2883a7f357fd4664b3e Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Thu, 5 Apr 2012 15:19:45 -0400
4Subject: [PATCH] trace-cmd: Do not call stop_threads() if doing latency
5 tracing
6
7Upstream-Status: Backport
8
9If we are using a latency tracer we do not call start_threads() we
10should therefore not call stop_threads() if 'latency'. Attempting
11to call stop_threads() without first calling start_threads() will
12cause a segfault since pids will be uninitialized.
13
14Link: http://lkml.kernel.org/r/1333653586-3379-3-git-send-email-mark.asselstine@windriver.com
15
16Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
17Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
18---
19 trace-record.c | 3 ++-
20 1 file changed, 2 insertions(+), 1 deletion(-)
21
22diff --git a/trace-record.c b/trace-record.c
23index fcec28b..1c56fa9 100644
24--- a/trace-record.c
25+++ b/trace-record.c
26@@ -2216,7 +2216,8 @@ void trace_record (int argc, char **argv)
27 }
28
29 disable_tracing();
30- stop_threads();
31+ if (!latency)
32+ stop_threads();
33 }
34
35 for (cpu = 0; cpu < cpu_count; cpu++) {
36--
371.7.10.4
38
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch
new file mode 100644
index 0000000000..724e1e80b1
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch
@@ -0,0 +1,96 @@
1From d65740d61e7a4ea6d8d77237954b33dd18e3276c Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Sun, 8 Apr 2012 11:38:45 -0400
4Subject: [PATCH] trace-cmd: Setting plugin to 'nop' clears data before it's
5 recorded
6
7Upstream-Status: Backport
8
9commit e09a5db1a929ab668c273b87c4f0a32b81e1c21a
10[trace-cmd: Add trace-cmd record --date option]
11
12moved the call to disable_all() in trace_record() from after record_data()
13to before it. Unfortunately disable_all() sets 'nop' in 'current_tracer'
14which has the side affect of clearing 'trace', thus all the latency tracer
15reports are empty/useless. Here we make disable_all() optionally call
16set_plugin() thus, where we need to, we can delay the disabling of the tracer
17until we have had a chance to capture 'trace'. We have added this delayed
18behavior to trace_record() to fix the latency reports, for all other calls to
19disable_all() we continue to have set_plugin() called.
20
21Link: http://lkml.kernel.org/r/1333899525-6436-1-git-send-email-mark.asselstine@windriver.com
22
23Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
24Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
25---
26 trace-record.c | 16 ++++++++++------
27 1 file changed, 10 insertions(+), 6 deletions(-)
28
29diff --git a/trace-record.c b/trace-record.c
30index 1c56fa9..95d4a2a 100644
31--- a/trace-record.c
32+++ b/trace-record.c
33@@ -897,11 +897,13 @@ static void disable_tracing(void)
34 write_tracing_on(0);
35 }
36
37-static void disable_all(void)
38+static void disable_all(int disable_tracer)
39 {
40 disable_tracing();
41
42- set_plugin("nop");
43+ if (disable_tracer)
44+ set_plugin("nop");
45+
46 reset_events();
47
48 /* Force close and reset of ftrace pid file */
49@@ -1573,7 +1575,7 @@ static void set_funcs(void)
50 /* make sure we are filtering functions */
51 if (func_stack) {
52 if (!functions_filtered()) {
53- disable_all();
54+ disable_all(1);
55 die("Function stack trace set, but functions not filtered");
56 }
57 save_option(FUNC_STACK_TRACE);
58@@ -1938,7 +1940,7 @@ void trace_record (int argc, char **argv)
59 break;
60 }
61 }
62- disable_all();
63+ disable_all(1);
64 set_buffer_size();
65 exit(0);
66 } else
67@@ -2147,7 +2149,7 @@ void trace_record (int argc, char **argv)
68
69 if (!extract) {
70 fset = set_ftrace(!disable);
71- disable_all();
72+ disable_all(1);
73
74 /* Record records the date first */
75 if (record && date)
76@@ -2227,7 +2229,7 @@ void trace_record (int argc, char **argv)
77 }
78
79 if (!keep)
80- disable_all();
81+ disable_all(0);
82
83 printf("Kernel buffer statistics:\n"
84 " Note: \"entries\" are the entries left in the kernel ring buffer and are not\n"
85@@ -2249,6 +2251,8 @@ void trace_record (int argc, char **argv)
86 if (keep)
87 exit(0);
88
89+ set_plugin("nop");
90+
91 /* If tracing_on was enabled before we started, set it on now */
92 if (tracing_on_init_val)
93 write_tracing_on(tracing_on_init_val);
94--
951.7.10.4
96
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-fix-syntax-error-of-shell.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-fix-syntax-error-of-shell.patch
new file mode 100644
index 0000000000..b1ebf49830
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/trace-cmd-fix-syntax-error-of-shell.patch
@@ -0,0 +1,30 @@
1trace-cmd: fix syntax error of shell
2
3Delete "<<<" syntax of bash in Makefile, else we would get following error:
4
5 Syntax error: redirection unexpected
6
7Upstream-status: Pending
8
9Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
10---
11 Makefile | 3 +--
12 1 file changed, 1 insertion(+), 2 deletions(-)
13
14diff --git a/Makefile b/Makefile
15index c1fa906..7973c53 100644
16--- a/Makefile
17+++ b/Makefile
18@@ -89,8 +89,7 @@ endif
19
20 # $(call test-build, snippet, ret) -> ret if snippet compiles
21 # -> empty otherwise
22-test-build = $(if $(shell $(CC) -o /dev/null -c -x c - > /dev/null 2>&1 \
23- <<<'$1' && echo y), $2)
24+test-build = $(if $(shell echo '$1' |$(CC) -o /dev/null -c -x c - > /dev/null 2>&1 && echo y), $2)
25
26 # have udis86 disassembler library?
27 udis86-flags := $(call test-build,\#include <udis86.h>,-DHAVE_UDIS86 -ludis86)
28--
291.7.9.5
30
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb b/meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb
new file mode 100644
index 0000000000..a0c823bf62
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd_1.2.bb
@@ -0,0 +1,31 @@
1SUMMARY = "User interface to Ftrace"
2LICENSE = "GPLv2 & LGPLv2.1"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
4 file://trace-cmd.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e \
5 file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff \
6 file://trace-input.c;beginline=5;endine=8;md5=6ad47cc2b03385d8456771eec5eeea0b"
7
8SRCREV = "7055ffd37beeb44714e86a4abc703f7e175a0db5"
9PR = "r3"
10PV = "1.2+git${SRCPV}"
11
12inherit pkgconfig pythonnative
13
14SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git \
15 file://addldflags.patch \
16 file://make-docs-optional.patch \
17 file://blktrace-api-compatibility.patch \
18 file://trace-cmd-Add-checks-for-invalid-pointers-to-fix-seg.patch \
19 file://trace-cmd-Do-not-call-stop_threads-if-doing-latency-.patch \
20 file://trace-cmd-Setting-plugin-to-nop-clears-data-before-i.patch \
21 file://trace-cmd-fix-syntax-error-of-shell.patch \
22"
23S = "${WORKDIR}/git"
24
25EXTRA_OEMAKE = "'prefix=${prefix}'"
26
27FILES_${PN}-dbg += "${datadir}/trace-cmd/plugins/.debug/"
28
29do_install() {
30 oe_runmake prefix="${prefix}" DESTDIR="${D}" install
31}