Skip to contentSkip to conversation

perf: add libtraceevent packageconfig

PATCH In review Max Krummenacher 2 participants 8 messages May 11, 2023 – May 25, 2023

lore
Share & tools
lore
#0 lore raw

v4 cover 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'.

Changes in V2
- add a patch importing libtraceevent from meta-openembedded
- move the pkg-config changes in a separate commit
- default to setting the packageconfig as we now have the dependecy in core

Changes in V3
- add Bruce as the maintainer of the new recipe libtraceevent, thanks Bruce.

Changes in V4
- fix QA issue "libtraceevent-dbg contains reference to TMPDIR [buildpaths]"

Max Krummenacher (4):
libtraceevent: import from meta-openembedded
libtraceevent: fix qa issue with reference to TMPDIR
perf: make pkg-config available
perf: add libtraceevent packageconfig

 meta/conf/distro/include/maintainers.inc      |  1 +
 ...not-preserve-ownership-in-cp-command.patch | 40 +++++++++++++++++++
 .../libtraceevent/libtraceevent_1.7.2.bb      | 27 +++++++++++++
 meta/recipes-kernel/perf/perf.bb              |  5 ++-
 4 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch
 create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb
Signature · 1 line
2.35.3
#1 lore raw

PATCH v4 1/4 libtraceevent: import from meta-openembedded

From: Max Krummenacher <[email protected]>

Import from meta-openembedded at commit d250a0dc0 ("libtraceevent:
upgrade 1.7.1 -> 1.7.2").
Starting with kernel 6.4 libtraceevent is a dependency of perf. While one can still build perf without it by opting out one would loose its functionality compared with building perf from kernels before 6.4

---
 meta/conf/distro/include/maintainers.inc      |  1 +
 ...not-preserve-ownership-in-cp-command.patch | 40 +++++++++++++++++++
 .../libtraceevent/libtraceevent_1.7.2.bb      | 25 ++++++++++++
 3 files changed, 66 insertions(+)
 create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch
 create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb
meta/conf/distro/include/maintainers.inc +1 -0
index ec7ea90d16..3071671850 100644
@@ -402,6 +402,7 @@ RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool-cross = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool-native = "Robert Yang <[email protected]>"
+RECIPE_MAINTAINER:pn-libtraceevent = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-libtry-tiny-perl = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-libucontext = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-libunistring = "Anuj Mittal <[email protected]>"
meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch new file +40 -0
new file mode 100644
index 0000000000..5e88048817
@@ -0,0 +1,40 @@
+From ed0a31000305d937abe47c44d705b5b52bb36f79 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 22 Dec 2022 18:32:17 -0800
+Subject: [PATCH] makefile: Do not preserve ownership in cp command
+
+Fixes
+
+ERROR: libtraceevent-1.7.0-r0 do_package_qa: QA Issue: libtraceevent: /usr/lib/libtraceevent.a is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 965ff47..0e782cb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -287,7 +287,7 @@ $(BUILD_PREFIX): force
+ 	$(Q)$(call build_prefix,$(prefix))
+ 
+ define do_make_pkgconfig_file
+-	cp -f ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE};	\
++	install -m 0644 ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE};	\
+ 	sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; 		\
+ 	sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g" ${PKG_CONFIG_FILE}; \
+ 	sed -i "s|LIB_DIR|${libdir_relative}|g" ${PKG_CONFIG_FILE}; \
+@@ -335,7 +335,7 @@ install: install_libs install_plugins
+ 
+ install_libs: libs install_headers install_pkgconfig
+ 	$(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)); \
+-		cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
++		cp --no-preserve=ownership --recursive $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
+ 	$(Q)$(call install_ld_config)
+ 
+ install_pkgconfig: $(PKG_CONFIG_FILE)
+-- 
+2.39.0
+
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +25 -0
new file mode 100644
index 0000000000..089b6814c7
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "API to access the kernel tracefs directory"
+HOMEPAGE = "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/"
+LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
+LIC_FILES_CHKSUM = "file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \
+                    file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd"
+SECTION = "libs"
+
+SRCREV = "1c6f0f3b2bb47571fc455dc565dc343152517d98"
+SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;branch=${BPN};protocol=https \
+           file://0001-makefile-Do-not-preserve-ownership-in-cp-command.patch"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig
+
+do_install() {
+    oe_runmake install DESTDIR=${D} pkgconfig_dir=${libdir}/pkgconfig
+}
+
+PACKAGES += "${PN}-plugins"
+
+FILES:${PN}-plugins += "${libdir}/traceevent/plugins"
Signature · 1 line
2.35.3
#2 lore raw

Re: [OE-core][Patch v4 1/4] libtraceevent: import from meta-openembedded

Hi Max

I am seeing

The file /usr/lib/traceevent/plugins/plugin_cfg80211.so is installed by both perf and libtraceevent, aborting

When building sdk with both libtraceevent and perf added to image.

Quoted 110 lines · Max Krummenacher

From: Max Krummenacher <[email protected]>

Import from meta-openembedded at commit d250a0dc0 ("libtraceevent:
upgrade 1.7.1 -> 1.7.2").
Starting with kernel 6.4 libtraceevent is a dependency of perf. While one can still build perf without it by opting out one would loose its functionality compared with building perf from kernels before 6.4

---
 meta/conf/distro/include/maintainers.inc      |  1 +
 ...not-preserve-ownership-in-cp-command.patch | 40 +++++++++++++++++++
 .../libtraceevent/libtraceevent_1.7.2.bb      | 25 ++++++++++++
 3 files changed, 66 insertions(+)
 create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch
 create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb
meta/conf/distro/include/maintainers.inc +1 -0
index ec7ea90d16..3071671850 100644
@@ -402,6 +402,7 @@ RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool-cross = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool-native = "Robert Yang <[email protected]>"
+RECIPE_MAINTAINER:pn-libtraceevent = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-libtry-tiny-perl = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-libucontext = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-libunistring = "Anuj Mittal <[email protected]>"
meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch new file +40 -0
new file mode 100644
index 0000000000..5e88048817
@@ -0,0 +1,40 @@
+From ed0a31000305d937abe47c44d705b5b52bb36f79 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 22 Dec 2022 18:32:17 -0800
+Subject: [PATCH] makefile: Do not preserve ownership in cp command
+
+Fixes
+
+ERROR: libtraceevent-1.7.0-r0 do_package_qa: QA Issue: libtraceevent: /usr/lib/libtraceevent.a is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 965ff47..0e782cb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -287,7 +287,7 @@ $(BUILD_PREFIX): force
+       $(Q)$(call build_prefix,$(prefix))
+
+ define do_make_pkgconfig_file
+-      cp -f ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE};    \
++      install -m 0644 ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE};  \
+       sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE};            \
+       sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g" ${PKG_CONFIG_FILE}; \
+       sed -i "s|LIB_DIR|${libdir_relative}|g" ${PKG_CONFIG_FILE}; \
+@@ -335,7 +335,7 @@ install: install_libs install_plugins
+
+ install_libs: libs install_headers install_pkgconfig
+       $(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)); \
+-              cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
++              cp --no-preserve=ownership --recursive $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
+       $(Q)$(call install_ld_config)
+
+ install_pkgconfig: $(PKG_CONFIG_FILE)
+--
+2.39.0
+
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +25 -1
new file mode 100644
index 0000000000..089b6814c7
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "API to access the kernel tracefs directory"
+HOMEPAGE = "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/"
+LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
+LIC_FILES_CHKSUM = "file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \
+                    file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd"
+SECTION = "libs"
+
+SRCREV = "1c6f0f3b2bb47571fc455dc565dc343152517d98"
+SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;branch=${BPN};protocol=https \
+           file://0001-makefile-Do-not-preserve-ownership-in-cp-command.patch"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig
+
+do_install() {
+    oe_runmake install DESTDIR=${D} pkgconfig_dir=${libdir}/pkgconfig
+}
+
+PACKAGES += "${PN}-plugins"
+
+FILES:${PN}-plugins += "${libdir}/traceevent/plugins"
--

2.35.3

#3 lore raw

Re: [OE-core][Patch v4 1/4] libtraceevent: import from meta-openembedded

Hi Khem

Quoted 8 lines · Khem Raj

Hi Max

I am seeing

The file /usr/lib/traceevent/plugins/plugin_cfg80211.so is installed by both perf and libtraceevent, aborting

When building sdk with both libtraceevent and perf added to image.

I didn't test anything SDK with this patchset. Sorry.

I'm currently on vacation and not able to do real OE work.

I guess the quickest way out would be to remove in perf.bb libtraceevent from the enabled packageconfigs.

I expect perf from kernels before 6.4 to work as before the patchset and perf at 6.4 to not fail to build, albeit without traceevent support.

Does this sound like a plan?
Max

Quoted 2 lines

On Thu, May 11, 2023 at 4:22 PM Max Krummenacher <[email protected]>

Quoted 9 lines · wrote:
Quoted 9 lines

From: Max Krummenacher <[email protected]>

Import from meta-openembedded at commit d250a0dc0 ("libtraceevent:
upgrade 1.7.1 -> 1.7.2").
Starting with kernel 6.4 libtraceevent is a dependency of perf. While one can still build perf without it by opting out one would loose its functionality compared with building perf from kernels before 6.4

Quoted 7 lines
Quoted 7 lines
---
 meta/conf/distro/include/maintainers.inc      |  1 +
 ...not-preserve-ownership-in-cp-command.patch | 40 +++++++++++++++++++
 .../libtraceevent/libtraceevent_1.7.2.bb      | 25 ++++++++++++
 3 files changed, 66 insertions(+)
 create mode 100644

meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch

Quoted 1 line
Quoted 1 line
 create mode 100644 meta/recipes-kernel/libtraceevent/

libtraceevent_1.7.2.bb

Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

b/meta/conf/distro/include/maintainers.inc

Quoted 4 lines

meta/conf/distro/include/maintainers.inc RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal <

Quoted 4 lines

index ec7ea90d16..3071671850 100644

meta/conf/distro/include/maintainers.inc +0 -0
@@ -402,6 +402,7 @@ RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal <

[email protected]>"

Quoted 2 lines

meta/conf/distro/include/maintainers.inc RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal < · line 403

Quoted 2 lines
meta/conf/distro/include/maintainers.inc +0 -0
 RECIPE_MAINTAINER:pn-libtool = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool-cross = "Robert Yang <

[email protected]>"

Quoted 1 line

meta/conf/distro/include/maintainers.inc RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal < · line 404

Quoted 1 line
meta/conf/distro/include/maintainers.inc +0 -0
 RECIPE_MAINTAINER:pn-libtool-native = "Robert Yang <

[email protected]>"

Quoted 1 line

meta/conf/distro/include/maintainers.inc RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal < · line 405

Quoted 1 line
meta/conf/distro/include/maintainers.inc +1 -0
+RECIPE_MAINTAINER:pn-libtraceevent = "Bruce Ashfield <

[email protected]>"

Quoted 1 line

meta/conf/distro/include/maintainers.inc RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal < · line 406

Quoted 1 line
meta/conf/distro/include/maintainers.inc +0 -0
 RECIPE_MAINTAINER:pn-libtry-tiny-perl = "Tim Orling <

[email protected]>"

Quoted 4 lines

meta/conf/distro/include/maintainers.inc RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal < · line 408

Quoted 2 lines
meta/conf/distro/include/maintainers.inc +0 -0
 RECIPE_MAINTAINER:pn-libucontext = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-libunistring = "Anuj Mittal <[email protected]

"

Quoted 1 line

diff --git

a/meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch b/meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch

Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 0000000000..5e88048817
--- /dev/null
+++

b/meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch

Quoted 9 lines

meta/conf/distro/include/maintainers.inc line 8

Quoted 9 lines
meta/conf/distro/include/maintainers.inc +8 -0
@@ -0,0 +1,40 @@
+From ed0a31000305d937abe47c44d705b5b52bb36f79 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 22 Dec 2022 18:32:17 -0800
+Subject: [PATCH] makefile: Do not preserve ownership in cp command
+
+Fixes
+
+ERROR: libtraceevent-1.7.0-r0 do_package_qa: QA Issue: libtraceevent:

/usr/lib/libtraceevent.a is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]

Quoted 9 lines
Quoted 9 lines
meta/conf/distro/include/maintainers.inc +9 -0
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 965ff47..0e782cb 100644
Quoted 8 lines

meta/conf/distro/include/maintainers.inc line 25

Quoted 8 lines
meta/conf/distro/include/maintainers.inc +8 -0
+--- a/Makefile
++++ b/Makefile
+@@ -287,7 +287,7 @@ $(BUILD_PREFIX): force
+       $(Q)$(call build_prefix,$(prefix))
+
+ define do_make_pkgconfig_file
+-      cp -f ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE};    \
++      install -m 0644 ${PKG_CONFIG_SOURCE_FILE}.template

${PKG_CONFIG_FILE}; \

Quoted 2 lines

meta/conf/distro/include/maintainers.inc line 27

Quoted 2 lines
meta/conf/distro/include/maintainers.inc +2 -0
+       sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE};            \
+       sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g"

${PKG_CONFIG_FILE}; \

Quoted 7 lines

meta/conf/distro/include/maintainers.inc line 34

Quoted 7 lines
meta/conf/distro/include/maintainers.inc +7 -0
+       sed -i "s|LIB_DIR|${libdir_relative}|g" ${PKG_CONFIG_FILE}; \
+@@ -335,7 +335,7 @@ install: install_libs install_plugins
+
+ install_libs: libs install_headers install_pkgconfig
+       $(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)); \
+-              cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
++              cp --no-preserve=ownership --recursive $(LIB_INSTALL)

$(DESTDIR)$(libdir_SQ)

Quoted 7 lines

Review

Quoted 7 lines
meta/conf/distro/include/maintainers.inc +6 -0
+       $(Q)$(call install_ld_config)
+
+ install_pkgconfig: $(PKG_CONFIG_FILE)
+--
+2.39.0
+
(quoted diff) +0 -0

b/meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb

Quoted 10 lines

meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb line 5

Quoted 10 lines

new file mode 100644
index 0000000000..089b6814c7

meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +5 -0
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "API to access the kernel tracefs directory"
+HOMEPAGE = "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/

"

Quoted 2 lines

meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb line 7

Quoted 2 lines
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +2 -0
+LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
+LIC_FILES_CHKSUM =

"file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \

Quoted 1 line

meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb line 8

Quoted 1 line
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +1 -0
+

file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd"

Quoted 4 lines

meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb

Quoted 4 lines
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +4 -0
+SECTION = "libs"
+
+SRCREV = "1c6f0f3b2bb47571fc455dc565dc343152517d98"
+SRC_URI = "git://

git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;branch=${BPN};protocol=https \

Quoted 1 line

meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb line 13

Quoted 1 line
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +1 -0
+

file://0001-makefile-Do-not-preserve-ownership-in-cp-command.patch"

Quoted 16 lines
Quoted 15 lines
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +12 -1
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig
+
+do_install() {
+    oe_runmake install DESTDIR=${D} pkgconfig_dir=${libdir}/pkgconfig
+}
+
+PACKAGES += "${PN}-plugins"
+
+FILES:${PN}-plugins += "${libdir}/traceevent/plugins"
--

2.35.3

#4 lore raw

Re: [OE-core][Patch v4 1/4] libtraceevent: import from meta-openembedded

Quoted 16 lines · Max Krummenacher

Hi Khem

Quoted 8 lines · Khem Raj

Hi Max

I am seeing

The file /usr/lib/traceevent/plugins/plugin_cfg80211.so is installed by both perf and libtraceevent, aborting

When building sdk with both libtraceevent and perf added to image.

I didn't test anything SDK with this patchset. Sorry.

Quoted 7 lines

I'm currently on vacation and not able to do real OE work.

I guess the quickest way out would be to remove in perf.bb libtraceevent from the enabled packageconfigs.

I expect perf from kernels before 6.4 to work as before the patchset and perf at 6.4 to not fail to build, albeit without traceevent support.

Does this sound like a plan?

I think it might make sense to package them in

/usr/lib/${BPN}/plugins/

That makes space for both.

Quoted 114 lines

Max

Quoted 113 lines · Max Krummenacher
Quoted 110 lines

From: Max Krummenacher <[email protected]>

Import from meta-openembedded at commit d250a0dc0 ("libtraceevent:
upgrade 1.7.1 -> 1.7.2").
Starting with kernel 6.4 libtraceevent is a dependency of perf. While one can still build perf without it by opting out one would loose its functionality compared with building perf from kernels before 6.4

---
 meta/conf/distro/include/maintainers.inc      |  1 +
 ...not-preserve-ownership-in-cp-command.patch | 40 +++++++++++++++++++
 .../libtraceevent/libtraceevent_1.7.2.bb      | 25 ++++++++++++
 3 files changed, 66 insertions(+)
 create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch
 create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb
meta/conf/distro/include/maintainers.inc +1 -0
index ec7ea90d16..3071671850 100644
@@ -402,6 +402,7 @@ RECIPE_MAINTAINER:pn-libtirpc = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool-cross = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-libtool-native = "Robert Yang <[email protected]>"
+RECIPE_MAINTAINER:pn-libtraceevent = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-libtry-tiny-perl = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER:pn-libucontext = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-libunistring = "Anuj Mittal <[email protected]>"
meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch new file +40 -0
new file mode 100644
index 0000000000..5e88048817
@@ -0,0 +1,40 @@
+From ed0a31000305d937abe47c44d705b5b52bb36f79 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 22 Dec 2022 18:32:17 -0800
+Subject: [PATCH] makefile: Do not preserve ownership in cp command
+
+Fixes
+
+ERROR: libtraceevent-1.7.0-r0 do_package_qa: QA Issue: libtraceevent: /usr/lib/libtraceevent.a is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 965ff47..0e782cb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -287,7 +287,7 @@ $(BUILD_PREFIX): force
+       $(Q)$(call build_prefix,$(prefix))
+
+ define do_make_pkgconfig_file
+-      cp -f ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE};    \
++      install -m 0644 ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE};  \
+       sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE};            \
+       sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g" ${PKG_CONFIG_FILE}; \
+       sed -i "s|LIB_DIR|${libdir_relative}|g" ${PKG_CONFIG_FILE}; \
+@@ -335,7 +335,7 @@ install: install_libs install_plugins
+
+ install_libs: libs install_headers install_pkgconfig
+       $(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)); \
+-              cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
++              cp --no-preserve=ownership --recursive $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
+       $(Q)$(call install_ld_config)
+
+ install_pkgconfig: $(PKG_CONFIG_FILE)
+--
+2.39.0
+
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb new file +25 -1
new file mode 100644
index 0000000000..089b6814c7
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "API to access the kernel tracefs directory"
+HOMEPAGE = "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/"
+LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
+LIC_FILES_CHKSUM = "file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \
+                    file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd"
+SECTION = "libs"
+
+SRCREV = "1c6f0f3b2bb47571fc455dc565dc343152517d98"
+SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;branch=${BPN};protocol=https \
+           file://0001-makefile-Do-not-preserve-ownership-in-cp-command.patch"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig
+
+do_install() {
+    oe_runmake install DESTDIR=${D} pkgconfig_dir=${libdir}/pkgconfig
+}
+
+PACKAGES += "${PN}-plugins"
+
+FILES:${PN}-plugins += "${libdir}/traceevent/plugins"
--

2.35.3

#5 lore raw

PATCH v4 2/4 libtraceevent: fix qa issue reference to tmpdir

In reply to Max Krummenacher

From: Max Krummenacher <[email protected]>

Make sure that the OE provided CFLAGS are passed to the compiler so that the -fdebug-prefix-map and -fmacro-prefix-map options are actually active.

Fixes:
| WARNING: libtraceevent-1.7.2-r0 do_package_qa: QA Issue: File /usr/lib/libtraceevent.a in package libtraceevent-staticdev contains reference to TMPDIR [buildpaths] | WARNING: libtraceevent-1.7.2-r0 do_package_qa: QA Issue: File /usr/lib/.debug/libtraceevent.so.1.7.2 in package libtraceevent-dbg contains reference to TMPDIR [buildpaths]

---
 meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.2.bb +2 -0
index 089b6814c7..b5c0834d89 100644
@@ -14,6 +14,8 @@ SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;branch=$
 
 S = "${WORKDIR}/git"
 
+export EXTRA_CFLAGS = "${CFLAGS}"
+
 inherit pkgconfig
 
 do_install() {
Signature · 1 line
2.35.3
#6 lore raw

PATCH v4 3/4 perf: make pkg-config available

In reply to Max Krummenacher

From: Max Krummenacher <[email protected]>

Fixup the to be called pkg-config as $(CROSS_COMPILE)pkg-config doesn't exist.
With kernels < 6.4 pkg-config is only used for the gtk+-2.0 integration which is disabled in the OE config. Thus the issue wasn't exposed so far. With kernel 6.4 pkg-config is additionally used for libtraceevent and libtracefs.

---
 meta/recipes-kernel/perf/perf.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-kernel/perf/perf.bb +2 -0
index 2f28d16fba..80199a4515 100644
@@ -87,6 +87,7 @@ EXTRA_OEMAKE = '\
     perfexecdir=${libexecdir} \
     NO_GTK2=1 \
     ${PACKAGECONFIG_CONFARGS} \
+    PKG_CONFIG=pkg-config \
     TMPDIR="${B}" \
     LIBUNWIND_DIR=${STAGING_EXECPREFIXDIR} \
 '
@@ -287,6 +288,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
#7 lore raw

PATCH v4 4/4 perf: add libtraceevent packageconfig

In reply to 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 build libtraceevent as provided by the kernel sources. (Unless LIBTRACEEVENT_DYNAMIC=1 was defined, then it tried to pickup an external provided libtraceevent and printed a warning if not found.)

Add a libtraceevent packageconfig which adds the dependency on libtraceevent if set, otherwise builds with NO_LIBTRACEEVENT=1. For older kernels the old behaviour of building libtraceevent from the kernel sources isn't changed.

---
 meta/recipes-kernel/perf/perf.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-kernel/perf/perf.bb +2 -1
index 80199a4515..19f8aadaa0 100644
@@ -11,7 +11,7 @@ LICENSE = "GPL-2.0-only"
 
 PR = "r9"
 
-PACKAGECONFIG ??= "scripting tui libunwind"
+PACKAGECONFIG ??= "scripting tui libunwind libtraceevent"
 PACKAGECONFIG[dwarf] = ",NO_DWARF=1"
 PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python3 python3-setuptools-native"
 # gui support was added with kernel 3.6.35
@@ -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"
 
Signature · 1 line
2.35.3