Skip to content

Add printing device tracing records for non-target callbacks - #8

Merged
Thyre merged 7 commits into
FZJ-JSC:mainfrom
Thyre:device-tracing-records
Mar 16, 2026
Merged

Add printing device tracing records for non-target callbacks#8
Thyre merged 7 commits into
FZJ-JSC:mainfrom
Thyre:device-tracing-records

Conversation

@Thyre

@Thyre Thyre commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

This PR significantly expands the handling of the device tracing interface by first trying to register all available device tracing records, and then printing them, similarly to the already implemented target records.
Additionally, refactor the existing code to simplify registering device tracing records and printing them.

Avoided implementing the error record for now, as implementations like LLVM do not provide the record in ompt_record_ompt_t currently, see llvm/llvm-project#185683.

TODO:

  • Ensure this builds with old LLVM, NVHPC, ROCm, CCE, Intel Compiler versions.
    • LLVM 12.x
    • NVHPC 22.1
    • ROCm 5.7.0
    • CCE 16.x.x
    • Intel oneAPI 2021.4.0 / Intel Classic Compilers

@Thyre
Thyre force-pushed the device-tracing-records branch 3 times, most recently from 542afd0 to 2b9bcb1 Compare March 14, 2026 12:50
Thyre added 6 commits March 16, 2026 08:50
Enabling the records largely follows a similar structure. Therefore refactor
most of the logic into a macro. We still need to explicitly reset the
`registration_success` flag, as an implementation might not provide all the
necessary callback values.

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
Try to register all available device tracing record callbacks.
While no runtime supporting any records beyond target, target_data_op,
target_submit and target_map is known, this might change in future runtime
releases. Hence, prepare early so that we can adapt as soon as possible.

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
In case we did not enable getting the full output, ensure that the buffer_complete
callback only prints the most necessary information.

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
Add printf output, similar to existing accelerator events.
Since we return early on non-printing modes, we can unconditionally
print the results. Skip error callback for now, since some runtimes do
not implement the type in ompt_record_ompt_t.

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
@Thyre
Thyre force-pushed the device-tracing-records branch 2 times, most recently from ee0019d to dadcb39 Compare March 16, 2026 10:37
Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
@Thyre
Thyre force-pushed the device-tracing-records branch from dadcb39 to 63af040 Compare March 16, 2026 10:39
@Thyre
Thyre marked this pull request as ready for review March 16, 2026 10:39
@Thyre
Thyre merged commit 26f49bc into FZJ-JSC:main Mar 16, 2026
43 of 44 checks passed
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.

1 participant