diff mbox series

[1/1] package/sysprof: needs headers >= 5.12

Message ID 20240721165023.1988603-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/sysprof: needs headers >= 5.12 | expand

Commit Message

Fabrice Fontaine July 21, 2024, 4:50 p.m. UTC
sysprof unconditionally uses PERF_RECORD_MISC_MMAP_BUILD_ID which is
only available since kernel 5.12 and
https://github.com/torvalds/linux/commit/88a16a1309333e43d328621ece3e9fa37027e8eb
resulting in the following build failure with kernel < 5.12 since bump
to version 46.0 in commit 0d57555407f2a0708515e7c377f57a6466c78b1b:

../src/libsysprof/sysprof-sampler.c: In function 'sysprof_sampler_perf_event_stream_cb':
../src/libsysprof/sysprof-sampler.c:186:33: error: 'PERF_RECORD_MISC_MMAP_BUILD_ID' undeclared (first use in this function); did you mean 'PERF_RECORD_MISC_MMAP_DATA'?
  186 |       if ((event->header.misc & PERF_RECORD_MISC_MMAP_BUILD_ID) != 0)
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 PERF_RECORD_MISC_MMAP_DATA

While at it, also fix a typo in "library"

Fixes: 0d57555407f2a0708515e7c377f57a6466c78b1b
 - http://autobuild.buildroot.org/results/9a9f8462bd1d7127dc80de7f280ab9d100db47fe

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/sysprof/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Thomas Petazzoni July 22, 2024, 12:32 p.m. UTC | #1
On Sun, 21 Jul 2024 18:50:23 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> sysprof unconditionally uses PERF_RECORD_MISC_MMAP_BUILD_ID which is
> only available since kernel 5.12 and
> https://github.com/torvalds/linux/commit/88a16a1309333e43d328621ece3e9fa37027e8eb
> resulting in the following build failure with kernel < 5.12 since bump
> to version 46.0 in commit 0d57555407f2a0708515e7c377f57a6466c78b1b:
> 
> ../src/libsysprof/sysprof-sampler.c: In function 'sysprof_sampler_perf_event_stream_cb':
> ../src/libsysprof/sysprof-sampler.c:186:33: error: 'PERF_RECORD_MISC_MMAP_BUILD_ID' undeclared (first use in this function); did you mean 'PERF_RECORD_MISC_MMAP_DATA'?
>   186 |       if ((event->header.misc & PERF_RECORD_MISC_MMAP_BUILD_ID) != 0)
>       |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                                 PERF_RECORD_MISC_MMAP_DATA
> 
> While at it, also fix a typo in "library"
> 
> Fixes: 0d57555407f2a0708515e7c377f57a6466c78b1b
>  - http://autobuild.buildroot.org/results/9a9f8462bd1d7127dc80de7f280ab9d100db47fe
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/sysprof/Config.in | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

5.12 is quite "recent", but OK if people care about sysprof on older
kernels, they can provide a patch that allows building sysprof on older
kernels. Applied, thanks!

Thomas
diff mbox series

Patch

diff --git a/package/sysprof/Config.in b/package/sysprof/Config.in
index be4f7653b0..32a5f99798 100644
--- a/package/sysprof/Config.in
+++ b/package/sysprof/Config.in
@@ -8,6 +8,7 @@  config BR2_PACKAGE_SYSPROF
 	depends on !BR2_STATIC_LIBS # libunwind, polkit
 	depends on !BR2_OPTIMIZE_FAST # polkit
 	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_12
 	select BR2_PACKAGE_JSON_GLIB
 	select BR2_PACKAGE_LIBDEX
 	select BR2_PACKAGE_LIBGLIB2
@@ -19,12 +20,13 @@  config BR2_PACKAGE_SYSPROF
 
 	  http://sysprof.com
 
-comment "sysprof needs a toolchain w/ dynamic libraray, wchar, threads, C++, gcc >= 7"
+comment "sysprof needs a toolchain w/ dynamic library, wchar, threads, C++, gcc >= 7, headers >= 5.12"
 	depends on BR2_USE_MMU
 	depends on BR2_PACKAGE_LIBUNWIND_ARCH_SUPPORTS
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \
-		BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP
+		BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_12
 
 comment "sysprof can't be built with Optimize for fast"
 	depends on BR2_OPTIMIZE_FAST