Skip to contentSkip to conversation

perf: enable verbose feature detection

PATCH In review [email protected] 2 participants 6 messages Aug 22, 2023 – Aug 23, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 perf: enable verbose feature detection

From: Ross Burton <[email protected]>

Having verbose feature detection is helpful to see exactly what has been enabled or disabled.

---
 meta/recipes-kernel/perf/perf.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-kernel/perf/perf.bb +1 -0
index 7d90ac3612f..68d59f69c7d 100644
@@ -73,6 +73,7 @@ LDFLAGS="-ldl -lutil"
 
 EXTRA_OEMAKE = '\
     V=1 \
+    VF=1 \
     -C ${S}/tools/perf \
     O=${B} \
     CROSS_COMPILE=${TARGET_PREFIX} \
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/5 perf: add more PACKAGECONFIGs

From: Ross Burton <[email protected]>

libpfm4 and babeltrace are enabled if they're found, so add PACKAGECONFIGs so that our configuration is explicit.

---
 meta/recipes-kernel/perf/perf.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-kernel/perf/perf.bb +2 -0
index 68d59f69c7d..9eeb1003f3a 100644
@@ -30,6 +30,8 @@ PACKAGECONFIG[cap] = ",,libcap"
 PACKAGECONFIG[libtraceevent] = ",NO_LIBTRACEEVENT=1,libtraceevent"
 # Arm CoreSight
 PACKAGECONFIG[coresight] = "CORESIGHT=1,,opencsd"
+PACKAGECONFIG[pfm4] = ",NO_LIBPFM4=1,libpfm4"
+PACKAGECONFIG[babeltrace] = ",NO_LIBBABELTRACE=1,babeltrace"
 
 # libunwind is not yet ported for some architectures
 PACKAGECONFIG:remove:arc = "libunwind"
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/5 perf: fix perl binding support

In reply to [email protected]

From: Ross Burton <[email protected]>

The build of the perl integration has been broken for some time.

Update the PERL_* variables so that it can find libperl in the new location.

This then fails because the Perl headers cause warnings and the feature checks run with -Werror, so disable the errors.

The perf-dbg package then has target build paths, so set INSANE_SKIP for now until this is resolved.

---
 meta/recipes-kernel/perf/perf-perl.inc | 10 +++++++---
 meta/recipes-kernel/perf/perf.bb       |  3 +++
 2 files changed, 10 insertions(+), 3 deletions(-)
meta/recipes-kernel/perf/perf-perl.inc +7 -3
index ae77319b203..491f54c3280 100644
@@ -2,6 +2,10 @@ inherit perlnative cpan-base
 
 # Env var which tells perl if it should use host (no) or target (yes) settings
 export PERLCONFIGTARGET = "${@is_target(d)}"
-export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
-export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
-export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}/CORE"
+export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}"
+
+# The perl symbols CPPSTDIN and CPPRUN embed the sysroot into the
+# binaries, work needed to remove this
+INSANE_SKIP:${PN}-dbg += "buildpaths"
meta/recipes-kernel/perf/perf.bb +3 -0
index 9eeb1003f3a..327934b72a7 100644
@@ -323,6 +323,9 @@ do_configure:prepend () {
     if [ -e "${S}/tools/build/Makefile.feature" ]; then
         sed -i 's,CFLAGS=,CC="\$(CC)" CFLAGS=,' ${S}/tools/build/Makefile.feature
     fi
+    # The libperl feature check produces fatal warnings due to -Werror being
+    # used, silence enough errors that the check passes.
+    sed -i 's/\(FLAGS_PERL_EMBED=.*\)/\1 -Wno-error=unused-function -Wno-error=attributes/' ${S}/tools/build/feature/Makefile
 
     # 3.17-rc1+ has a include issue for arm/powerpc. Temporarily sed in the appropriate include
     if [ -e "${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c" ]; then
Signature · 1 line
2.34.1
#3 lore raw

PATCH 4/5 perf: split scripting PACKAGECONFIG into perl and python

In reply to [email protected]

From: Ross Burton <[email protected]>

There's no reason for Python and Perl support to be tied together, so split the PACKAGECONFIG into two.

---
 meta/recipes-kernel/perf/perf.bb | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
meta/recipes-kernel/perf/perf.bb +11 -9
index 327934b72a7..f89ab20ca41 100644
@@ -11,9 +11,10 @@ LICENSE = "GPL-2.0-only"
 
 PR = "r9"
 
-PACKAGECONFIG ??= "scripting tui libunwind libtraceevent"
+PACKAGECONFIG ??= "perl python tui libunwind libtraceevent"
 PACKAGECONFIG[dwarf] = ",NO_DWARF=1"
-PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python3 python3-setuptools-native"
+PACKAGECONFIG[perl] = ",NO_LIBPERL=1,perl"
+PACKAGECONFIG[python] = ",NO_LIBPYTHON=1,python3 python3-setuptools-native"
 # gui support was added with kernel 3.6.35
 # since 3.10 libnewt was replaced by slang
 # to cover a wide range of kernel we add both dependencies
@@ -51,7 +52,7 @@ PROVIDES = "virtual/perf"
 inherit linux-kernel-base kernel-arch manpages
 
 # needed for building the tools/perf Python bindings
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig', '', d)}
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
 inherit python3-dir
 export PYTHON_SITEPACKAGES_DIR
 
@@ -61,7 +62,7 @@ export WERROR = "0"
 do_populate_lic[depends] += "virtual/kernel:do_shared_workdir"
 
 # needed for building the tools/perf Perl binding
-include ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'perf-perl.inc', '', d)}
+include ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perf-perl.inc', '', d)}
 
 inherit kernelsrc
 
@@ -107,7 +108,7 @@ EXTRA_OEMAKE += "\
     'sharedir=${@os.path.relpath(datadir, prefix)}' \
     'mandir=${@os.path.relpath(mandir, prefix)}' \
     'infodir=${@os.path.relpath(infodir, prefix)}' \
-    ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'python', 'PYTHON=python3 PYTHON_CONFIG=python3-config', '', d)} \
 "
 
 # During do_configure, we might run a 'make clean'. That often breaks
@@ -152,7 +153,7 @@ do_install() {
 	unset CFLAGS
 	oe_runmake install
 	# we are checking for this make target to be compatible with older perf versions
-	if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
+	if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
 	    oe_runmake DESTDIR=${D} install-python_ext
 	    if [ -e ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt ]; then
 		sed -i -e 's#${WORKDIR}##g' ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt
@@ -370,9 +371,10 @@ RDEPENDS:${PN}-python =+ "bash python3 python3-modules ${@bb.utils.contains('PAC
 RDEPENDS:${PN}-perl =+ "bash perl perl-modules"
 RDEPENDS:${PN}-tests =+ "python3 bash"
 
-RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}-perl ${PN}-python', '',d)}"
-RSUGGESTS:${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
-
+RSUGGESTS:${PN} += "${PN}-archive ${PN}-tests \
+                    ${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl', '', d)} \
+                    ${@bb.utils.contains('PACKAGECONFIG', 'python', '${PN}-python', '', d)} \
+                    "
 FILES_SOLIBSDEV = ""
 FILES:${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent* ${libdir}/libperf-jvmti.so"
 FILES:${PN}-archive = "${libdir}/perf/perf-core/perf-archive"
Signature · 1 line
2.34.1
#4 lore raw

PATCH 5/5 perf: disable perl support

In reply to [email protected]

From: Ross Burton <[email protected]>

The perf support was broken and if enabled results in non-reproducible binaries, so disable it for now.

---
 meta/recipes-kernel/perf/perf.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-kernel/perf/perf.bb +1 -1
index f89ab20ca41..e22a1bebb26 100644
@@ -11,7 +11,7 @@ LICENSE = "GPL-2.0-only"
 
 PR = "r9"
 
-PACKAGECONFIG ??= "perl python tui libunwind libtraceevent"
+PACKAGECONFIG ??= "python tui libunwind libtraceevent"
 PACKAGECONFIG[dwarf] = ",NO_DWARF=1"
 PACKAGECONFIG[perl] = ",NO_LIBPERL=1,perl"
 PACKAGECONFIG[python] = ",NO_LIBPYTHON=1,python3 python3-setuptools-native"
Signature · 1 line
2.34.1
#5 lore raw

Re: [OE-core] [PATCH 5/5] perf: disable perl support

Quoted 4 lines · Ross Burton

From: Ross Burton <[email protected]>

The perf support was broken and if enabled results in non-reproducible binaries, so disable it for now.

Excellent fallback. Bad that Perl support is broken, but excellent to have isolated it.

Quoted 36 lines
---
 meta/recipes-kernel/perf/perf.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-kernel/perf/ renamed from meta/recipes-kernel/perf/perf.bb +0 -0

perf.bb
index f89ab20ca41..e22a1bebb26 100644

meta/recipes-kernel/perf/perf.bb +1 -1
@@ -11,7 +11,7 @@ LICENSE = "GPL-2.0-only"
 
 PR = "r9"
 
-PACKAGECONFIG ??= "perl python tui libunwind libtraceevent"
+PACKAGECONFIG ??= "python tui libunwind libtraceevent"
 PACKAGECONFIG[dwarf] = ",NO_DWARF=1"
 PACKAGECONFIG[perl] = ",NO_LIBPERL=1,perl"
 PACKAGECONFIG[python] = ",NO_LIBPYTHON=1,python3

python3-setuptools-native"
--
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#186517):
https://lists.openembedded.org/g/openembedded-core/message/186517
Mute This Topic: https://lists.openembedded.org/mt/100898291/924729
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-