diff mbox series

[1/1] perf: add libtraceevent packageconfig

Message ID 20230508170423.3555574-1-max.oss.09@gmail.com
State New
Headers show
Series [1/1] perf: add libtraceevent packageconfig | expand

Commit Message

Max Krummenacher May 8, 2023, 5:04 p.m. UTC
From: Max Krummenacher <max.krummenacher@toradex.com>

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.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
 meta/recipes-kernel/perf/perf.bb | 3 +++
 1 file changed, 3 insertions(+)

Comments

Bruce Ashfield May 8, 2023, 7:15 p.m. UTC | #1
On Mon, May 8, 2023 at 1:05 PM Max Krummenacher <max.oss.09@gmail.com> wrote:
>
> From: Max Krummenacher <max.krummenacher@toradex.com>
>
> 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).

> 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

> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> ---
>  meta/recipes-kernel/perf/perf.bb | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
> index 2f28d16fba..110711f4ac 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -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
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> 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: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


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

Patch

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 2f28d16fba..110711f4ac 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -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