* [Buildroot] [PATCH v2 0/2] perf: add binutils support in new kernels
@ 2024-08-26 21:44 Sergey Matyukevich
2024-08-26 21:44 ` [Buildroot] [PATCH v2 1/2] package/linux-tools: perf: add explicit option for libbfd support Sergey Matyukevich
2024-08-26 21:44 ` [Buildroot] [PATCH v2 2/2] package: binutils: install libsframe to target Sergey Matyukevich
0 siblings, 2 replies; 5+ messages in thread
From: Sergey Matyukevich @ 2024-08-26 21:44 UTC (permalink / raw)
To: buildroot
Cc: Romain Naour, Giulio Benetti, Yann E . MORIN, Sergey Matyukevich
Hi all,
This patch series updates libbfd (binutils) support in perf for the
binutils >= 2.40 and the Linux kernels >= v6.4. New versions bring
the following changes:
- new kernels have a new 'opted out' perf build option for libbfd support
- new binutils provide new libsframe library
New libsframe library needs to be installed to the target images since
libbfd and libopcodes are linked against it. Perf recipe needs to be
updated to use new perf option for libbfd support in the new kernels.
Regards,
Sergey
v1 -> v2
- update help message for a new perf configuration option
- select binutils if libbfd perf support is enabled
- update commit message
Sergey Matyukevich (2):
package/linux-tools: perf: add explicit option for libbfd support
package: binutils: install libsframe to target
package/binutils/binutils.mk | 1 +
package/linux-tools/Config.in | 10 ++++++++++
package/linux-tools/linux-tool-perf.mk.in | 15 +++++++++------
3 files changed, 20 insertions(+), 6 deletions(-)
--
2.46.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v2 1/2] package/linux-tools: perf: add explicit option for libbfd support
2024-08-26 21:44 [Buildroot] [PATCH v2 0/2] perf: add binutils support in new kernels Sergey Matyukevich
@ 2024-08-26 21:44 ` Sergey Matyukevich
2025-01-21 18:40 ` Sergey Matyukevich
2024-08-26 21:44 ` [Buildroot] [PATCH v2 2/2] package: binutils: install libsframe to target Sergey Matyukevich
1 sibling, 1 reply; 5+ messages in thread
From: Sergey Matyukevich @ 2024-08-26 21:44 UTC (permalink / raw)
To: buildroot
Cc: Romain Naour, Giulio Benetti, Yann E . MORIN, Sergey Matyukevich
Before Linux v6.4, libbfd support in perf was opted in by default and
could be disabled using NO_LIBBFD=1. Starting from Linux v6.4, libbfd
support in perf is opted out by default and can be enabled with new
variable BUILD_NONDISTRO=1. For details see the kernel commit [1].
Linking perf against libbfd library may significantly speed up perf
report and script commands for data recorded with call-graph information
based on DWARF format. Without libbfd perf executes a new addr2line
process for every address it needs to look up. However perf linked
against libbfd may become undistributable since perf is licenced
under GPLv2 and binutils libraries are licenced under GPLv3+.
For more detais see Debian bug report [2].
This commit adds a new BR2_PACKAGE_LINUX_TOOLS_PERF_LIBBFD option to
perf to explicitly enable libbfd support when appropriate. Note that
enabling binutils in the configuration does not implicitly enable libbfd
support for perf anymore. Also note that if the new option is not
enabled in the configuration, then the legacy NO_DEMANGLE and NO_LIBBFD
options will be set for perf in order to explicitly disable libbfd
support in pre-v6.4 Linux kernels.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dd317df072071903031ab5f91b4823858445c4a0
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911815
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
package/linux-tools/Config.in | 10 ++++++++++
package/linux-tools/linux-tool-perf.mk.in | 15 +++++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in
index 5a38f6dafe..de89238bca 100644
--- a/package/linux-tools/Config.in
+++ b/package/linux-tools/Config.in
@@ -112,6 +112,16 @@ config BR2_PACKAGE_LINUX_TOOLS_PERF_TUI
enables zooming into DSOs and threads as well as other
features.
+config BR2_PACKAGE_LINUX_TOOLS_PERF_LIBBFD
+ bool "link perf against libbfd"
+ select BR2_PACKAGE_BINUTILS
+ help
+ Link perf against libbfd library from binutils. This option may
+ significantly speed up perf report and script commands for data
+ recorded with call-graph information based on DWARF debug format.
+ However the result is undistributable since perf is licenced
+ under GPLv2 and binutils libraries are licenced under GPLv3+.
+
config BR2_PACKAGE_LINUX_TOOLS_PERF_NEEDS_HOST_PYTHON3
bool "perf need python3 to build"
select BR2_PACKAGE_HOST_PYTHON3
diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in
index 65aba2e9fe..ea98e56450 100644
--- a/package/linux-tools/linux-tool-perf.mk.in
+++ b/package/linux-tools/linux-tool-perf.mk.in
@@ -67,6 +67,15 @@ else
PERF_MAKE_FLAGS += NO_NEWT=1 NO_SLANG=1
endif
+ifeq ($(BR2_PACKAGE_LINUX_TOOLS_PERF_LIBBFD),y)
+PERF_DEPENDENCIES += binutils
+# Explicitely enable for Linux >= v6.4
+PERF_MAKE_FLAGS += BUILD_NONDISTRO=1
+else
+# Explicitely disable for Linux < v6.4
+PERF_MAKE_FLAGS += NO_DEMANGLE=1 NO_LIBBFD=1
+endif
+
ifeq ($(BR2_PACKAGE_AUDIT),y)
PERF_DEPENDENCIES += audit
else
@@ -95,12 +104,6 @@ else
PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
endif
-ifeq ($(BR2_PACKAGE_BINUTILS),y)
-PERF_DEPENDENCIES += binutils
-else
-PERF_MAKE_FLAGS += NO_DEMANGLE=1
-endif
-
ifeq ($(BR2_PACKAGE_OPENSSL),y)
PERF_DEPENDENCIES += openssl
else
--
2.46.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v2 2/2] package: binutils: install libsframe to target
2024-08-26 21:44 [Buildroot] [PATCH v2 0/2] perf: add binutils support in new kernels Sergey Matyukevich
2024-08-26 21:44 ` [Buildroot] [PATCH v2 1/2] package/linux-tools: perf: add explicit option for libbfd support Sergey Matyukevich
@ 2024-08-26 21:44 ` Sergey Matyukevich
2026-10-11 13:46 ` Thomas Petazzoni via buildroot
1 sibling, 1 reply; 5+ messages in thread
From: Sergey Matyukevich @ 2024-08-26 21:44 UTC (permalink / raw)
To: buildroot
Cc: Romain Naour, Giulio Benetti, Yann E . MORIN, Sergey Matyukevich
Starting from v2.40, binutils provides libsframe, a library for
manipulating the SFRAME debug format. Buildroot installs libsframe
to the target image only if BR2_PACKAGE_BINUTILS_TARGET option is
enabled. However other dynamic libraries from binutils are linked
against libsframe, including libbfd and libopcodes. Any binary
linked dynamically against libbfd, e.g. perf, will need libsframe
as well. So libsframe should always be installed the target together
with other binutils libraries such as libbfd and libopcodes.
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
package/binutils/binutils.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk
index d98dd7b830..b459d4a271 100644
--- a/package/binutils/binutils.mk
+++ b/package/binutils/binutils.mk
@@ -120,6 +120,7 @@ ifneq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
define BINUTILS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(TARGET_DIR) install
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/opcodes DESTDIR=$(TARGET_DIR) install
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libsframe DESTDIR=$(TARGET_DIR) install
endef
endif
--
2.46.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH v2 1/2] package/linux-tools: perf: add explicit option for libbfd support
2024-08-26 21:44 ` [Buildroot] [PATCH v2 1/2] package/linux-tools: perf: add explicit option for libbfd support Sergey Matyukevich
@ 2025-01-21 18:40 ` Sergey Matyukevich
0 siblings, 0 replies; 5+ messages in thread
From: Sergey Matyukevich @ 2025-01-21 18:40 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN, Giulio Benetti, Romain Naour, Thomas Petazzoni
Hi all,
> Before Linux v6.4, libbfd support in perf was opted in by default and
> could be disabled using NO_LIBBFD=1. Starting from Linux v6.4, libbfd
> support in perf is opted out by default and can be enabled with new
> variable BUILD_NONDISTRO=1. For details see the kernel commit [1].
>
> Linking perf against libbfd library may significantly speed up perf
> report and script commands for data recorded with call-graph information
> based on DWARF format. Without libbfd perf executes a new addr2line
> process for every address it needs to look up. However perf linked
> against libbfd may become undistributable since perf is licenced
> under GPLv2 and binutils libraries are licenced under GPLv3+.
> For more detais see Debian bug report [2].
>
> This commit adds a new BR2_PACKAGE_LINUX_TOOLS_PERF_LIBBFD option to
> perf to explicitly enable libbfd support when appropriate. Note that
> enabling binutils in the configuration does not implicitly enable libbfd
> support for perf anymore. Also note that if the new option is not
> enabled in the configuration, then the legacy NO_DEMANGLE and NO_LIBBFD
> options will be set for perf in order to explicitly disable libbfd
> support in pre-v6.4 Linux kernels.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dd317df072071903031ab5f91b4823858445c4a0
> [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911815
>
> Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
> ---
> package/linux-tools/Config.in | 10 ++++++++++
> package/linux-tools/linux-tool-perf.mk.in | 15 +++++++++------
> 2 files changed, 19 insertions(+), 6 deletions(-)
Friendly ping. Any thoughs or comments regarding this one ?
Regards,
Sergey
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH v2 2/2] package: binutils: install libsframe to target
2024-08-26 21:44 ` [Buildroot] [PATCH v2 2/2] package: binutils: install libsframe to target Sergey Matyukevich
@ 2026-10-11 13:46 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-11 13:46 UTC (permalink / raw)
To: Sergey Matyukevich
Cc: buildroot, Romain Naour, Giulio Benetti, Yann E . MORIN
On Tue, Aug 27, 2024 at 12:44:24AM +0300, Sergey Matyukevich wrote:
> Starting from v2.40, binutils provides libsframe, a library for
> manipulating the SFRAME debug format. Buildroot installs libsframe
> to the target image only if BR2_PACKAGE_BINUTILS_TARGET option is
> enabled. However other dynamic libraries from binutils are linked
> against libsframe, including libbfd and libopcodes. Any binary
> linked dynamically against libbfd, e.g. perf, will need libsframe
> as well. So libsframe should always be installed the target together
> with other binutils libraries such as libbfd and libopcodes.
>
> Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
Applied to master, thanks!
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-13 17:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26 21:44 [Buildroot] [PATCH v2 0/2] perf: add binutils support in new kernels Sergey Matyukevich
2024-08-26 21:44 ` [Buildroot] [PATCH v2 1/2] package/linux-tools: perf: add explicit option for libbfd support Sergey Matyukevich
2025-01-21 18:40 ` Sergey Matyukevich
2024-08-26 21:44 ` [Buildroot] [PATCH v2 2/2] package: binutils: install libsframe to target Sergey Matyukevich
2026-10-11 13:46 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox