Skip to content

DAOS-18857 build: Support of Gperftools Heap Profiler#18068

Draft
knard38 wants to merge 4 commits intomasterfrom
ckochhof/dev/master/daos-18857/patch-001
Draft

DAOS-18857 build: Support of Gperftools Heap Profiler#18068
knard38 wants to merge 4 commits intomasterfrom
ckochhof/dev/master/daos-18857/patch-001

Conversation

@knard38
Copy link
Copy Markdown
Contributor

@knard38 knard38 commented Apr 21, 2026

Description

Adds optional heap profiling support to DAOS by integrating the Gperftools TCMalloc library. A new HEAP_PROFILER SCons build option allows linking DAOS executables (e.g. daos_engine) with libtcmalloc to enable heap profiling.

Changes

Build system (site_scons/): New HEAP_PROFILER=true SCons boolean option that links -ltcmalloc. Enforces mutual exclusion with Google Sanitizers at build time. Strips the flag from unit test environments to avoid corrupted test output.

Packaging (utils/rpms/, utils/scripts/, ci/): Adds gperftools-devel (EL/SUSE) or libgoogle-perftools-dev (Ubuntu) across all supported distros and RPM build definitions. Bumps daos.spec release to 3.

Documentation (docs/dev/development.md): Documents the HEAP_PROFILER build option and the alternative runtime approach via LD_PRELOAD=libtcmalloc.so + HEAPPROFILE env vars (no recompile needed).

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Ticket title is 'Support of Gperftools Heap Profiler'
Status is 'In Progress'
https://daosio.atlassian.net/browse/DAOS-18857

@knard38 knard38 force-pushed the ckochhof/dev/master/daos-18857/patch-001 branch from a636a1b to dcfc328 Compare April 23, 2026 12:24
@knard38 knard38 changed the title DAOS-16501 build: Support of Gperftools Heap Profiler DAOS-18857 build: Support of Gperftools Heap Profiler Apr 23, 2026
@knard38 knard38 force-pushed the ckochhof/dev/master/daos-18857/patch-001 branch from dcfc328 to 18fa12e Compare April 23, 2026 12:28
Add a new HEAP_PROFILER SCons boolean option to optionally link DAOS
executables with the TCMalloc memory allocator from Gperftools, enabling
heap profiling of DAOS processes such as daos_engine.

When HEAP_PROFILER=true is set:
- DAOS executables are linked with -ltcmalloc.
- Google Sanitizers cannot be combined with the heap profiler (enforced
  at build time with a fatal error).
- The tcmalloc linker flag is stripped from unit test environments to
  avoid scrambling test output.

The Gperftools library can also be loaded at runtime via LD_PRELOAD
without recompiling, by setting LD_PRELOAD to libtcmalloc.so and the
relevant HEAPPROFILE env vars in daos_server.yml.

Add gperftools as a build dependency across all supported distributions:
- ci/unit/required_packages.sh and utils/scripts/install-*.sh: install
  gperftools-devel (EL/SUSE) or libgoogle-perftools-dev (Ubuntu).
- utils/rpms/package_info.sh: define distro-aware `gperftools_dev`
  variable for use in FPM packaging.
- utils/rpms/daos.sh: add `gperftools_dev` as a build dependency of
  the daos-devel package.
- utils/rpms/daos.spec: retain gperftools-devel BuildRequires (legacy
  spec path) and bump release to 3.
- utils/rpms/daos.changelog: add release 3 entry.

Document the Heap Profiler feature and usage in docs/dev/development.md.

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
@knard38 knard38 force-pushed the ckochhof/dev/master/daos-18857/patch-001 branch from 18fa12e to 7f4e9c4 Compare April 28, 2026 09:01
kanard38 added 3 commits May 4, 2026 06:49
Increment the DAOS release number.

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants