Skip to content

[profiler] Integrate profiler-hub as its own subproject and package - #6922

Draft
avansick-amd wants to merge 10 commits into
mainfrom
users/avansick-amd/profiler-hub-integration
Draft

[profiler] Integrate profiler-hub as its own subproject and package#6922
avansick-amd wants to merge 10 commits into
mainfrom
users/avansick-amd/profiler-hub-integration

Conversation

@avansick-amd

@avansick-amd avansick-amd commented Jul 28, 2026

Copy link
Copy Markdown

Motivation

profiler-hub is a general-purpose, schema-versioned data storage library for profiling and tracing tools: it defines a common on-disk schema and a writer/reader API for storing trace, PMC, and profiling data, so multiple independent tools can share a single storage format instead of each implementing their own. It is designed to be built and consumed on its own, not as an implementation detail of any single tool.

TheRock currently only builds and packages profiling libraries as part of whichever specific tool happens to consume them. This PR gives profiler-hub its own subproject and its own package, so it is built and shipped as a standalone artifact — available to any current or future consumer, not tied to one. This PR intentionally does not touch rocprofiler-systems or any other consumer; wiring an actual consumer to profiler-hub is separate, follow-on work.

JIRA ID: ROCPDSNA-73

Technical Details

  • Declares profiler-hub as its own CMake subproject in profiler/CMakeLists.txt, gated by a new THEROCK_ENABLE_PROFILER_HUB feature flag, built from the rocm-systems submodule's profilers/profiler-hub subdirectory. Declares DISABLE_AMDGPU_TARGETS since profiler-hub is pure host C++ with no GPU/HIP code — without it, any CI stage building with zero AMDGPU targets selected hits a hard CMake configure error.
  • Adds a profiler/artifact-profiler-hub.toml artifact entry and registers it in BUILD_TOPOLOGY.toml (profiler-core group).
  • Adds profiler-hub as its own standalone deb/rpm package entry in build_tools/packaging/linux/package.json's amdrocm-profiler-base (lib/dev/run/doc) and amdrocm-profiler-test (test) packages, so the package is produced regardless of which consumer is also selected. Supporting changes in build_package.py, deb_package.py, and template/debian_rules.j2.
  • Adds packaging tests in build_tools/packaging/linux/tests/build_package_test.py.
  • Bumps the rocm-systems submodule forward onto its develop line to pull in the profiler-hub source together with the profiler-hub unit-test build fixes for the amd-llvm/ASAN toolchain (companion PR fix(profiler-hub): build profiler-hub_unit_tests under amd-llvm/ASAN toolchain rocm-systems#9367). This ancestry already includes the schema-API signature fix (#8610) that profiler-hub requires to compile against rocprofiler-sdk-rocpd. Once #9367 lands on develop, this pin advances forward to pick it up before merge.

Relationship to #6734: This is a clean, squashed reconstruction of the integration work originally staged in #6734. That PR's GitHub-rendered diff was inflated by a stale merge-base that repeatedly merged origin/main, dragging in ~50 unrelated upstream commits; the true net contribution is 9 files, presented here as four focused commits (subproject/artifact → deb/rpm package → packaging tests → submodule pin) on current main for easier review.

Test Plan

  • ninja profiler-hub builds standalone, producing libprofiler-hub.so, without building or touching rocprofiler-systems, with a clean configure.
  • Verified configure succeeds with zero AMDGPU targets selected (the DISABLE_AMDGPU_TARGETS path).
  • Rebuilt the profiler-hub artifact components (lib/dev/run/doc/dbg/test) and confirmed correct file placement (shared lib in lib, headers/static lib/cmake package config in dev).
  • Built a .deb via build_tools/packaging/linux/build_package.py --pkg-names amdrocm-profiler-base and confirmed via dpkg-deb --contents that the shared lib, static lib, headers, and CMake package config are present.
  • package.json validated with python3 -m json.tool; BUILD_TOPOLOGY.toml and artifact-profiler-hub.toml validated with tomllib.

Test Result

All of the above passed locally against a from-scratch reconfigure and rebuild. CI results pending on this PR.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass
Forbidden Files ✅ Pass
🧪 Unit Test ✅ Pass
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled
🤖 therock-pr-bot ✅ Pass

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@avansick-amd avansick-amd changed the title [profiler] Integrate profiler-hub as a standalone TheRock subproject (ROCPDSNA-73) [profiler] Integrate profiler-hub as its own subproject and package Jul 28, 2026

@marbre marbre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will need review feedback from different subteams. Can you split into build, testing (which seem to be missing) and packaging?

avansick-amd and others added 6 commits July 28, 2026 16:09
Address review feedback that testing appeared missing for the profiler-hub
packaging integration. Adds a standalone post-install smoke test that installs
the built amdrocm-profiler-base .deb and then configures, compiles, and runs a
trivial consumer via find_package(profiler-hub CONFIG) against the installed
CMake package config. This exercises the full consumer chain: find_package
resolution, header availability, link against libprofiler-hub.so, and runtime
NEEDED-dependency resolution.

Wired into the deb path of the multi-arch native-packages workflow, after the
simulated-install step.
Replaces the glob-based resolve_install_root (and its sorted()[-1]
lexicographic tie-break bug) with dpkg -L / staging rglob discovery
anchored on the profiler-hub-config.cmake key component. Adds pytest
unit tests. Supersedes the previous glob approach.
Forward-only bump onto Branch 1 tip 6d5d83820f; resolves the
stale-pin flag raised after the ASAN comment trim.
…ofiler-hub-integration

# Conflicts:
#	profiler/CMakeLists.txt
#	rocm-systems
…ps fix

Re-pins the rocm-systems submodule to include task 019's rewrite of the
profiler-hub-config.cmake find_dependency preamble (fatal find_dependency ->
conditional find_package + component-gated resolution), rebased cleanly onto
this branch's existing integration commit with zero conflicts. Purpose: get
a real CI verdict from Linux::release / Build DEB Packages, the exact job
currently failing on the spdlog find_dependency abort this fix targets.

Standing debt: while the pin points at this commit, this PR carries a design
that has not been through the team and must be re-pinned to a
develop-reachable commit before it can merge.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ofiler-hub-integration

# Conflicts:
#	rocm-systems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

2 participants