Re: [Buildroot] [PATCH] package/heaptrack: new package

Thomas Petazzoni via buildroot <[email protected]> Fri, 31 Jul 2026 20:59:40 +0200
Newsgroups net.busybox.buildroot
Message-ID <amzvreeFgp0eJyM4@windsurf>
Hello,

On Fri, Jul 31, 2026 at 07:25:35PM +0200, Luca Ceresoli wrote:

> diff --git a/package/heaptrack/Config.in b/package/heaptrack/Config.in
> new file mode 100644
> index 000000000000..ea54195c9318
> --- /dev/null
> +++ b/package/heaptrack/Config.in
> @@ -0,0 +1,26 @@
> +config BR2_PACKAGE_HEAPTRACK
> +	bool "heaptrack"
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	depends on BR2_LINUX_KERNEL

You also need to replicate the "depends on" the things you select, so:

	depends on BR2_TOOLCHAIN_HAS_THREADS # boost, libunwind, elfutils
	depends on BR2_USE_WCHAR # boost, elfutils
	depends on BR2_PACKAGE_LIBUNWIND_ARCH_SUPPORTS
	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # libunwind
	depends on !BR2_STATIC_LIBS # libunwind, elfutils

Also, I'm curious about the BR2_LINUX_KERNEL dependency. heaptrack
builds its own kernel modules?

> +	select BR2_PACKAGE_BOOST
> +	select BR2_PACKAGE_BOOST_IOSTREAMS
> +	select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
> +	# For heaptrack_print
> +	select BR2_PACKAGE_BOOST_FILESYSTEM
> +	select BR2_PACKAGE_LIBUNWIND
> +	select BR2_PACKAGE_ZLIB
> +	select BR2_PACKAGE_ELFUTILS

Also, these selects should be sorted alphabetically.

> +	help
> +	  Heaptrack traces all memory allocations and annotates these
> +	  events with stack traces. Dedicated analysis tools then allow
> +	  you to interpret the heap memory profile to find hotspots,
> +	  memory leaks, allocation hotspots and temporary allocations.
> +
> +	  Zstandard offers better (de)compression performance compared
> +	  with gzip/zlib, making heaptrack faster and datafiles smaller,
> +	  so enabling BR2_PACKAGE_ZSTD is recommended.
> +
> +	  https://apps.kde.org/heaptrack/
> +
> +comment "heaptrack needs a toolchain w/ C++"
> +	depends on !BR2_INSTALL_LIBSTDCPP

This needs to be updated with the dependencies above.

> diff --git a/package/heaptrack/heaptrack.hash b/package/heaptrack/heaptrack.hash
> new file mode 100644
> index 000000000000..d9eb6010ac18
> --- /dev/null
> +++ b/package/heaptrack/heaptrack.hash
> @@ -0,0 +1 @@
> +sha256  e69de2209ab0e16c8e26c1b60feeb852b3a88e46a4f16588c08254e1bd81a183  heaptrack-3e6cce3d210a6672fe6f92de0bed567c49b7a9c5-git4.tar.gz

Add comment indicating the provenance of this hash.

Add the hashes of the license files.

> diff --git a/package/heaptrack/heaptrack.mk b/package/heaptrack/heaptrack.mk
> new file mode 100644
> index 000000000000..6349e7aeb04d
> --- /dev/null
> +++ b/package/heaptrack/heaptrack.mk
> @@ -0,0 +1,25 @@
> +################################################################################
> +#
> +# heaptrack
> +#
> +################################################################################
> +
> +HEAPTRACK_SITE_METHOD = git
> +HEAPTRACK_SITE = https://invent.kde.org/sdk/heaptrack.git
> +HEAPTRACK_VERSION = 3e6cce3d210a6672fe6f92de0bed567c49b7a9c5
> +HEAPTRACK_LICENSE = LGPL-2.1-or-later, GPL-2.0-or-later (heaptrack_interpret)
> +HEAPTRACK_LICENSE_FILES = LICENSES/LGPL-2.1-only.txt \
> +			  LICENSES/GPL-2.0-or-later.txt \
> +			  LICENSES/LGPL-2.1-or-later.txt \
> +			  LICENSES/BSL-1.0.txt \
> +			  LICENSES/MIT.txt \
> +			  LICENSES/Apache-2.0.txt \
> +			  LICENSES/BSD-3-Clause.txt

One tab indentation for follow-up lines is enough.

> +HEAPTRACK_DEPENDENCIES = host-pkgconf linux boost libunwind zlib elfutils
> +HEAPTRACK_CONF_OPTS += -DHEAPTRACK_BUILD_GUI=OFF -DHEAPTRACK_BUILD_PRINT=ON
> +
> +ifeq ($(BR2_PACKAGE_ZSTD),y)
> +HEAPTRACK_DEPENDENCIES += zstd
> +endif
> +
> +$(eval $(cmake-package))
> 
> ---
> base-commit: 9bc585a804b2ce7b5f82f538f6108cca27c3116a
> change-id: 20260731-heaptrack-cd4f6f8fcec8

Would it be difficult to add a test case in support/testing/?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot