Skip to contentSkip to conversation

perf: Make built-in libtraceevent plugins cohabit with external libtraceevent

PATCH In review Khem Raj 2 participants 2 messages May 26, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 perf: Make built-in libtraceevent plugins cohabit with external libtraceevent

This will package the plugins built by perf into kernel specific dir under libdir, so it does not conflict with plugins from newly added libtraceevent recipe

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

Cc Max Krummenacher <[email protected]>

---
v2: Check if files exist before sed'ing them

 meta/recipes-kernel/perf/perf.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-kernel/perf/perf.bb +5 -1
index 67b01a7f65a..2d803381bb4 100644
@@ -137,6 +137,10 @@ PERF_EXTRA_LDFLAGS:mipsarchn64el = "-m elf64ltsmip"
 do_compile() {
 	# Linux kernel build system is expected to do the right thing
 	unset CFLAGS
+        test -e ${S}/tools/lib/traceevent/plugins/Makefile && \
+            sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/lib/traceevent/plugins/Makefile
+	test -e ${S}/tools/perf/Makefile.config && \
+            sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/perf/Makefile.config
 	oe_runmake all
 }
 
@@ -364,7 +368,7 @@ RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}
 RSUGGESTS:${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
 
 FILES_SOLIBSDEV = ""
-FILES:${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent ${libdir}/libperf-jvmti.so"
+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"
 FILES:${PN}-tests = "${libdir}/perf/perf-core/tests ${libexecdir}/perf-core/tests"
 FILES:${PN}-python = " \
Signature · 1 line
2.40.1
#1 lore raw
Quoted 6 lines · Khem Raj

This will package the plugins built by perf into kernel specific dir under libdir, so it does not conflict with plugins from newly added libtraceevent recipe

Fixes
do_sdk_depends: The file /usr/lib/traceevent/plugins/plugin_cfg80211.so

is installed by both perf and libtraceevent, aborting

meta/recipes-kernel/perf/

Quoted 10 lines
Cc Max Krummenacher <[email protected]>

---
v2: Check if files exist before sed'ing them

 meta/recipes-kernel/perf/perf.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-kernel/perf/ renamed from meta/recipes-kernel/perf/perf.bb +0 -0

perf.bb

meta/recipes-kernel/perf/perf.bb PERF_EXTRA_LDFLAGS:mipsarchn64el = "-m elf64ltsmip" · line 141

Quoted 9 lines

index 67b01a7f65a..2d803381bb4 100644

meta/recipes-kernel/perf/perf.bb +2 -0
@@ -137,6 +137,10 @@ PERF_EXTRA_LDFLAGS:mipsarchn64el = "-m elf64ltsmip"
 do_compile() {
        # Linux kernel build system is expected to do the right thing
        unset CFLAGS
+        test -e ${S}/tools/lib/traceevent/plugins/Makefile && \
+            sed -i -e

's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/lib/traceevent/plugins/Makefile

meta/recipes-kernel/perf/perf.bb PERF_EXTRA_LDFLAGS:mipsarchn64el = "-m elf64ltsmip" · line 143

Quoted 2 lines
meta/recipes-kernel/perf/perf.bb +2 -0
+       test -e ${S}/tools/perf/Makefile.config && \
+            sed -i -e

's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/perf/Makefile.config

meta/recipes-kernel/perf/perf.bb RSUGGESTS_SCRIPTING =

Quoted 4 lines
meta/recipes-kernel/perf/perf.bb +0 -0
        oe_runmake all
 }
 
@@ -364,7 +368,7 @@ RSUGGESTS_SCRIPTING =

"${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}

meta/recipes-kernel/perf/perf.bb RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}

Quoted 4 lines
meta/recipes-kernel/perf/perf.bb +0 -1
 RSUGGESTS:${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
 
 FILES_SOLIBSDEV = ""
-FILES:${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core

${libdir}/traceevent ${libdir}/libperf-jvmti.so"

meta/recipes-kernel/perf/perf.bb RSUGGESTS_SCRIPTING = · line 371

Quoted 1 line
meta/recipes-kernel/perf/perf.bb +1 -0
+FILES:${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core

${libdir}/traceevent* ${libdir}/libperf-jvmti.so"

meta/recipes-kernel/perf/perf.bb RSUGGESTS_SCRIPTING = · line 373

Quoted 2 lines
meta/recipes-kernel/perf/perf.bb +0 -0
 FILES:${PN}-archive = "${libdir}/perf/perf-core/perf-archive"
 FILES:${PN}-tests = "${libdir}/perf/perf-core/tests

${libexecdir}/perf-core/tests"

Quoted 5 lines
meta/recipes-kernel/perf/perf.bb +0 -1
 FILES:${PN}-python = " \
--

2.40.1

LGTM
Thanks for the fix Khem.
Regards
Max