Skip to content

[rocprofiler-systems] Serialize trace cache records through archives - #14025

Merged
adjordje-amd merged 27 commits into
developfrom
users/adjordje-amd/trace-cache-archives
Nov 3, 2026
Merged

adjordje-amd merged 27 commits into
developfrom
users/adjordje-amd/trace-cache-archives

Conversation

@adjordje-amd

@adjordje-amd adjordje-amd commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Every record written to the trace cache lists its fields three times: in a serialize, a deserialize and a get_size template specialization. The three lists must stay identical by hand. If they drift, the cache data is corrupted silently. This PR replaces the three lists with one member function per record, in the style of the cereal library. The byte format stays the same, except that a gpu_perf_counter record grows by 4 bytes (item 18). The cache is a temporary file written and read by the same binary, so no compatibility is needed.

Technical Details

  1. test: pin the trace cache record byte format: core/trace_cache/tests/test_record_format.cpp.
    • Golden byte tests for all 14 record types, plus the empty-optional variants of pmc_event_with_sample and kfd_sample (16 tests).
    • The expected bytes were generated from the existing code.
    • Each test checks get_size, the exact bytes, that deserialize consumes all of them, and that re-serializing gives the same bytes.
    • Unlike round-trip tests, these also fail when a field is reordered or dropped in both write and read.
  2. feat: add trace cache archives: core/trace_cache/archive.hpp.
    • binary_size_archive, binary_write_archive and binary_read_archive, plus the archive_record concept and record_size / record_write / record_read.
    • The archives call the existing utility encoding functions, so the bytes are the same by construction.
    • A std::span<const std::byte> field is read back as a view into the buffer.
    • Records whose read layout differs from their write layout branch on Archive::k_is_loading.
    • Unit tests in tests/test_archive.cpp.
  3. refactor: serialize trace cache records through archives:
    • Every record gets one template <typename Archive> void serialize(Archive& archive) that lists its fields in byte order.
    • The 42 record specializations and the 15 in the test mocks are deleted.
    • cache_type_traits.hpp loses the primary templates and the old concepts.
    • archive.hpp provides one generic get_size / serialize / deserialize and type_traits::cacheable.
  4. refactor: let nested PMC metric types serialize themselves:
    • The archives recurse into any value that has a member serialize(Archive&).
    • gpu::metrics, nic::metrics, hipfile::metrics, cpu::process_metrics and the enabled_metrics unions list their own fields, so the collector records become archive(enabled_metric, device_id, timestamp, metric_values).
  5. perf: keep trace cache archive state in registers:
    • The archive members work on local copies of buffer / position / cursor. A write through the uint8_t buffer may alias them, which forced a reload after every field.
    • record_size / record_write / record_read are flattened, so each record type gets one fully inlined function, as the old specializations had.
  6. perf: iterate gpu_perf_counter entries with a range-for: the index loop re-read the vector's begin / end after every entry, for the same aliasing reason.
  7. perf: default-initialize the record read from the cache: T record; instead of T record{}, as the old deserializers did. Zeroing the record first kept it in memory and made the copy into the parser's std::variant stall.
  8. refactor: use plain inline and [[gnu::flatten]] in archives: no ROCPROFSYS_INLINE. The generated code is unchanged, and clang-format now lays out the declarations correctly.
  9. perf: build records in place in the type registry: the deserializer returns the std::optional and constructs the record inside it (a reader object converts to T by reading it), so get_type() no longer copies every record into a variant and then into the optional.
  10. style: trim comments in the trace cache archives: comment-only.
  11. feat: check trace cache type identifiers at compile time: type_registry no longer compiles when two record types share a type_identifier. Before, the later registration silently replaced the earlier deserializer.
  12. refactor: remove unused tuple_to_variant trait: nothing used it. type_registry.hpp now includes <variant> itself.
  13. refactor: drop the variadic utility helpers and the record_* layer: the multi-value utility::get_size / store_value / parse_value overloads were only used by tests. get_size, serialize and deserialize carry [[gnu::flatten]] themselves instead of forwarding to record_size / record_write / record_read. The generated code is unchanged.
  14. test: pin the per-core CPU entry bytes in the golden test: the cpu_pmc_sample golden test packs two real cores instead of two arbitrary bytes.
  15. refactor: name the archive per-value helpers after what they do: size_one / write_one / read_one become measure_value / write_value / read_value.
  16. refactor: serialize the record header like the records: the [type id][size] header was written by hand in store() and fragment_memory(), read through a packed struct in storage_parser, and sized by a separate formula. record_header now defines it once; k_header_size is computed from it at compile time, and store() writes header and record with one flattened write_record(). The header bytes are unchanged.
  17. perf: read cached vectors with one memcpy: utility::parse_value read vectors element by element with push_back (byte by byte for the CPU sample); it now resizes once and copies the payload. Vector write and read static_assert that the element type is trivially copyable.
  18. refactor: cache gpu_perf_counter entries as one vector: counter_value (8-byte id + 8-byte double) has no padding, so the entries are written as one vector instead of a uint32_t count and a per-entry loop; a static_assert keeps it padding-free. The prefix becomes the archive's size_t byte count (+4 bytes per record); the golden test is updated.
  19. refactor: cache std::string and enums directly, drop k_is_loading: archives accept std::string (same encoding as std::string_view) and enums (their underlying integer). The nic device name and the record header type are written directly, so Archive::k_is_loading and its test are removed.

Issue Tracking

JIRA ID: AIPROFSYST-204

Test Plan

  • rocprof-sys-unit-tests:

    • golden format tests, including the record header (expected bytes untouched by the refactor commits, except item 14, which replaced the CPU test input with real per-core entries, and item 18, the intended gpu_perf_counter prefix change);
    • archive tests;
    • compile-time checks of the unique type identifier helper (static_assert in test_type_registry.cpp);
    • the existing serialization tests (test_sample_type, test_cacheable, the collector test_sample);
    • the storage tests (test_type_registry, test_storage_parser, test_buffer_storage, test_cache_integration).
  • Mutation checks:

    • swapping two fields of memory_copy_sample, and of nic::metrics, in both write and read makes the golden test fail;
    • the existing round-trip tests still pass under that swap.
  • Full project build; clang-tidy on all changed lines; clang-format-18.

  • End to end on a local GPU: transpose, scratch-memory and roctx run with the develop build and with this branch, with these enabled:

    • tracing and rocpd;
    • process sampling, AMD SMI GPU metrics and CPU metrics;
    • the ROCm domains hip_runtime_api, marker_api, kernel_dispatch, memory_copy, scratch_memory, memory_allocation and kfd_events.

    The two outputs were compared.

Test Result

  • Unit tests: 1958 passed before the PR; 1982 passed after it (1958 + 17 golden + 7 archive), with 0 failures. Each commit builds and passes on its own.
  • clang-tidy: no warnings on changed lines, except the existing type_identifier naming convention in the new test structs.
  • End to end, all three apps:
    • identical: kernel names and counts, HIP API and stream slices, memory copies and allocations, scratch memory, KFD events, roctx/marker regions, all rocpd_info_pmc rows, and the set of counter tracks and PMC event names;
    • roctx: identical in every table;
    • other apps: only sampling-driven counts differ (samples, PMC events, sampled call stacks), because the develop build was a Debug build.
  • Not run: the ctest integration suite (examples are not built in this configuration).

Submission Checklist

Golden byte tests for every trace cache record type (14 types, plus the
empty-optional variants of pmc_event_with_sample and kfd_sample). Each test
checks get_size, the exact serialized bytes, that deserialize consumes all
of them and that re-serializing the decoded record gives the same bytes.

The expected bytes were generated from the current serialization code, so
a later refactor of the serialization must keep them unchanged. Unlike the
existing round-trip tests, these also catch a field reordered or dropped
symmetrically in both serialize and deserialize.
Add core/trace_cache/archive.hpp: binary_size_archive, binary_write_archive
and binary_read_archive, the archive_record concept and record_size /
record_write / record_read. A record lists its fields once, in byte order,
in a member template serialize(Archive&); the three archives measure, write
and read those fields through the existing utility encoding functions, so
the byte format is unchanged. A std::span<const std::byte> field is read
back as a view into the buffer. Records whose read layout differs from the
write layout branch on Archive::k_is_loading.

Nothing uses the archives yet; the per-record serialize / deserialize /
get_size specializations are converted in a follow-up commit.
…archives

Every trace cache record listed its fields three times, in hand-written
serialize / deserialize / get_size specializations that had to stay in
sync. Each record now lists its fields once, in byte order, in a member
template serialize(Archive&) that the archives use to measure, write and
read it.

- All 14 record types (sample_type.hpp and the cpu, gpu, nic, hipfile and
  gpu_perf_counter collector samples) and the 5 test mocks are converted;
  their 42 + 15 specializations are deleted.
- pmc_event_with_sample serializes its in_time_sample base first.
- nic::sample copies device_name back on read; gpu_perf_counter::sample
  writes a count and resizes its entries on read (Archive::k_is_loading).
- cache_type_traits.hpp loses the primary templates and the
  serializable / deserializable / has_get_size / cacheable concepts;
  archive.hpp provides one generic get_size / serialize / deserialize and
  type_traits::cacheable, so buffer_storage and type_registry are unchanged.

The byte format is unchanged: the golden record format tests pass without
modification.
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

rocprofiler-systems CI Summary

Test Results (for commit 93dc5d8)

Workflow jobs covered: 34

Workflow Runs Avg Test Time Tests Skipped Failed
Ubuntu 22.04 5 32m 01s 3,075 135 0
Ubuntu 24.04 5 31m 41s 2,955 135 0
Debian 4 41m 14s 2,460 98 0
RHEL 11 38m 19s 6,765 338 0
System deps 9 32m 09s 5,535 247 0
Total 34 35m 07s 20,790 953 0

Failed Tests

No failed tests reported.

Sanitizers

Thread Undefined Address
Passed Passed Passed

@therock-pr-bot

therock-pr-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 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

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

…themselves

The archives now recurse into any value that has a member
serialize(Archive&), so a nested struct lists its own fields once instead
of every record spelling out its members.

- gpu::metrics, nic::metrics, hipfile::metrics and cpu::process_metrics
  get a serialize member with their fields in the existing byte order;
  the enabled_metrics unions serialize their value. hipfile::metrics keeps
  the comment on why query_failed is not stored.
- The cpu, gpu, nic and hipfile records become
  archive(enabled_metric, device_id, timestamp, metric_values).
- Containers keep their existing encoding; the archives do not recurse
  into their elements.

The byte format is unchanged: the golden record format tests pass without
modification.
A benchmark of every record type against develop showed the archives
slower than the hand-written code they replaced (serialize median +72%,
deserialize +128%; e.g. kernel_dispatch_sample deserialize 1.2 -> 12.5 ns).
Two causes, both visible in the generated code:

- GCC at -O2 did not inline the variadic archive operator(), so every
  field was passed by address to an out-of-line call.
- The archive's buffer/position/cursor were accessed through a reference
  inside the record's serialize(). A write through the uint8_t buffer may
  alias them, so they were reloaded and stored back after every field and
  adjacent copies could not be merged.

Fix, in archive.hpp only:
- operator(), the per-value helpers and the generic get_size / serialize /
  deserialize are ROCPROFSYS_INLINE.
- operator() works on local copies of buffer/position/cursor and writes
  them back once (synced around a nested serialize()).
- record_size / record_write / record_read are __attribute__((flatten)),
  so each record type gets one function with its serialize() inlined, like
  the old specializations.

kernel_dispatch_sample now reads in 23 instructions with merged 16-byte
copies (develop: 77) and writes in 38 (develop: 39). Medians against
develop: serialize -1.8%, deserialize +0.6%. Byte format unchanged.

Also use the deserialize result in a gpu_perf_counter test that ignored
it (deserialize is [[nodiscard]] since the archive conversion).
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Report

Code Coverage Report

Unit Tests

Lines: 🔴 27.0% (📉 -3.83% vs base) — 8,871/32,871 across 324 files
Functions: 🔴 25.8% — 873/3,390

🔴 0-20% (168 files)
Lines Functions File
0.0% 0/106 0/9 source/bin/common/argument_registration.hpp
0.0% 0/267 0/28 source/bin/common/tool_runner.cpp
0.0% 0/992 0/48 source/bin/rocprof-sys-avail/avail.cpp
0.0% 0/60 0/6 source/bin/rocprof-sys-avail/avail.hpp
0.0% 0/223 0/24 source/bin/rocprof-sys-avail/common.cpp
0.0% 0/18 0/3 source/bin/rocprof-sys-avail/component_categories.hpp
0.0% 0/274 0/12 source/bin/rocprof-sys-avail/generate_config.cpp
0.0% 0/39 0/2 source/bin/rocprof-sys-avail/get_availability.hpp
0.0% 0/11 0/1 source/bin/rocprof-sys-avail/get_categories.hpp
0.0% 0/106 0/6 source/bin/rocprof-sys-avail/hw_counter_query.cpp
0.0% 0/4 0/1 source/bin/rocprof-sys-avail/info_type.cpp
0.0% 0/9 0/1 source/bin/rocprof-sys-avail/info_type.hpp
0.0% 0/455 0/47 source/bin/rocprof-sys-causal/impl.cpp
0.0% 0/80 0/2 source/bin/rocprof-sys-causal/rocprof-sys-causal.cpp
0.0% 0/688 0/44 source/bin/rocprof-sys-instrument/details.cpp
0.0% 0/106 0/7 source/bin/rocprof-sys-instrument/function_signature.cpp
0.0% 0/20 0/5 source/bin/rocprof-sys-instrument/function_signature.hpp
0.0% 0/160 0/7 source/bin/rocprof-sys-instrument/info.hpp
0.0% 0/252 0/22 source/bin/rocprof-sys-instrument/internal_libs.cpp
0.0% 0/64 0/5 source/bin/rocprof-sys-instrument/log.cpp
0.0% 0/5 0/1 source/bin/rocprof-sys-instrument/log.hpp
0.0% 0/542 0/40 source/bin/rocprof-sys-instrument/module_function.cpp
0.0% 0/88 0/7 source/bin/rocprof-sys-instrument/module_function.hpp
0.0% 0/1593 0/87 source/bin/rocprof-sys-instrument/rocprof-sys-instrument.cpp
0.0% 0/165 0/12 source/bin/rocprof-sys-instrument/rocprof-sys-instrument.hpp
0.0% 0/2 0/1 source/bin/rocprof-sys-run/rocprof-sys-run.cpp
0.0% 0/2 0/1 source/bin/rocprof-sys-sample/rocprof-sys-sample.cpp
0.0% 0/57 0/5 source/bin/rocsys-exe/rocsys.cpp
0.0% 0/24 0/1 source/lib/backends/amd_smi/wrapper.hpp
0.0% 0/20 0/3 source/lib/backends/posix/backend.hpp
0.0% 0/46 0/2 source/lib/backends/rocprofiler_sdk/wrapper.hpp
0.0% 0/16 0/4 source/lib/binary/address_multirange.cpp
0.0% 0/9 0/1 source/lib/binary/address_multirange.hpp
0.0% 0/126 0/5 source/lib/binary/analysis.cpp
0.0% 0/7 0/1 source/lib/binary/binary_info.hpp
0.0% 0/107 0/9 source/lib/binary/dwarf_entry.cpp
0.0% 0/1 0/1 source/lib/binary/dwarf_entry.hpp
0.0% 0/74 0/6 source/lib/binary/link_map.cpp
0.0% 0/3 0/1 source/lib/binary/link_map.hpp
0.0% 0/10 0/1 source/lib/binary/scope_filter.cpp
0.0% 0/6 0/2 source/lib/binary/scope_filter.hpp
0.0% 0/162 0/18 source/lib/binary/symbol.cpp
0.0% 0/8 0/8 source/lib/binary/symbol.hpp
0.0% 0/6 0/1 source/lib/common/env_vars.hpp
0.0% 0/40 0/3 source/lib/common/invoke.hpp
0.0% 0/22 0/2 source/lib/common/setup.hpp
0.0% 0/25 0/2 source/lib/core/amd_smi.cpp
0.0% 0/74 0/18 source/lib/core/binary/address_range.cpp
0.0% 0/9 0/3 source/lib/core/binary/address_range.hpp
0.0% 0/21 0/6 source/lib/core/categories.cpp
0.0% 0/11 0/11 source/lib/core/components/fwd.hpp
0.0% 0/29 0/3 source/lib/core/config.hpp
0.0% 0/88 0/11 source/lib/core/cpu.cpp
0.0% 0/1 0/1 source/lib/core/cpu.hpp
0.0% 0/61 0/6 source/lib/core/dynamic_library.cpp
0.0% 0/28 0/7 source/lib/core/exception.cpp
0.0% 0/242 0/29 source/lib/core/gpu.cpp
0.0% 0/162 0/12 source/lib/core/gpu_metrics.cpp
0.0% 0/33 0/6 source/lib/core/mpi.hpp
0.0% 0/59 0/4 source/lib/core/mproc.cpp
0.0% 0/78 0/5 source/lib/core/perf.cpp
0.0% 0/54 0/6 source/lib/core/perfetto/cached_perfetto_session.cpp
0.0% 0/33 0/4 source/lib/core/perfetto/counter_track.hpp
0.0% 0/32 0/7 source/lib/core/perfetto/emitter.cpp
0.0% 0/48 0/8 source/lib/core/perfetto/emitter.hpp
0.0% 0/9 0/1 source/lib/core/perfetto/sinks/append_mode.hpp
0.0% 0/1 0/1 source/lib/core/progress/bar.hpp
0.0% 0/8 0/3 source/lib/core/sdk/tracing-config-deps.hpp
0.0% 0/53 0/3 source/lib/core/trace_cache/cache_manager.cpp
0.0% 0/7 0/2 source/lib/core/trace_cache/cache_manager.hpp
0.0% 0/817 0/104 source/lib/core/trace_cache/perfetto_processor.cpp
0.0% 0/1 0/1 source/lib/core/trace_cache/perfetto_processor.hpp
0.0% 0/129 0/13 source/lib/core/trace_cache/post_processor.cpp
0.0% 0/13 0/1 source/lib/core/trace_cache/sample_processor.hpp
0.0% 0/14 0/6 source/lib/rocprof-sys-causal-api/causal_api.cpp
0.0% 0/543 0/85 source/lib/rocprof-sys-dl/dl.cpp
0.0% 0/16 0/1 source/lib/rocprof-sys-dl/main.c
0.0% 0/280 0/31 source/lib/rocprof-sys-rt/src/RTcommon.c
0.0% 0/29 0/4 source/lib/rocprof-sys-rt/src/RTheap-linux.c
0.0% 0/65 0/4 source/lib/rocprof-sys-rt/src/RTheap.c
0.0% 0/212 0/22 source/lib/rocprof-sys-rt/src/RTlinux.c
0.0% 0/97 0/8 source/lib/rocprof-sys-rt/src/RTposix.c
0.0% 0/6 0/2 source/lib/rocprof-sys-rt/src/RTsignal.c
0.0% 0/11 0/2 source/lib/rocprof-sys-rt/src/RTthread-x86-64.c
0.0% 0/3 0/1 source/lib/rocprof-sys-rt/src/RTthread.c
0.0% 0/84 0/20 source/lib/rocprof-sys/api.cpp
0.0% 0/678 0/39 source/lib/rocprof-sys/library.cpp
0.0% 0/78 0/6 source/lib/rocprof-sys/library/causal/components/backtrace.cpp
0.0% 0/8 0/1 source/lib/rocprof-sys/library/causal/components/backtrace.hpp
0.0% 0/105 0/11 source/lib/rocprof-sys/library/causal/components/blocking_gotcha.cpp
0.0% 0/37 0/7 source/lib/rocprof-sys/library/causal/components/causal_gotcha.cpp
0.0% 0/86 0/22 source/lib/rocprof-sys/library/causal/components/progress_point.cpp
0.0% 0/23 0/3 source/lib/rocprof-sys/library/causal/components/progress_point.hpp
0.0% 0/50 0/8 source/lib/rocprof-sys/library/causal/components/unblocking_gotcha.cpp
0.0% 0/564 0/33 source/lib/rocprof-sys/library/causal/data.cpp
0.0% 0/91 0/16 source/lib/rocprof-sys/library/causal/delay.cpp
0.0% 0/391 0/29 source/lib/rocprof-sys/library/causal/experiment.cpp
0.0% 0/3 0/1 source/lib/rocprof-sys/library/causal/experiment.hpp
0.0% 0/24 0/5 source/lib/rocprof-sys/library/causal/sample_data.cpp
0.0% 0/296 0/25 source/lib/rocprof-sys/library/causal/sampling.cpp
0.0% 0/4 0/1 source/lib/rocprof-sys/library/causal/selected_entry.cpp
0.0% 0/5 0/3 source/lib/rocprof-sys/library/causal/selected_entry.hpp
0.0% 0/76 0/11 source/lib/rocprof-sys/library/components/backtrace.cpp
0.0% 0/1 0/1 source/lib/rocprof-sys/library/components/backtrace.hpp
0.0% 0/145 0/17 source/lib/rocprof-sys/library/components/backtrace_metrics.cpp
0.0% 0/9 0/3 source/lib/rocprof-sys/library/components/backtrace_timestamp.cpp
0.0% 0/4 0/2 source/lib/rocprof-sys/library/components/backtrace_timestamp.hpp
0.0% 0/74 0/10 source/lib/rocprof-sys/library/components/callchain.cpp
0.0% 0/1 0/1 source/lib/rocprof-sys/library/components/callchain.hpp
0.0% 0/321 0/29 source/lib/rocprof-sys/library/components/comm_data.cpp
0.0% 0/19 0/5 source/lib/rocprof-sys/library/components/comm_data.hpp
0.0% 0/8 0/2 source/lib/rocprof-sys/library/components/ensure_storage.hpp
0.0% 0/29 0/6 source/lib/rocprof-sys/library/components/exit_gotcha.cpp
0.0% 0/1 0/1 source/lib/rocprof-sys/library/components/exit_gotcha.hpp
0.0% 0/69 0/8 source/lib/rocprof-sys/library/components/fork_gotcha.cpp
0.0% 0/1 0/1 source/lib/rocprof-sys/library/components/fork_gotcha.hpp
0.0% 0/13 0/3 source/lib/rocprof-sys/library/components/kill_gotcha.cpp
0.0% 0/1 0/1 source/lib/rocprof-sys/library/components/kill_gotcha.hpp
0.0% 0/176 0/22 source/lib/rocprof-sys/library/components/mpi_gotcha.cpp
0.0% 0/2 0/1 source/lib/rocprof-sys/library/components/mpi_gotcha.hpp
0.0% 0/533 0/12 source/lib/rocprof-sys/library/components/mpip.hpp
0.0% 0/79 0/19 source/lib/rocprof-sys/library/components/numa_gotcha.cpp
0.0% 0/2 0/1 source/lib/rocprof-sys/library/components/numa_gotcha.hpp
0.0% 0/350 0/20 source/lib/rocprof-sys/library/components/pthread_create_gotcha.cpp
0.0% 0/5 0/1 source/lib/rocprof-sys/library/components/pthread_create_gotcha.hpp
0.0% 0/35 0/9 source/lib/rocprof-sys/library/components/pthread_gotcha.cpp
0.0% 0/24 0/2 source/lib/rocprof-sys/library/components/pthread_mutex_gotcha_policy.hpp
0.0% 0/165 0/31 source/lib/rocprof-sys/library/components/vaapi_gotcha.cpp
0.0% 0/2 0/1 source/lib/rocprof-sys/library/components/vaapi_gotcha.hpp
0.0% 0/147 0/10 source/lib/rocprof-sys/library/coverage.cpp
0.0% 0/29 0/5 source/lib/rocprof-sys/library/coverage.hpp
0.0% 0/66 0/16 source/lib/rocprof-sys/library/coverage/impl.hpp
0.0% 0/260 0/35 source/lib/rocprof-sys/library/kokkosp.cpp
0.0% 0/252 0/32 source/lib/rocprof-sys/library/perf.cpp
0.0% 0/11 0/3 source/lib/rocprof-sys/library/perf.hpp
0.0% 0/155 0/9 source/lib/rocprof-sys/library/pmc/collectors/common/settings.hpp
0.0% 0/69 0/5 source/lib/rocprof-sys/library/pmc/collectors/cpu/cache_policy.hpp
0.0% 0/36 0/5 source/lib/rocprof-sys/library/pmc/collectors/cpu/cpu_traits.hpp
0.0% 0/131 0/6 source/lib/rocprof-sys/library/pmc/collectors/gpu/cache_policy.hpp
0.0% 0/34 0/3 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/cache_policy.hpp
0.0% 0/14 0/2 source/lib/rocprof-sys/library/pmc/device_providers/procfs/provider.hpp
0.0% 0/167 0/20 source/lib/rocprof-sys/library/pmc/sampler.cpp
0.0% 0/125 0/11 source/lib/rocprof-sys/library/process_sampler.cpp
0.0% 0/15 0/3 source/lib/rocprof-sys/library/process_sampler.hpp
0.0% 0/588 0/43 source/lib/rocprof-sys/library/rocprofiler-sdk.cpp
0.0% 0/16 0/2 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/hip_stream.hpp
0.0% 0/102 0/10 source/lib/rocprof-sys/library/rocprofiler-sdk/counters.cpp
0.0% 0/17 0/6 source/lib/rocprof-sys/library/rocprofiler-sdk/counters.hpp
0.0% 0/53 0/6 source/lib/rocprof-sys/library/rocprofiler-sdk/fwd.cpp
0.0% 0/8 0/3 source/lib/rocprof-sys/library/rocprofiler-sdk/fwd.hpp
0.0% 0/122 0/20 source/lib/rocprof-sys/library/runtime.cpp
0.0% 0/2 0/1 source/lib/rocprof-sys/library/runtime.hpp
0.0% 0/805 0/50 source/lib/rocprof-sys/library/sampling.cpp
0.0% 0/148 0/31 source/lib/rocprof-sys/library/thread_data.hpp
0.0% 0/10 0/3 source/lib/rocprof-sys/library/thread_data_growth.hpp
0.0% 0/11 0/1 source/lib/rocprof-sys/library/thread_deleter.cpp
0.0% 0/5 0/1 source/lib/rocprof-sys/library/thread_deleter.hpp
0.0% 0/168 0/27 source/lib/rocprof-sys/library/thread_info.cpp
0.0% 0/2 0/1 source/lib/rocprof-sys/library/thread_info.hpp
0.0% 0/118 0/11 source/lib/rocprof-sys/library/tracing.cpp
0.0% 0/61 0/14 source/lib/rocprof-sys/library/tracing.hpp
0.0% 0/8 0/2 source/lib/rocprof-sys/progress.cpp
0.0% 0/74 0/16 source/lib/rocprof-sys/regions.cpp
0.0% 0/91 0/6 source/lib/rocprof-sys/timeout.cpp
0.0% 0/453 0/45 source/python/libpyrocprofsys.cpp
0.8% 7/838 1/70 source/lib/core/argparse.cpp
3.8% 69/1798 11/301 source/lib/core/config.cpp
18.8% 6/32 2/5 source/bin/common/common_utils.hpp
🟠 20-50% (4 files)
Lines Functions File
20.0% 1/5 0/2 source/lib/core/argparse.hpp
26.3% 5/19 1/3 source/lib/rocprof-sys/library/components/backtrace_metrics.hpp
31.2% 20/64 4/9 source/lib/core/utility.hpp
40.9% 18/44 1/7 source/lib/rocprof-sys/library/rocprofiler-sdk/types.hpp
🟡 50-80% (25 files)
Lines Functions File
50.0% 19/38 4/5 source/lib/common/static_object.hpp
50.0% 8/16 3/3 source/lib/core/perfetto/sinks/per_pid_file_sink.cpp
50.5% 209/414 23/35 source/bin/common/common_utils.cpp
52.1% 225/432 36/57 source/lib/core/trace_cache/metadata_registry.cpp
56.7% 17/30 2/15 source/lib/core/trace_cache/unified_memory_processor.hpp
58.4% 171/293 19/36 source/lib/rocprof-sys/library/components/category_region.hpp
60.0% 36/60 7/12 source/lib/core/agent_manager.cpp
61.4% 70/114 7/10 source/lib/core/progress/bar.cpp
62.2% 341/548 25/38 source/bin/common/json_config.cpp
64.0% 55/86 4/5 source/lib/core/trace_cache/discovery.cpp
65.7% 23/35 2/2 source/lib/core/perfetto/sinks/file_output.cpp
66.7% 22/33 3/8 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/types.hpp
68.7% 46/67 11/14 source/lib/core/trace_cache/data_types.cpp
70.0% 236/337 15/17 source/bin/common/preset_registry.cpp
71.4% 25/35 1/2 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/rccl/event_info.hpp
72.1% 88/122 15/18 source/lib/core/perfetto/engine.cpp
73.9% 130/176 18/21 source/lib/common/path.hpp
74.3% 78/105 9/10 source/lib/core/perfetto/engine_impl.hpp
74.5% 41/55 4/7 source/lib/core/config/trace_period_config.hpp
75.0% 3/4 0/1 source/lib/backends/amd_smi/nic_types.hpp
75.0% 6/8 1/2 source/lib/core/trace_cache/type_registry.hpp
75.8% 47/62 5/5 source/lib/rocprof-sys/library/pmc/collectors/gpu/gpu_traits.hpp
78.2% 61/78 9/10 source/lib/rocprof-sys/library/pmc/device_providers/rocprofiler_sdk/provider.hpp
78.6% 77/98 4/4 source/lib/core/perfetto/sinks/single_file_sink.cpp
79.2% 19/24 2/2 source/lib/core/node_info.cpp
🟢 80-100% (127 files)
Lines Functions File
80.0% 4/5 1/1 source/lib/core/agent.hpp
80.0% 20/25 2/6 source/lib/rocprof-sys/library/pmc/collectors/hipfile/types.hpp
80.6% 133/165 10/14 source/lib/backends/procfs/backend.hpp
80.8% 135/167 30/33 source/lib/backends/rocprofiler_sdk/backend.hpp
81.2% 13/16 2/3 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/gpu_perf_counter_traits.hpp
81.8% 36/44 3/6 source/lib/core/containers/static_vector.hpp
83.0% 39/47 1/3 source/lib/core/trace_cache/storage_parser.hpp
83.3% 55/66 4/4 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/page_migrate.hpp
83.7% 713/852 29/32 source/lib/core/trace_cache/rocpd_processor.cpp
83.9% 73/87 10/12 source/lib/logger/logger.hpp
85.2% 23/27 2/4 source/lib/rocprof-sys/library/rocprofiler-sdk/domain_registry.hpp
85.2% 213/250 20/33 source/lib/core/sdk/tracing-config.hpp
86.0% 49/57 4/4 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/device.hpp
86.3% 252/292 26/32 source/lib/common/environment.hpp
87.5% 7/8 0/3 source/lib/rocprof-sys/library/pmc/collectors/cpu/types.hpp
87.7% 50/57 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_page_migrate.hpp
88.6% 39/44 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_page_fault.hpp
88.6% 39/44 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_queue.hpp
88.9% 24/27 5/6 source/lib/rocprof-sys/library/rocprofiler-sdk/stream_stack_service.hpp
89.1% 106/119 8/8 source/lib/rocprof-sys/library/pmc/collectors/cpu/device.hpp
89.1% 41/46 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/queue.hpp
89.5% 51/57 8/8 source/lib/rocprof-sys/library/pmc/collectors/base/collector.hpp
89.8% 44/49 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_unmap_from_gpu.hpp
90.0% 54/60 4/4 source/lib/core/trace_cache/buffer_storage.cpp
90.4% 178/197 14/18 source/lib/rocprof-sys/library/components/shmem_gotcha.hpp
90.5% 248/274 19/20 source/lib/core/trace_cache/unified_memory_processor.cpp
91.5% 43/47 7/7 source/lib/core/control/triggers/time_window.hpp
91.5% 43/47 5/6 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered_domain.hpp
91.7% 11/12 2/2 source/lib/core/perfetto/session_backend.hpp
91.8% 67/73 7/8 source/lib/core/trace_cache/buffer_storage.hpp
91.8% 45/49 3/4 source/lib/rocprof-sys/library/pmc/collectors/nic/nic_traits.hpp
92.2% 47/51 7/7 source/lib/core/control/waitable_clocks/posix.hpp
92.3% 24/26 1/3 source/lib/core/containers/c_array.hpp
92.3% 36/39 2/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/scratch_memory.hpp
92.3% 12/13 1/1 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/rccl/transferred_bytes_tracker.hpp
92.5% 186/201 21/23 source/lib/rocprof-sys/library/rocprofiler-sdk/domain_service.hpp
92.6% 163/176 9/9 source/lib/rocprof-sys/library/pmc/collectors/gpu/device.hpp
92.9% 13/14 0/1 source/lib/rocprof-sys/library/pmc/collectors/common/collector_slice.hpp
93.1% 54/58 6/8 source/lib/rocprof-sys/library/components/pthread_mutex_gotcha.hpp
94.1% 32/34 2/2 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_dropped_events.hpp
94.1% 16/17 1/2 source/lib/rocprof-sys/library/rocprofiler-sdk/callback_domain.hpp
94.4% 51/54 4/7 source/lib/core/containers/aligned_static_vector.hpp
94.7% 54/57 1/4 source/lib/core/trace_cache/cacheable.hpp
94.7% 36/38 4/5 source/lib/rocprof-sys/library/pmc/collectors/cpu/sample.hpp
94.9% 93/98 14/17 source/lib/common/string_utility.hpp
95.0% 38/40 6/7 source/lib/core/trace_cache/rocpd_helpers.hpp
95.2% 40/42 2/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/memory_copy.hpp
95.3% 162/170 19/22 source/lib/rocprof-sys/library/components/ucx_gotcha.hpp
95.4% 83/87 19/23 source/lib/core/containers/stable_vector.hpp
95.5% 21/22 1/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/memory_allocation.hpp
95.6% 43/45 2/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kernel_dispatch.hpp
95.7% 45/47 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/page_fault.hpp
95.8% 23/24 2/4 source/lib/common/pci_bdf.hpp
95.9% 142/148 19/20 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/ompt/ompt.hpp
96.1% 49/51 7/7 source/lib/core/process_environment_info.cpp
96.2% 126/131 10/10 source/lib/core/output/output_summary.cpp
96.2% 51/53 12/14 source/lib/core/trace_cache/metadata_registry.hpp
96.3% 26/27 1/2 source/lib/common/delimit.hpp
96.5% 82/85 11/12 source/lib/core/state.hpp
96.6% 84/87 15/16 source/lib/backends/amd_smi/backend.hpp
96.7% 148/153 9/10 source/lib/common/md5sum.hpp
97.4% 74/76 6/6 source/lib/core/common_types.hpp
97.4% 37/38 5/5 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/common_tracing_callbacks.hpp
97.5% 39/40 3/3 source/lib/core/utility.cpp
97.7% 42/43 7/9 source/lib/core/trace_cache/archive.hpp
97.7% 85/87 11/12 source/lib/core/control/triggers/roctx.cpp
97.8% 44/45 7/11 source/lib/core/demangler.hpp
98.0% 49/50 3/3 source/lib/rocprof-sys/library/pmc/collectors/nic/device.hpp
98.1% 53/54 7/7 source/lib/rocprof-sys/library/pmc/device_providers/amd_smi/provider.hpp
98.2% 56/57 7/8 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/ompt/decoder.hpp
98.5% 130/132 19/20 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/roctx/core_api.hpp
98.5% 67/68 9/9 source/bin/common/cli_dispatcher.cpp
98.6% 68/69 5/5 source/bin/rocprof-sys-instrument/dynamic_dependency_listing.hpp
98.7% 76/77 3/3 source/lib/core/perfetto/packet_framing.hpp
99.1% 115/116 19/19 source/lib/core/control/session.cpp
100.0% 1/1 0/1 source/bin/common/cli_dispatcher.hpp
100.0% 1/1 0/1 source/bin/common/json_config.hpp
100.0% 110/110 13/14 source/lib/backends/amd_smi/device.hpp
100.0% 7/7 0/1 source/lib/backends/amd_smi/gpu_types.hpp
100.0% 35/35 2/3 source/lib/backends/hipfile/backend.hpp
100.0% 1/1 0/1 source/lib/backends/rocprofiler_sdk/types.hpp
100.0% 12/12 2/2 source/lib/common/clocks.hpp
100.0% 12/12 1/1 source/lib/common/join.hpp
100.0% 3/3 0/1 source/lib/common/regex_utility.hpp
100.0% 24/24 5/6 source/lib/common/synchronized.hpp
100.0% 14/14 2/5 source/lib/common/units/data_size.hpp
100.0% 11/11 2/3 source/lib/common/units/frequency.hpp
100.0% 11/11 2/3 source/lib/common/units/power.hpp
100.0% 5/5 0/3 source/lib/common/units/quantity.hpp
100.0% 8/8 0/2 source/lib/common/version.hpp
100.0% 158/158 1/1 source/lib/core/agent_info.hpp
100.0% 2/2 1/2 source/lib/core/agent_manager.hpp
100.0% 22/22 0/2 source/lib/core/containers/operators.hpp
100.0% 15/15 3/5 source/lib/core/control/session.hpp
100.0% 3/3 0/2 source/lib/core/control/triggers/roctx.hpp
100.0% 19/19 4/4 source/lib/core/control/waitable_clocks/steady.cpp
100.0% 2/2 1/2 source/lib/core/control/waitable_clocks/steady.hpp
100.0% 2/2 2/2 source/lib/core/node_info.hpp
100.0% 3/3 1/2 source/lib/core/output/output_summary.hpp
100.0% 1/1 0/1 source/lib/core/perfetto/category_registry.hpp
100.0% 1/1 0/1 source/lib/core/perfetto/engine.hpp
100.0% 7/7 0/1 source/lib/core/perfetto/sinks/file_output.hpp
100.0% 1/1 0/1 source/lib/core/perfetto/sinks/per_pid_file_sink.hpp
100.0% 2/2 0/1 source/lib/core/perfetto/sinks/single_file_sink.hpp
100.0% 2/2 0/1 source/lib/core/perfetto/sinks/trace_sink.hpp
100.0% 7/7 2/2 source/lib/core/progress/tracker.cpp
100.0% 1/1 0/1 source/lib/core/progress/tracker.hpp
100.0% 4/4 0/3 source/lib/core/trace_cache/data_types.hpp
100.0% 7/7 1/3 source/lib/core/trace_cache/record_header.hpp
100.0% 2/2 0/1 source/lib/core/trace_cache/sample_processor_interface.hpp
100.0% 152/152 0/8 source/lib/core/trace_cache/sample_type.hpp
100.0% 5/5 2/2 source/lib/core/track_registry.cpp
100.0% 4/4 0/2 source/lib/core/track_registry.hpp
100.0% 12/12 1/1 source/lib/logger/logger.cpp
100.0% 18/18 0/2 source/lib/rocprof-sys/library/pmc/collectors/gpu/sample.hpp
100.0% 11/11 0/3 source/lib/rocprof-sys/library/pmc/collectors/gpu/types.hpp
100.0% 8/8 0/1 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/sample.hpp
100.0% 55/55 4/4 source/lib/rocprof-sys/library/pmc/collectors/hipfile/device.hpp
100.0% 36/36 2/3 source/lib/rocprof-sys/library/pmc/collectors/hipfile/hipfile_traits.hpp
100.0% 7/7 0/2 source/lib/rocprof-sys/library/pmc/collectors/hipfile/sample.hpp
100.0% 10/10 0/1 source/lib/rocprof-sys/library/pmc/collectors/nic/sample.hpp
100.0% 9/9 0/1 source/lib/rocprof-sys/library/pmc/collectors/nic/types.hpp
100.0% 3/3 0/3 source/lib/rocprof-sys/library/pmc/common/types.hpp
100.0% 9/9 1/1 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/code_object.hpp
100.0% 17/17 2/2 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/rccl/device_resolver.hpp
100.0% 47/47 4/4 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/rccl/rccl.hpp
100.0% 10/10 0/1 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/roctx/control_api.hpp

Distribution

Range Files
0-20% 168
20-50% 4
50-80% 25
80-100% 127

Unit Tests (PR Diff Files Only)

Lines: 🔴 28.9% (📉 -1.87% vs base) — 624/2,156 across 28 files
Functions: 🔴 17.9% — 35/195

🔴 0-20% (9 files)
Lines Functions File
0.0% 0/53 0/3 source/lib/core/trace_cache/cache_manager.cpp
0.0% 0/13 0/1 source/lib/core/trace_cache/sample_processor.hpp
0.0% 0/145 0/17 source/lib/rocprof-sys/library/components/backtrace_metrics.cpp
0.0% 0/321 0/29 source/lib/rocprof-sys/library/components/comm_data.cpp
0.0% 0/69 0/5 source/lib/rocprof-sys/library/pmc/collectors/cpu/cache_policy.hpp
0.0% 0/131 0/6 source/lib/rocprof-sys/library/pmc/collectors/gpu/cache_policy.hpp
0.0% 0/34 0/3 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/cache_policy.hpp
0.0% 0/588 0/43 source/lib/rocprof-sys/library/rocprofiler-sdk.cpp
0.0% 0/102 0/10 source/lib/rocprof-sys/library/rocprofiler-sdk/counters.cpp
🟡 50-80% (3 files)
Lines Functions File
64.0% 55/86 (📈 +0.86%) 4/5 source/lib/core/trace_cache/discovery.cpp
66.7% 22/33 3/8 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/types.hpp
75.0% 6/8 (📉 -25.00%) 1/2 source/lib/core/trace_cache/type_registry.hpp
🟢 80-100% (16 files)
Lines Functions File
80.0% 20/25 (📈 +7.78%) 2/6 source/lib/rocprof-sys/library/pmc/collectors/hipfile/types.hpp
83.0% 39/47 (📉 -2.13%) 1/3 source/lib/core/trace_cache/storage_parser.hpp
87.5% 7/8 (📈 +20.83%) 0/3 source/lib/rocprof-sys/library/pmc/collectors/cpu/types.hpp
90.0% 54/60 4/4 source/lib/core/trace_cache/buffer_storage.cpp
91.8% 67/73 (📉 -0.32%) 7/8 source/lib/core/trace_cache/buffer_storage.hpp
94.7% 54/57 (📉 -0.65%) 1/4 source/lib/core/trace_cache/cacheable.hpp
94.7% 36/38 (📉 -0.35%) 4/5 source/lib/rocprof-sys/library/pmc/collectors/cpu/sample.hpp
97.7% 42/43 7/9 source/lib/core/trace_cache/archive.hpp
100.0% 7/7 1/3 source/lib/core/trace_cache/record_header.hpp
100.0% 152/152 (📈 +6.69%) 0/8 source/lib/core/trace_cache/sample_type.hpp
100.0% 18/18 (📈 +80.00%) 0/2 source/lib/rocprof-sys/library/pmc/collectors/gpu/sample.hpp
100.0% 11/11 0/3 source/lib/rocprof-sys/library/pmc/collectors/gpu/types.hpp
100.0% 8/8 (📈 +3.23%) 0/1 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/sample.hpp
100.0% 7/7 0/2 source/lib/rocprof-sys/library/pmc/collectors/hipfile/sample.hpp
100.0% 10/10 (📈 +68.18%) 0/1 source/lib/rocprof-sys/library/pmc/collectors/nic/sample.hpp
100.0% 9/9 (📈 +50.00%) 0/1 source/lib/rocprof-sys/library/pmc/collectors/nic/types.hpp

Distribution

Range Files
0-20% 9
20-50% 0
50-80% 3
80-100% 16

E2E Tests

Lines: 🟡 73.4% — 24,133/32,871 across 324 files
Functions: 🟡 70.9% — 2,403/3,390

🔴 0-20% (30 files)
Lines Functions File
0.0% 0/106 0/6 source/bin/rocprof-sys-avail/hw_counter_query.cpp
0.0% 0/24 0/1 source/lib/backends/amd_smi/wrapper.hpp
0.0% 0/88 0/11 source/lib/core/cpu.cpp
0.0% 0/1 0/1 source/lib/core/cpu.hpp
0.0% 0/61 0/6 source/lib/core/dynamic_library.cpp
0.0% 0/28 0/7 source/lib/core/exception.cpp
0.0% 0/162 0/12 source/lib/core/gpu_metrics.cpp
0.0% 0/8 0/3 source/lib/core/sdk/tracing-config-deps.hpp
0.0% 0/6 0/2 source/lib/rocprof-sys-rt/src/RTsignal.c
0.0% 0/11 0/2 source/lib/rocprof-sys-rt/src/RTthread-x86-64.c
0.0% 0/3 0/1 source/lib/rocprof-sys-rt/src/RTthread.c
0.0% 0/1 0/1 source/lib/rocprof-sys/library/components/exit_gotcha.hpp
0.0% 0/1 0/1 source/lib/rocprof-sys/library/components/kill_gotcha.hpp
0.0% 0/131 0/6 source/lib/rocprof-sys/library/pmc/collectors/gpu/cache_policy.hpp
0.0% 0/34 0/3 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/cache_policy.hpp
0.0% 0/16 0/2 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/hip_stream.hpp
0.0% 0/102 0/10 source/lib/rocprof-sys/library/rocprofiler-sdk/counters.cpp
0.0% 0/17 0/6 source/lib/rocprof-sys/library/rocprofiler-sdk/counters.hpp
0.0% 0/53 0/6 source/lib/rocprof-sys/library/rocprofiler-sdk/fwd.cpp
0.0% 0/8 0/3 source/lib/rocprof-sys/library/rocprofiler-sdk/fwd.hpp
0.0% 0/453 0/45 source/python/libpyrocprofsys.cpp
4.8% 8/165 2/31 source/lib/rocprof-sys/library/components/vaapi_gotcha.cpp
8.5% 50/588 13/43 source/lib/rocprof-sys/library/rocprofiler-sdk.cpp
8.7% 4/46 0/2 source/lib/backends/rocprofiler_sdk/wrapper.hpp
12.0% 3/25 1/2 source/lib/core/amd_smi.cpp
13.2% 32/242 6/29 source/lib/core/gpu.cpp
13.6% 38/280 7/31 source/lib/rocprof-sys-rt/src/RTcommon.c
13.8% 4/29 1/4 source/lib/rocprof-sys-rt/src/RTheap-linux.c
14.2% 30/212 4/22 source/lib/rocprof-sys-rt/src/RTlinux.c
16.2% 12/74 4/16 source/lib/rocprof-sys/regions.cpp
🟠 20-50% (16 files)
Lines Functions File
24.4% 19/78 3/5 source/lib/core/perf.cpp
27.8% 27/97 4/8 source/lib/rocprof-sys-rt/src/RTposix.c
31.2% 255/817 34/104 source/lib/core/trace_cache/perfetto_processor.cpp
34.5% 10/29 3/6 source/lib/rocprof-sys/library/components/exit_gotcha.cpp
34.8% 54/155 4/9 source/lib/rocprof-sys/library/pmc/collectors/common/settings.hpp
35.7% 30/84 10/20 source/lib/rocprof-sys/api.cpp
37.1% 39/105 5/11 source/lib/rocprof-sys/library/causal/components/blocking_gotcha.cpp
38.5% 5/13 2/3 source/lib/rocprof-sys/library/components/kill_gotcha.cpp
40.0% 32/80 1/2 source/bin/rocprof-sys-causal/rocprof-sys-causal.cpp
40.9% 18/44 1/7 source/lib/rocprof-sys/library/rocprofiler-sdk/types.hpp
43.8% 21/48 6/8 source/lib/core/perfetto/emitter.hpp
44.4% 4/9 1/3 source/lib/rocprof-sys/library/components/backtrace_timestamp.cpp
45.0% 72/160 3/7 source/bin/rocprof-sys-instrument/info.hpp
45.5% 30/66 6/16 source/lib/rocprof-sys/library/coverage/impl.hpp
46.2% 42/91 2/6 source/lib/rocprof-sys/timeout.cpp
47.7% 31/65 3/4 source/lib/rocprof-sys-rt/src/RTheap.c
🟡 50-80% (56 files)
Lines Functions File
50.0% 8/16 2/4 source/lib/binary/address_multirange.cpp
50.0% 16/32 5/7 source/lib/core/perfetto/emitter.cpp
50.0% 7/14 2/6 source/lib/rocprof-sys-causal-api/causal_api.cpp
50.0% 1/2 0/1 source/lib/rocprof-sys/library/components/numa_gotcha.hpp
50.0% 1/2 0/1 source/lib/rocprof-sys/library/components/vaapi_gotcha.hpp
50.0% 1/2 0/1 source/lib/rocprof-sys/library/thread_info.hpp
50.0% 4/8 1/2 source/lib/rocprof-sys/progress.cpp
50.9% 29/57 3/5 source/bin/rocsys-exe/rocsys.cpp
52.1% 225/432 36/57 source/lib/core/trace_cache/metadata_registry.cpp
52.3% 168/321 15/29 source/lib/rocprof-sys/library/components/comm_data.cpp
54.6% 142/260 27/35 source/lib/rocprof-sys/library/kokkosp.cpp
56.7% 17/30 2/15 source/lib/core/trace_cache/unified_memory_processor.hpp
57.0% 45/79 8/19 source/lib/rocprof-sys/library/components/numa_gotcha.cpp
57.5% 23/40 1/3 source/lib/common/invoke.hpp
58.1% 97/167 15/20 source/lib/rocprof-sys/library/pmc/sampler.cpp
59.4% 63/106 5/9 source/bin/common/argument_registration.hpp
59.5% 44/74 13/18 source/lib/core/binary/address_range.cpp
61.4% 70/114 7/10 source/lib/core/progress/bar.cpp
62.7% 37/59 3/4 source/lib/core/mproc.cpp
63.8% 44/69 5/8 source/lib/rocprof-sys/library/components/fork_gotcha.cpp
63.9% 161/252 24/32 source/lib/rocprof-sys/library/perf.cpp
65.0% 13/20 2/3 source/lib/backends/posix/backend.hpp
65.1% 56/86 4/5 source/lib/core/trace_cache/discovery.cpp
65.7% 23/35 2/2 source/lib/core/perfetto/sinks/file_output.cpp
66.0% 454/688 32/44 source/bin/rocprof-sys-instrument/details.cpp
66.4% 81/122 15/20 source/lib/rocprof-sys/library/runtime.cpp
66.7% 6/9 1/1 source/lib/core/perfetto/sinks/append_mode.hpp
66.7% 22/33 3/8 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/types.hpp
67.6% 25/37 5/7 source/lib/rocprof-sys/library/causal/components/causal_gotcha.cpp
69.1% 375/543 40/85 source/lib/rocprof-sys-dl/dl.cpp
70.0% 35/50 5/8 source/lib/rocprof-sys/library/causal/components/unblocking_gotcha.cpp
70.5% 124/176 16/22 source/lib/rocprof-sys/library/components/mpi_gotcha.cpp
71.4% 25/35 1/2 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/rccl/event_info.hpp
71.7% 393/548 28/38 source/bin/common/json_config.cpp
72.7% 245/337 16/17 source/bin/common/preset_registry.cpp
73.0% 54/74 5/6 source/lib/binary/link_map.cpp
73.6% 78/106 5/7 source/bin/rocprof-sys-instrument/function_signature.cpp
74.4% 308/414 33/35 source/bin/common/common_utils.cpp
74.6% 421/564 30/33 source/lib/rocprof-sys/library/causal/data.cpp
74.8% 1192/1593 51/87 source/bin/rocprof-sys-instrument/rocprof-sys-instrument.cpp
75.0% 15/20 5/5 source/bin/rocprof-sys-instrument/function_signature.hpp
75.0% 48/64 4/5 source/bin/rocprof-sys-instrument/log.cpp
75.0% 3/4 0/1 source/lib/backends/amd_smi/nic_types.hpp
75.0% 18/24 4/5 source/lib/rocprof-sys/library/causal/sample_data.cpp
75.3% 223/296 23/25 source/lib/rocprof-sys/library/causal/sampling.cpp
75.5% 409/542 39/40 source/bin/rocprof-sys-instrument/module_function.cpp
75.8% 47/62 5/5 source/lib/rocprof-sys/library/pmc/collectors/gpu/gpu_traits.hpp
76.3% 29/38 5/5 source/lib/common/static_object.hpp
76.7% 46/60 10/12 source/lib/core/agent_manager.cpp
76.7% 99/129 12/13 source/lib/core/trace_cache/post_processor.cpp
77.7% 115/148 26/31 source/lib/rocprof-sys/library/thread_data.hpp
78.2% 61/78 9/10 source/lib/rocprof-sys/library/pmc/device_providers/rocprofiler_sdk/provider.hpp
78.3% 209/267 24/28 source/bin/common/tool_runner.cpp
79.0% 83/105 10/10 source/lib/core/perfetto/engine_impl.hpp
79.2% 19/24 2/2 source/lib/core/node_info.cpp
79.8% 134/168 24/27 source/lib/rocprof-sys/library/thread_info.cpp
🟢 80-100% (222 files)
Lines Functions File
80.0% 4/5 0/1 source/bin/rocprof-sys-instrument/log.hpp
80.0% 4/5 1/1 source/lib/core/agent.hpp
80.0% 20/25 2/6 source/lib/rocprof-sys/library/pmc/collectors/hipfile/types.hpp
80.8% 135/167 30/33 source/lib/backends/rocprofiler_sdk/backend.hpp
81.2% 181/223 21/24 source/bin/rocprof-sys-avail/common.cpp
81.2% 13/16 1/1 source/lib/rocprof-sys-dl/main.c
81.2% 13/16 2/3 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/gpu_perf_counter_traits.hpp
81.3% 1461/1798 276/301 source/lib/core/config.cpp
81.4% 70/86 17/22 source/lib/rocprof-sys/library/causal/components/progress_point.cpp
81.5% 44/54 6/6 source/lib/core/perfetto/cached_perfetto_session.cpp
82.4% 136/165 12/12 source/bin/rocprof-sys-instrument/rocprof-sys-instrument.hpp
82.9% 324/391 18/29 source/lib/rocprof-sys/library/causal/experiment.cpp
82.9% 209/252 20/22 source/bin/rocprof-sys-instrument/internal_libs.cpp
83.2% 89/107 8/9 source/lib/binary/dwarf_entry.cpp
83.3% 55/66 4/4 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/page_migrate.hpp
84.1% 570/678 34/39 source/lib/rocprof-sys/library.cpp
84.2% 16/19 2/3 source/lib/rocprof-sys/library/components/backtrace_metrics.hpp
84.2% 16/19 3/5 source/lib/rocprof-sys/library/components/comm_data.hpp
84.2% 139/165 11/14 source/lib/backends/procfs/backend.hpp
84.6% 137/162 17/18 source/lib/binary/symbol.cpp
84.7% 83/98 4/4 source/lib/core/perfetto/sinks/single_file_sink.cpp
85.1% 74/87 10/12 source/lib/logger/logger.hpp
85.2% 23/27 2/4 source/lib/rocprof-sys/library/rocprofiler-sdk/domain_registry.hpp
85.2% 52/61 10/14 source/lib/rocprof-sys/library/tracing.hpp
85.7% 78/91 14/16 source/lib/rocprof-sys/library/causal/delay.cpp
86.0% 49/57 4/4 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/device.hpp
86.3% 735/852 29/32 source/lib/core/trace_cache/rocpd_processor.cpp
86.4% 76/88 5/7 source/bin/rocprof-sys-instrument/module_function.hpp
86.8% 46/53 3/3 source/lib/core/trace_cache/cache_manager.cpp
87.3% 255/292 28/32 source/lib/common/environment.hpp
87.5% 14/16 3/3 source/lib/core/perfetto/sinks/per_pid_file_sink.cpp
87.7% 50/57 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_page_migrate.hpp
88.2% 67/76 9/11 source/lib/rocprof-sys/library/components/backtrace.cpp
88.6% 403/455 36/47 source/bin/rocprof-sys-causal/impl.cpp
88.6% 39/44 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_page_fault.hpp
88.6% 39/44 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_queue.hpp
88.9% 24/27 5/6 source/lib/rocprof-sys/library/rocprofiler-sdk/stream_stack_service.hpp
89.0% 129/145 12/17 source/lib/rocprof-sys/library/components/backtrace_metrics.cpp
89.0% 105/118 10/11 source/lib/rocprof-sys/library/tracing.cpp
89.1% 717/805 47/50 source/lib/rocprof-sys/library/sampling.cpp
89.1% 41/46 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/queue.hpp
89.2% 66/74 7/10 source/lib/rocprof-sys/library/components/callchain.cpp
89.2% 223/250 23/33 source/lib/core/sdk/tracing-config.hpp
89.4% 749/838 57/70 source/lib/core/argparse.cpp
89.8% 132/147 10/10 source/lib/rocprof-sys/library/coverage.cpp
89.8% 44/49 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_unmap_from_gpu.hpp
90.0% 9/10 1/1 source/lib/binary/scope_filter.cpp
90.0% 54/60 4/4 source/lib/core/trace_cache/buffer_storage.cpp
90.1% 247/274 11/12 source/bin/rocprof-sys-avail/generate_config.cpp
90.5% 248/274 19/20 source/lib/core/trace_cache/unified_memory_processor.cpp
90.9% 318/350 18/20 source/lib/rocprof-sys/library/components/pthread_create_gotcha.cpp
90.9% 20/22 2/2 source/lib/common/setup.hpp
90.9% 10/11 1/1 source/lib/rocprof-sys/library/thread_deleter.cpp
91.2% 52/57 8/8 source/lib/rocprof-sys/library/pmc/collectors/base/collector.hpp
91.5% 43/47 5/6 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered_domain.hpp
91.6% 109/119 8/8 source/lib/rocprof-sys/library/pmc/collectors/cpu/device.hpp
91.7% 11/12 2/2 source/lib/core/perfetto/session_backend.hpp
91.8% 67/73 7/8 source/lib/core/trace_cache/buffer_storage.hpp
91.8% 45/49 3/4 source/lib/rocprof-sys/library/pmc/collectors/nic/nic_traits.hpp
92.1% 116/126 5/5 source/lib/binary/analysis.cpp
92.2% 47/51 7/7 source/lib/core/control/waitable_clocks/posix.hpp
92.3% 36/39 2/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/scratch_memory.hpp
92.3% 12/13 1/1 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/rccl/transferred_bytes_tracker.hpp
92.5% 186/201 21/23 source/lib/rocprof-sys/library/rocprofiler-sdk/domain_service.hpp
92.6% 163/176 9/9 source/lib/rocprof-sys/library/pmc/collectors/gpu/device.hpp
92.6% 113/122 17/18 source/lib/core/perfetto/engine.cpp
92.6% 919/992 41/48 source/bin/rocprof-sys-avail/avail.cpp
92.9% 13/14 2/2 source/lib/rocprof-sys/library/pmc/device_providers/procfs/provider.hpp
93.1% 27/29 3/5 source/lib/rocprof-sys/library/coverage.hpp
93.6% 73/78 6/6 source/lib/rocprof-sys/library/causal/components/backtrace.cpp
93.6% 117/125 11/11 source/lib/rocprof-sys/library/process_sampler.cpp
93.9% 31/33 6/6 source/lib/core/mpi.hpp
94.1% 32/34 2/2 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/event_dropped_events.hpp
94.1% 16/17 1/2 source/lib/rocprof-sys/library/rocprofiler-sdk/callback_domain.hpp
94.3% 33/35 7/9 source/lib/rocprof-sys/library/components/pthread_gotcha.cpp
94.3% 166/176 20/21 source/lib/common/path.hpp
94.4% 186/197 16/18 source/lib/rocprof-sys/library/components/shmem_gotcha.hpp
94.4% 17/18 3/3 source/bin/rocprof-sys-avail/component_categories.hpp
94.7% 54/57 1/4 source/lib/core/trace_cache/cacheable.hpp
94.7% 36/38 4/5 source/lib/rocprof-sys/library/pmc/collectors/cpu/sample.hpp
95.0% 38/40 6/7 source/lib/core/trace_cache/rocpd_helpers.hpp
95.2% 40/42 2/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/memory_copy.hpp
95.3% 162/170 19/22 source/lib/rocprof-sys/library/components/ucx_gotcha.hpp
95.5% 21/22 1/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/memory_allocation.hpp
95.6% 43/45 2/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kernel_dispatch.hpp
95.7% 45/47 2/3 source/lib/core/trace_cache/storage_parser.hpp
95.7% 45/47 3/3 source/lib/rocprof-sys/library/rocprofiler-sdk/buffered/kfd/page_fault.hpp
95.8% 23/24 2/4 source/lib/common/pci_bdf.hpp
95.9% 142/148 19/20 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/ompt/ompt.hpp
96.1% 49/51 7/7 source/lib/core/process_environment_info.cpp
96.2% 126/131 10/10 source/lib/core/output/output_summary.cpp
96.3% 26/27 1/2 source/lib/common/delimit.hpp
96.3% 52/54 5/7 source/lib/core/containers/aligned_static_vector.hpp
96.6% 84/87 15/16 source/lib/backends/amd_smi/backend.hpp
96.6% 28/29 3/3 source/lib/core/config.hpp
96.7% 148/153 9/10 source/lib/common/md5sum.hpp
96.9% 62/64 9/9 source/lib/core/utility.hpp
97.0% 32/33 4/4 source/lib/core/perfetto/counter_track.hpp
97.0% 65/67 14/14 source/lib/core/trace_cache/data_types.cpp
97.2% 35/36 4/5 source/lib/rocprof-sys/library/pmc/collectors/cpu/cpu_traits.hpp
97.3% 285/293 35/36 source/lib/rocprof-sys/library/components/category_region.hpp
97.4% 74/76 6/6 source/lib/core/common_types.hpp
97.4% 37/38 5/5 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/common_tracing_callbacks.hpp
97.5% 39/40 3/3 source/lib/core/utility.cpp
97.7% 42/43 7/9 source/lib/core/trace_cache/archive.hpp
97.7% 85/87 11/12 source/lib/core/control/triggers/roctx.cpp
98.0% 49/50 3/3 source/lib/rocprof-sys/library/pmc/collectors/nic/device.hpp
98.1% 53/54 7/7 source/lib/rocprof-sys/library/pmc/device_providers/amd_smi/provider.hpp
98.2% 56/57 7/8 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/ompt/decoder.hpp
98.3% 57/58 6/8 source/lib/rocprof-sys/library/components/pthread_mutex_gotcha.hpp
98.5% 130/132 19/20 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/roctx/core_api.hpp
98.5% 67/68 9/9 source/bin/common/cli_dispatcher.cpp
98.6% 68/69 5/5 source/bin/rocprof-sys-instrument/dynamic_dependency_listing.hpp
98.6% 68/69 5/5 source/lib/rocprof-sys/library/pmc/collectors/cpu/cache_policy.hpp
98.7% 76/77 3/3 source/lib/core/perfetto/packet_framing.hpp
99.0% 97/98 14/17 source/lib/common/string_utility.hpp
99.1% 115/116 19/19 source/lib/core/control/session.cpp
100.0% 1/1 0/1 source/bin/common/cli_dispatcher.hpp
100.0% 32/32 4/5 source/bin/common/common_utils.hpp
100.0% 1/1 0/1 source/bin/common/json_config.hpp
100.0% 60/60 6/6 source/bin/rocprof-sys-avail/avail.hpp
100.0% 39/39 2/2 source/bin/rocprof-sys-avail/get_availability.hpp
100.0% 11/11 1/1 source/bin/rocprof-sys-avail/get_categories.hpp
100.0% 4/4 1/1 source/bin/rocprof-sys-avail/info_type.cpp
100.0% 9/9 0/1 source/bin/rocprof-sys-avail/info_type.hpp
100.0% 2/2 1/1 source/bin/rocprof-sys-run/rocprof-sys-run.cpp
100.0% 2/2 1/1 source/bin/rocprof-sys-sample/rocprof-sys-sample.cpp
100.0% 110/110 13/14 source/lib/backends/amd_smi/device.hpp
100.0% 7/7 0/1 source/lib/backends/amd_smi/gpu_types.hpp
100.0% 35/35 2/3 source/lib/backends/hipfile/backend.hpp
100.0% 1/1 0/1 source/lib/backends/rocprofiler_sdk/types.hpp
100.0% 9/9 0/1 source/lib/binary/address_multirange.hpp
100.0% 7/7 1/1 source/lib/binary/binary_info.hpp
100.0% 1/1 0/1 source/lib/binary/dwarf_entry.hpp
100.0% 3/3 0/1 source/lib/binary/link_map.hpp
100.0% 6/6 1/2 source/lib/binary/scope_filter.hpp
100.0% 8/8 7/8 source/lib/binary/symbol.hpp
100.0% 12/12 2/2 source/lib/common/clocks.hpp
100.0% 6/6 1/1 source/lib/common/env_vars.hpp
100.0% 12/12 1/1 source/lib/common/join.hpp
100.0% 3/3 0/1 source/lib/common/regex_utility.hpp
100.0% 24/24 5/6 source/lib/common/synchronized.hpp
100.0% 14/14 3/5 source/lib/common/units/data_size.hpp
100.0% 11/11 2/3 source/lib/common/units/frequency.hpp
100.0% 11/11 2/3 source/lib/common/units/power.hpp
100.0% 5/5 0/3 source/lib/common/units/quantity.hpp
100.0% 8/8 0/2 source/lib/common/version.hpp
100.0% 158/158 1/1 source/lib/core/agent_info.hpp
100.0% 2/2 1/2 source/lib/core/agent_manager.hpp
100.0% 5/5 0/2 source/lib/core/argparse.hpp
100.0% 9/9 1/3 source/lib/core/binary/address_range.hpp
100.0% 21/21 6/6 source/lib/core/categories.cpp
100.0% 11/11 11/11 source/lib/core/components/fwd.hpp
100.0% 55/55 6/7 source/lib/core/config/trace_period_config.hpp
100.0% 26/26 1/3 source/lib/core/containers/c_array.hpp
100.0% 22/22 0/2 source/lib/core/containers/operators.hpp
100.0% 87/87 20/23 source/lib/core/containers/stable_vector.hpp
100.0% 44/44 3/6 source/lib/core/containers/static_vector.hpp
100.0% 15/15 3/5 source/lib/core/control/session.hpp
100.0% 3/3 0/2 source/lib/core/control/triggers/roctx.hpp
100.0% 47/47 7/7 source/lib/core/control/triggers/time_window.hpp
100.0% 19/19 4/4 source/lib/core/control/waitable_clocks/steady.cpp
100.0% 2/2 2/2 source/lib/core/control/waitable_clocks/steady.hpp
100.0% 45/45 7/11 source/lib/core/demangler.hpp
100.0% 2/2 2/2 source/lib/core/node_info.hpp
100.0% 3/3 1/2 source/lib/core/output/output_summary.hpp
100.0% 1/1 0/1 source/lib/core/perfetto/category_registry.hpp
100.0% 1/1 0/1 source/lib/core/perfetto/engine.hpp
100.0% 7/7 0/1 source/lib/core/perfetto/sinks/file_output.hpp
100.0% 1/1 0/1 source/lib/core/perfetto/sinks/per_pid_file_sink.hpp
100.0% 2/2 0/1 source/lib/core/perfetto/sinks/single_file_sink.hpp
100.0% 2/2 0/1 source/lib/core/perfetto/sinks/trace_sink.hpp
100.0% 1/1 0/1 source/lib/core/progress/bar.hpp
100.0% 7/7 2/2 source/lib/core/progress/tracker.cpp
100.0% 1/1 0/1 source/lib/core/progress/tracker.hpp
100.0% 85/85 11/12 source/lib/core/state.hpp
100.0% 7/7 1/2 source/lib/core/trace_cache/cache_manager.hpp
100.0% 4/4 0/3 source/lib/core/trace_cache/data_types.hpp
100.0% 53/53 12/14 source/lib/core/trace_cache/metadata_registry.hpp
100.0% 1/1 1/1 source/lib/core/trace_cache/perfetto_processor.hpp
100.0% 7/7 1/3 source/lib/core/trace_cache/record_header.hpp
100.0% 13/13 0/1 source/lib/core/trace_cache/sample_processor.hpp
100.0% 2/2 0/1 source/lib/core/trace_cache/sample_processor_interface.hpp
100.0% 152/152 0/8 source/lib/core/trace_cache/sample_type.hpp
100.0% 8/8 2/2 source/lib/core/trace_cache/type_registry.hpp
100.0% 5/5 2/2 source/lib/core/track_registry.cpp
100.0% 4/4 0/2 source/lib/core/track_registry.hpp
100.0% 12/12 1/1 source/lib/logger/logger.cpp
100.0% 8/8 0/1 source/lib/rocprof-sys/library/causal/components/backtrace.hpp
100.0% 23/23 2/3 source/lib/rocprof-sys/library/causal/components/progress_point.hpp
100.0% 3/3 0/1 source/lib/rocprof-sys/library/causal/experiment.hpp
100.0% 4/4 1/1 source/lib/rocprof-sys/library/causal/selected_entry.cpp
100.0% 5/5 2/3 source/lib/rocprof-sys/library/causal/selected_entry.hpp
100.0% 1/1 0/1 source/lib/rocprof-sys/library/components/backtrace.hpp
100.0% 4/4 0/2 source/lib/rocprof-sys/library/components/backtrace_timestamp.hpp
100.0% 1/1 0/1 source/lib/rocprof-sys/library/components/callchain.hpp
100.0% 8/8 2/2 source/lib/rocprof-sys/library/components/ensure_storage.hpp
100.0% 1/1 0/1 source/lib/rocprof-sys/library/components/fork_gotcha.hpp
100.0% 2/2 0/1 source/lib/rocprof-sys/library/components/mpi_gotcha.hpp
100.0% 533/533 12/12 source/lib/rocprof-sys/library/components/mpip.hpp
100.0% 5/5 0/1 source/lib/rocprof-sys/library/components/pthread_create_gotcha.hpp
100.0% 24/24 1/2 source/lib/rocprof-sys/library/components/pthread_mutex_gotcha_policy.hpp
100.0% 11/11 0/3 source/lib/rocprof-sys/library/perf.hpp
100.0% 14/14 0/1 source/lib/rocprof-sys/library/pmc/collectors/common/collector_slice.hpp
100.0% 8/8 0/3 source/lib/rocprof-sys/library/pmc/collectors/cpu/types.hpp
100.0% 18/18 0/2 source/lib/rocprof-sys/library/pmc/collectors/gpu/sample.hpp
100.0% 11/11 0/3 source/lib/rocprof-sys/library/pmc/collectors/gpu/types.hpp
100.0% 8/8 0/1 source/lib/rocprof-sys/library/pmc/collectors/gpu_perf_counter/sample.hpp
100.0% 55/55 4/4 source/lib/rocprof-sys/library/pmc/collectors/hipfile/device.hpp
100.0% 36/36 2/3 source/lib/rocprof-sys/library/pmc/collectors/hipfile/hipfile_traits.hpp
100.0% 7/7 0/2 source/lib/rocprof-sys/library/pmc/collectors/hipfile/sample.hpp
100.0% 10/10 0/1 source/lib/rocprof-sys/library/pmc/collectors/nic/sample.hpp
100.0% 9/9 0/1 source/lib/rocprof-sys/library/pmc/collectors/nic/types.hpp
100.0% 3/3 0/3 source/lib/rocprof-sys/library/pmc/common/types.hpp
100.0% 15/15 2/3 source/lib/rocprof-sys/library/process_sampler.hpp
100.0% 9/9 1/1 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/code_object.hpp
100.0% 17/17 2/2 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/rccl/device_resolver.hpp
100.0% 47/47 4/4 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/rccl/rccl.hpp
100.0% 10/10 0/1 source/lib/rocprof-sys/library/rocprofiler-sdk/callback/roctx/control_api.hpp
100.0% 2/2 0/1 source/lib/rocprof-sys/library/runtime.hpp
100.0% 10/10 3/3 source/lib/rocprof-sys/library/thread_data_growth.hpp
100.0% 5/5 1/1 source/lib/rocprof-sys/library/thread_deleter.hpp

Distribution

Range Files
0-20% 30
20-50% 16
50-80% 56
80-100% 222

…nge-for

The index loop in gpu_perf_counter::sample::serialize() re-read the
vector's begin/end and recomputed size() after every entry, because a
write through the uint8_t output buffer may alias them. A range-for reads
them once; the generated write loop is now the same as develop's (64
entries: serialize 22.8 -> 14.3 ns, develop 14.2; deserialize 42.3 ->
32.0 ns, develop 48.0). Byte format unchanged.
…e cache

record_read() value-initialized the record (T record{}). Zeroing it first
kept the whole record in memory instead of letting the compiler fill the
destination directly, and the copy into its final place (the variant built
by type_registry) then read 16-byte blocks over the 8-byte stores that had
just filled it, stalling store forwarding once per string_view.

Default-initialize it instead, as the hand-written deserializers did: every
stored field is read right after, and fields that are not stored keep their
member initializers. On the type_registry read path (ns per record, develop
-> before -> after): memory_allocate 10.5 -> 17.9 -> 8.7, backtrace_region
11.1 -> 19.1 -> 9.6, pmc_event_with 12.1 -> 23.6 -> 13.1, kfd 11.8 -> 34.0
-> 14.2; the other types are unchanged and faster than develop.
…in archives

Replace ROCPROFSYS_INLINE (always_inline) with plain inline on the generic
get_size / serialize / deserialize, and drop it from the archive members
defined in the class, which are implicitly inline
(readability-redundant-inline-specifier). [[gnu::flatten]] on
record_size / record_write / record_read already inlines everything they
call, so the generated code is unchanged (kernel_dispatch_sample: write 38
instructions, read 23).

__attribute__((flatten)) becomes [[gnu::flatten]], which clang-format
understands: the function names are no longer pushed 30+ columns to the
right. archive.hpp no longer needs common/defines.h.
type_registry returned each record as a variant that get_type() then
moved into a std::optional, so every record was written and immediately
copied. The copy read 16-byte blocks over the narrower stores that had
just filled the record and stalled store forwarding; kfd_sample and
pmc_event_with_sample were slower than develop on the read path.

The deserializer now returns the std::optional itself and constructs the
record inside it: a reader object converts to T by reading it, so the
record is initialized directly in its final storage and get_type()
returns the optional without a copy. Every record type now reads faster
than develop through type_registry.

Also rename the touched member to m_deserializers and the iterator to
found (readability-identifier-naming / -length).
Keep only the comments that explain a non-obvious reason (aliasing, string views into the buffer, const_cast, flatten instead of inline, default-initialization, the in-place reader) and drop the ones that restate names or code.
…ile time

type_registry now fails to compile when two supported record types share a type_identifier, instead of silently overwriting one deserializer with the other at startup.
Nothing uses it. type_registry includes <variant> itself instead of getting it through cache_type_traits.hpp.
…the record_* layer

The multi-value utility::get_size, store_value and parse_value overloads were only used by tests after the records moved to archives; the tests now call the single-value versions. get_size, serialize and deserialize carry [[gnu::flatten]] themselves instead of forwarding to record_size, record_write and record_read. The generated code is unchanged.
…lden test

The cpu_pmc_sample golden test used two arbitrary bytes for the frequency and load vectors. It now packs two real cores with serialize_frequencies and serialize_loads, so the expected bytes pin the per-core entry layout (cpu_id followed by the value) and its byte-count prefix.
…er what they do

size_one, write_one and read_one become measure_value, write_value and read_value, matching utility::store_value and parse_value. Private members only; no behavior change.
…ecords

The [type id][size] header in front of every cached record was written by hand in store() and fragment_memory(), read through a packed struct in storage_parser, and its size was a separate formula. record_header now defines it once with a serialize() member: k_header_size is computed from it at compile time, store() writes header and record with one flattened write_record(), fragment_memory() and the parser use the same archives. A golden test pins the header bytes, which are unchanged; test_storage_parser keeps its own packed writer as an independent check of the old layout.
utility::parse_value read a vector element by element with push_back, one byte at a time for the CPU sample's byte vectors. It now resizes the vector once and copies the whole payload. Both the vector write and read static_assert that the element type is trivially copyable, since vectors are cached as raw bytes.
…vector

counter_value is an 8-byte id and an 8-byte double with no padding, so its in-memory layout already equals the cached layout. The sample now writes the entries vector as a whole instead of a uint32_t count followed by a per-entry loop; a static_assert keeps counter_value free of padding. The entries prefix becomes the archive's size_t byte count, so a gpu_perf_counter record grows by 4 bytes; the golden test is updated.
…drop k_is_loading

Archives now accept std::string (same encoding as std::string_view) and enums (written as their underlying integer, same bytes). The nic sample's device name and record_header's type are written directly, so no record needs a temporary value converted back after reading, and Archive::k_is_loading is removed together with its test.
@adjordje-amd
adjordje-amd marked this pull request as ready for review October 23, 2026 12:21
@adjordje-amd
adjordje-amd requested review from a team and jrmadsen as code owners October 23, 2026 12:21
@sputhala-amd
sputhala-amd requested a balanced review from Copilot October 23, 2026 12:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Malformed vector lengths can cause out-of-bounds writes, and golden-test size mismatches need to stop execution before fixed-buffer access.

2 open issues
What changed in this PR

This PR centralizes rocprofiler-systems trace-cache serialization so each record defines its field order once, reducing the risk of mismatched sizing, writing, and reading.

Changes:

  • Adds shared archives and record-header serialization, replacing per-record specializations.
  • Optimizes vector decoding and registry construction, and rejects duplicate type identifiers at compile time.
  • Adds archive and golden-byte tests, including the intentional GPU performance-counter format change.

Paths below are relative to projects/rocprofiler-systems/source/lib/.

File Description
rocprof-sys/​library/​pmc/​collectors/​nic/​types.hpp Adds serialization for NIC metrics and enabled flags.
rocprof-sys/​library/​pmc/​collectors/​nic/​sample.hpp Migrates NIC records to archives.
rocprof-sys/​library/​pmc/​collectors/​hipfile/​types.hpp Defines cached hipFile metric fields.
rocprof-sys/​library/​pmc/​collectors/​hipfile/​sample.hpp Migrates hipFile records to archives.
rocprof-sys/​library/​pmc/​collectors/​gpu/​types.hpp Serializes GPU metric flags.
rocprof-sys/​library/​pmc/​collectors/​gpu/​sample.hpp Migrates GPU records to archives.
rocprof-sys/​library/​pmc/​collectors/​gpu_perf_counter/​types.hpp Checks that counter entries have no padding.
rocprof-sys/​library/​pmc/​collectors/​gpu_perf_counter/​tests/​test_sample.cpp Updates size expectations for vector encoding.
rocprof-sys/​library/​pmc/​collectors/​gpu_perf_counter/​sample.hpp Serializes counter entries as one vector.
rocprof-sys/​library/​pmc/​collectors/​cpu/​types.hpp Adds CPU metric serialization.
rocprof-sys/​library/​pmc/​collectors/​cpu/​tests/​test_sample.cpp Includes the archive API explicitly.
rocprof-sys/​library/​pmc/​collectors/​cpu/​sample.hpp Migrates CPU records to archives.
core/​trace_cache/​type_registry.hpp Checks identifier uniqueness and constructs results in place.
core/​trace_cache/​tests/​test_type_registry.cpp Tests identifier uniqueness at compile time.
core/​trace_cache/​tests/​test_sample_type.cpp Includes the archive API explicitly.
core/​trace_cache/​tests/​test_record_format.cpp Adds golden-byte record and header tests.
core/​trace_cache/​tests/​test_cacheable.cpp Updates utility calls and supported-type checks.
core/​trace_cache/​tests/​test_archive.cpp Tests archive encoding and round trips.
core/​trace_cache/​tests/​mocked_types.hpp Migrates test records to member serialization.
core/​trace_cache/​tests/​CMakeLists.txt Registers the new tests.
core/​trace_cache/​storage_parser.hpp Reads headers through the archive API.
core/​trace_cache/​sample_type.hpp Consolidates trace-record field lists.
core/​trace_cache/​record_header.hpp Defines shared header sizing and writing.
core/​trace_cache/​CMakeLists.txt Registers the new headers.
core/​trace_cache/​cacheable.hpp Adds string support and bulk vector decoding.
core/​trace_cache/​cache_type_traits.hpp Simplifies traits and adds string and enum support.
core/​trace_cache/​buffer_storage.hpp Uses shared framing for records and fragments.
core/​trace_cache/​archive.hpp Implements size, write, and read archives.
backends/​amd_smi/​gpu_types.hpp Defines GPU metric serialization order.

Review effort: Balanced

parse_value resized the vector to total_size / sizeof(item) elements and then
copied total_size bytes. When the byte count is not a multiple of the element
size, the copy ran past the end of the allocation (one stray byte after a whole
uint32_t is a heap-buffer-overflow under ASan, and a count below one element
wrote through a null data pointer). The code before this PR copied only whole
elements.

Copy item_count * sizeof(item) bytes and still advance the cursor by the whole
byte count. store_value also skips the memcpy when there is nothing to copy, so
an empty vector or a default string_view no longer passes a null source.

The new test fails under ASan without the fix. Without a sanitizer it passes
either way, because the overflow lands in malloc slack.
… sample

gpu::metrics is a backend type, and it was the only backend type that defined
the field order of a trace cache record. CPU, NIC and hipFile define that order
in their collectors. Remove serialize() from gpu::metrics and list its fields in
gpu::sample::serialize(), so the backend no longer carries the cache byte layout.

The fields are archived in the same order as before, so the bytes do not change;
the golden test for gpu_pmc_sample passes unchanged.
…y wrongly

Review follow-ups for the trace cache archives.

- A record is serializable only when it declares serialize(Archive&) itself.
  A record derived from another one without its own serialize used to inherit
  the base one and silently skip its own fields, and a serialize that takes the
  archive by value lost the position. archive_serializable now checks the
  signature and the declaring class.
- A field that is copied as raw bytes must be plain data: numbers, scoped enums
  and arrays of them. A struct has to opt in with explicitly_raw (xcp_metrics
  and counter_value do, next to the records that use them). std::string,
  string_view, vectors and structs with pointers or padding are rejected at
  compile time instead of being copied as bytes. is_enum_class no longer fails
  to instantiate for a type that is not an enum.
- is_string_v becomes the string_like concept.
- expect_golden stops with ASSERT_EQ when a record grew, instead of writing past
  its expected bytes.
- The span<const std::byte> read branch of the archive is removed: no record in
  this PR reads a span. It comes back with the record that needs it.
- Document the trailing '\0' of stored strings, which consumers rely on.
- Compile-time tests for the checks above; the optional access in
  test_archive.cpp no longer calls value() after the check.
…op cacheable_t

type_registry::dispatch resolves a record's type id once with a fold over the
supported types and hands the deserialized record to a visitor. It replaces
the map of std::function, the std::variant, the std::visit cast to cacheable_t&
and the second switch plus static_cast in sample_processor_t.

- storage_parser::load calls handle_sample on the processor through dispatch;
  the sample_processor and sample_visitor concepts check every supported type
  at compile time.
- cacheable_t and all its empty bases are removed.
- buffer_size and flush_threshold use the data_size literals, and the flush
  timeout is a std::chrono::milliseconds.

Behavior change: a record with a type id that is not supported now throws
std::runtime_error out of load() instead of being skipped. memory_allocate_sample
is no longer guarded by ROCPROFILER_VERSION on the read path.
…ery use site

cacheable.hpp renamed buffer_size, flush_threshold, CACHE_FILE_FLUSH_TIMEOUT,
tmp_directory, ABSOLUTE and PERCENTAGE to their k_ names, but buffer_storage,
discovery, the cache policies and a few components still used the old names, so
the library did not compile.

- buffer_storage.{hpp,cpp}, cache_manager.cpp, discovery.cpp, test_buffer_storage.cpp:
  use k_buffer_size, k_flush_threshold, k_cache_file_flush_timeout and k_tmp_directory
- cacheable.hpp: keep get_buffered_storage_filename without the k_ prefix, as all
  callers use it (it is a function object, not a constant)
- components and the cpu, gpu, gpu_perf_counter, hipfile and nic cache policies,
  rocprofiler-sdk.cpp, rocprofiler-sdk/counters.cpp: trace_cache::k_absolute and
  trace_cache::k_percentage
- test_archive.cpp: rename the test's own k_buffer_size, which now clashes with the
  constant from cacheable.hpp
…/trace-cache-archives

# Conflicts:
#	projects/rocprofiler-systems/source/lib/core/trace_cache/tests/CMakeLists.txt
…rchives' into users/adjordje-amd/trace-cache-archives

# Conflicts:
#	projects/rocprofiler-systems/source/lib/rocprof-sys/library/pmc/collectors/cpu/cache_policy.hpp
…findings

Add direct includes, rename concept-handler param, make k_tmp_directory a constexpr string_view, split a test helper.
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants