diff options
author | Ross Burton <ross.burton@intel.com> | 2017-01-16 13:11:10 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-19 22:47:21 +0000 |
commit | 73adcf1b668f990624411060da253d84f53eb1ee (patch) | |
tree | 3fe2100621620741e6eed341228f3b295e8acea2 /meta/recipes-kernel | |
parent | 3b262f458c0324569bb0a130ef895e721757ff3e (diff) | |
download | poky-73adcf1b668f990624411060da253d84f53eb1ee.tar.gz |
perf: use PACKAGECONFIG instead of hand-rolled logic
PERF_FEATURES_ENABLE and perf_feature_enabled() was basically a poor man's clone
of PACKAGECONFIG, without the automatic handling of dependencies and configure
options.
As part of the port to PACKAGECONFIG the options have been changed to remove the
perf- prefix, but are otherwise unchanged.
Also remove BUILDPERF_libc_uclibc assignment as nothing in the metadata uses a
BUILDPERF variable.
(From OE-Core rev: 33d05772c30036e8d2bb2dc8928989bf98d388f1)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r-- | meta/recipes-kernel/perf/perf-features.inc | 22 | ||||
-rw-r--r-- | meta/recipes-kernel/perf/perf.bb | 26 |
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 @@ | |||
1 | PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui" | ||
2 | |||
3 | def 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 | ||
11 | PR = "r9" | 11 | PR = "r9" |
12 | 12 | ||
13 | require perf-features.inc | ||
14 | |||
15 | BUILDPERF_libc-uclibc = "no" | 13 | BUILDPERF_libc-uclibc = "no" |
16 | 14 | ||
15 | PACKAGECONFIG ??= "scripting tui" | ||
16 | PACKAGECONFIG[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 |
20 | TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}" | 20 | PACKAGECONFIG[tui] = ",NO_NEWT=1,libnewt slang" |
21 | SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}" | 21 | PACKAGECONFIG[libunwind] = ",NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1,libunwind" |
22 | LIBUNWIND_DEPENDS = "${@perf_feature_enabled('perf-libunwind', 'libunwind', '',d)}" | 22 | PACKAGECONFIG[libnuma] = ",NO_LIBNUMA=1" |
23 | 23 | ||
24 | DEPENDS = " \ | 24 | DEPENDS = " \ |
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 | |||
61 | B = "${WORKDIR}/${BPN}-${PV}" | 58 | B = "${WORKDIR}/${BPN}-${PV}" |
62 | SPDX_S = "${S}/tools/perf" | 59 | SPDX_S = "${S}/tools/perf" |
63 | 60 | ||
64 | SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}" | ||
65 | TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}" | ||
66 | LIBUNWIND_DEFINES = "${@perf_feature_enabled('perf-libunwind', '', 'NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1',d)}" | ||
67 | LIBNUMA_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 | ||
89 | EXTRA_OEMAKE += "\ | 81 | EXTRA_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" | |||
225 | RDEPENDS_${PN}-perl =+ "bash perl perl-modules" | 217 | RDEPENDS_${PN}-perl =+ "bash perl perl-modules" |
226 | RDEPENDS_${PN}-tests =+ "python" | 218 | RDEPENDS_${PN}-tests =+ "python" |
227 | 219 | ||
228 | RSUGGESTS_SCRIPTING = "${@perf_feature_enabled('perf-scripting', '${PN}-perl ${PN}-python', '',d)}" | 220 | RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}-perl ${PN}-python', '',d)}" |
229 | RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}" | 221 | RSUGGESTS_${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" |