summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/perf
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/perf')
-rw-r--r--meta/recipes-kernel/perf/perf-features.inc22
-rw-r--r--meta/recipes-kernel/perf/perf.bb26
2 files changed, 9 insertions, 39 deletions
diff --git a/meta/recipes-kernel/perf/perf-features.inc b/meta/recipes-kernel/perf/perf-features.inc
deleted file mode 100644
index a4402cc50b..0000000000
--- a/meta/recipes-kernel/perf/perf-features.inc
+++ /dev/null
@@ -1,22 +0,0 @@
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") 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
index cfbe628345..8b5028ea4c 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -10,24 +10,21 @@ LICENSE = "GPLv2"
10 10
11PR = "r9" 11PR = "r9"
12 12
13require perf-features.inc
14
15BUILDPERF_libc-uclibc = "no" 13BUILDPERF_libc-uclibc = "no"
16 14
15PACKAGECONFIG ??= "scripting tui"
16PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python"
17# gui support was added with kernel 3.6.35 17# gui support was added with kernel 3.6.35
18# since 3.10 libnewt was replaced by slang 18# since 3.10 libnewt was replaced by slang
19# to cover a wide range of kernel we add both dependencies 19# to cover a wide range of kernel we add both dependencies
20TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}" 20PACKAGECONFIG[tui] = ",NO_NEWT=1,libnewt slang"
21SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}" 21PACKAGECONFIG[libunwind] = ",NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1,libunwind"
22LIBUNWIND_DEPENDS = "${@perf_feature_enabled('perf-libunwind', 'libunwind', '',d)}" 22PACKAGECONFIG[libnuma] = ",NO_LIBNUMA=1"
23 23
24DEPENDS = " \ 24DEPENDS = " \
25 virtual/${MLPREFIX}libc \ 25 virtual/${MLPREFIX}libc \
26 ${MLPREFIX}elfutils \ 26 ${MLPREFIX}elfutils \
27 ${MLPREFIX}binutils \ 27 ${MLPREFIX}binutils \
28 ${TUI_DEPENDS} \
29 ${SCRIPTING_DEPENDS} \
30 ${LIBUNWIND_DEPENDS} \
31 bison flex xz \ 28 bison flex xz \
32 xmlto-native \ 29 xmlto-native \
33 asciidoc-native \ 30 asciidoc-native \
@@ -61,11 +58,6 @@ inherit kernelsrc
61B = "${WORKDIR}/${BPN}-${PV}" 58B = "${WORKDIR}/${BPN}-${PV}"
62SPDX_S = "${S}/tools/perf" 59SPDX_S = "${S}/tools/perf"
63 60
64SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
65TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
66LIBUNWIND_DEFINES = "${@perf_feature_enabled('perf-libunwind', '', 'NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1',d)}"
67LIBNUMA_DEFINES = "${@perf_feature_enabled('perf-libnuma', '', 'NO_LIBNUMA=1',d)}"
68
69# The LDFLAGS is required or some old kernels fails due missing 61# The LDFLAGS is required or some old kernels fails due missing
70# symbols and this is preferred than requiring patches to every old 62# symbols and this is preferred than requiring patches to every old
71# supported kernel. 63# supported kernel.
@@ -82,8 +74,8 @@ EXTRA_OEMAKE = '\
82 EXTRA_CFLAGS="-ldw" \ 74 EXTRA_CFLAGS="-ldw" \
83 EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \ 75 EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \
84 perfexecdir=${libexecdir} \ 76 perfexecdir=${libexecdir} \
85 NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${LIBUNWIND_DEFINES} \ 77 NO_GTK2=1 NO_DWARF=1 \
86 ${SCRIPTING_DEFINES} ${LIBNUMA_DEFINES} \ 78 ${PACKAGECONFIG_CONFARGS} \
87' 79'
88 80
89EXTRA_OEMAKE += "\ 81EXTRA_OEMAKE += "\
@@ -116,7 +108,7 @@ do_install() {
116 unset CFLAGS 108 unset CFLAGS
117 oe_runmake install 109 oe_runmake install
118 # we are checking for this make target to be compatible with older perf versions 110 # we are checking for this make target to be compatible with older perf versions
119 if [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" ] && grep -q install-python_ext ${S}/tools/perf/Makefile*; then 111 if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
120 oe_runmake DESTDIR=${D} install-python_ext 112 oe_runmake DESTDIR=${D} install-python_ext
121 fi 113 fi
122} 114}
@@ -225,7 +217,7 @@ RDEPENDS_${PN}-python =+ "bash python python-modules"
225RDEPENDS_${PN}-perl =+ "bash perl perl-modules" 217RDEPENDS_${PN}-perl =+ "bash perl perl-modules"
226RDEPENDS_${PN}-tests =+ "python" 218RDEPENDS_${PN}-tests =+ "python"
227 219
228RSUGGESTS_SCRIPTING = "${@perf_feature_enabled('perf-scripting', '${PN}-perl ${PN}-python', '',d)}" 220RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}-perl ${PN}-python', '',d)}"
229RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}" 221RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
230 222
231#FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core /usr/lib64/traceevent ${libdir}/traceevent" 223#FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core /usr/lib64/traceevent ${libdir}/traceevent"