Skip to contentSkip to conversation

perf: add libtraceevent packageconfig

PATCH Superseded Max Krummenacher 2 participants 2 messages May 8, 2023

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: add libtraceevent packageconfig

From: Max Krummenacher <[email protected]>

With kernel 6.4-rc1 commit 6898e60f709b ("perf build: If libtraceevent isn't present error the build") having libtraceevent is a required dependency unless building it with 'NO_LIBTRACEEVENT=1'. Older kernels did print a warning and build perf with reduced functionality.

Add a libtraceevent packageconfig which if not present builds with NO_LIBTRACEEVENT=1 and if present depends on the meta-openembedded provided libtraceevent.
Fixup the to be called pkg-config as $(CROSS_COMPILE)pkg-config doesn't exist.

---
 meta/recipes-kernel/perf/perf.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-kernel/perf/perf.bb +3 -0
index 2f28d16fba..110711f4ac 100644
@@ -27,6 +27,7 @@ PACKAGECONFIG[jvmti] = ",NO_JVMTI=1"
 PACKAGECONFIG[audit] = ",NO_LIBAUDIT=1,audit"
 PACKAGECONFIG[manpages] = ",,xmlto-native asciidoc-native"
 PACKAGECONFIG[cap] = ",,libcap"
+PACKAGECONFIG[libtraceevent] = ",NO_LIBTRACEEVENT=1,libtraceevent"
 # Arm CoreSight
 PACKAGECONFIG[coresight] = "CORESIGHT=1,,opencsd"
 
@@ -87,6 +88,7 @@ EXTRA_OEMAKE = '\
     perfexecdir=${libexecdir} \
     NO_GTK2=1 \
     ${PACKAGECONFIG_CONFARGS} \
+    PKG_CONFIG=pkg-config \
     TMPDIR="${B}" \
     LIBUNWIND_DIR=${STAGING_EXECPREFIXDIR} \
 '
@@ -287,6 +289,7 @@ do_configure:prepend () {
         sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf
         sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf
         sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' ${S}/tools/perf/Makefile.perf
+        sed -i 's,PKG_CONFIG = $(CROSS_COMPILE)pkg-config,#PKG_CONFIG,' ${S}/tools/perf/Makefile.perf
     fi
     if [ -e "${S}/tools/lib/api/Makefile" ]; then
         sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile
Signature · 1 line
2.35.3
#1 lore raw
Quoted 8 lines · Max Krummenacher

From: Max Krummenacher <[email protected]>

With kernel 6.4-rc1 commit 6898e60f709b ("perf build: If libtraceevent isn't present error the build") having libtraceevent is a required dependency unless building it with 'NO_LIBTRACEEVENT=1'. Older kernels did print a warning and build perf with reduced functionality.

We might also consider bringing libtraceevent into core, since there is an in-kernel provider.
Since perf is now erroring when it isn't present, they clearly consider it fairly core
functionality (even if it can be disabled).

Quoted 6 lines

Add a libtraceevent packageconfig which if not present builds with NO_LIBTRACEEVENT=1 and if present depends on the meta-openembedded provided libtraceevent.
Fixup the to be called pkg-config as $(CROSS_COMPILE)pkg-config doesn't exist.

The pkg-config changes need to be a separate commit.

It is interesting that these are needed, as we have been using packageconfig variables
with core for quite some time now.

But looking more closely, it does appear that we are mainly just setting the NO_*
flags, and not using pkg-config to locate libs and flags. and libraceevent is exposing the issue. If that is true, it is worth logging that in the commit log, so
we can understand why it is only needed now.

I had to convince myself that we aren't tangling up the host versus native pkg-config in perf (since it already acknowledges the difference with the CROSS_COMPILE prefix to pkg-config) .. and I did confirm that we want the target pkg-config settings for this, which pkg-config will be picking up.

(for the main kernel builds, we override pkg-config to point to host settings, but that isn't the use in perf at the moment).

Bruce

Quoted 37 lines
---
 meta/recipes-kernel/perf/perf.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-kernel/perf/perf.bb +3 -1
index 2f28d16fba..110711f4ac 100644
@@ -27,6 +27,7 @@ PACKAGECONFIG[jvmti] = ",NO_JVMTI=1"
 PACKAGECONFIG[audit] = ",NO_LIBAUDIT=1,audit"
 PACKAGECONFIG[manpages] = ",,xmlto-native asciidoc-native"
 PACKAGECONFIG[cap] = ",,libcap"
+PACKAGECONFIG[libtraceevent] = ",NO_LIBTRACEEVENT=1,libtraceevent"
 # Arm CoreSight
 PACKAGECONFIG[coresight] = "CORESIGHT=1,,opencsd"
 
@@ -87,6 +88,7 @@ EXTRA_OEMAKE = '\
     perfexecdir=${libexecdir} \
     NO_GTK2=1 \
     ${PACKAGECONFIG_CONFARGS} \
+    PKG_CONFIG=pkg-config \
     TMPDIR="${B}" \
     LIBUNWIND_DIR=${STAGING_EXECPREFIXDIR} \
 '
@@ -287,6 +289,7 @@ do_configure:prepend () {
         sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf
         sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf
         sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' ${S}/tools/perf/Makefile.perf
+        sed -i 's,PKG_CONFIG = $(CROSS_COMPILE)pkg-config,#PKG_CONFIG,' ${S}/tools/perf/Makefile.perf
     fi
     if [ -e "${S}/tools/lib/api/Makefile" ]; then
         sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile
--

2.35.3

Quoted 8 lines

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

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II