Skip to content

Enable compile/link time profiling#410

Open
greenc-FNAL wants to merge 2 commits intomainfrom
maintenance/enable-build-profiling
Open

Enable compile/link time profiling#410
greenc-FNAL wants to merge 2 commits intomainfrom
maintenance/enable-build-profiling

Conversation

@greenc-FNAL
Copy link
Contributor

No description provided.

@greenc-FNAL
Copy link
Contributor Author

@phlexbot cmake-fix

@github-actions
Copy link
Contributor

Automatic cmake-format fixes pushed (commit c2b60b7).
⚠️ Note: Some issues may require manual review and fixing.

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff           @@
##             main     #410   +/-   ##
=======================================
  Coverage   83.71%   83.71%           
=======================================
  Files         126      126           
  Lines        3291     3291           
  Branches      583      583           
=======================================
  Hits         2755     2755           
  Misses        325      325           
  Partials      211      211           
Flag Coverage Δ
unittests 83.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9890393...c2b60b7. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in CMake configuration to profile build-time behavior (compile and link), helping developers identify expensive translation units and link steps during Phlex builds.

Changes:

  • Introduces ENABLE_BUILD_PROFILING CMake option to wrap compile/link rules with cmake -E time.
  • Enables compile time tracing (-ftime-trace) for Clang/GNU toolchains when profiling is enabled.
  • Enables additional LLD link tracing/statistics flags when LLD is detected.

if(CMAKE_CXX_COMPILER_LINKER_ID STREQUAL "LLD")
message(STATUS "LLD detected (Phlex build) - Enabling tracing")
add_link_options("-Wl,--time-trace")
add_link_options("-Wl,--Map=phlex_link.map")
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Wl,--Map=phlex_link.map is added globally when build profiling is enabled. Since this project links multiple shared libraries/modules/executables in parallel, all link steps will try to write the same map file in the build directory, leading to races/overwrites (and potentially interleaved/corrupt output under parallel builds). Consider removing the global map generation, or emitting a per-target map file (e.g., via target-specific link options or a small helper that sets a unique map path per target).

Suggested change
add_link_options("-Wl,--Map=phlex_link.map")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants