[SDK][rocprofv3] Buffer tracing records with args (HIP) (#285)

* [SDK][rocprofv3] HIP API buffer records with args (ext)

- New buffer tracing domain(s) for HIP APIs which include the arguments and the return value in the buffer records
- Update HIP stream support for extended HIP buffer tracing
- Update rocprofv3 tool library and output library to use extended HIP buffer tracing recods

* Update stream.cpp

- handle hipStream_t address being reused for a new stream

* Update doxygen docs for rocprofiler_iterate_buffer_tracing_record_args

* Update rocprofv3 tool.cpp

- configure buffer tracing services with HIP_*_API_EXT variants
- tweak logging level for hip_stream_display_callback

* Fix validation tests

- add HIP_RUNTIME_API_EXT and HIP_COMPILER_API_EXT to valid domain names

* Serialization support for buffer tracing args

* Disable stream service for __hipPopCallConfiguration

- this is interpreted as a stream create but it doesn't create a stream

* Fix execute_buffer_record_emplace for HIP extended contexts

* Add uint64_t_retval to rocprofiler_hip_api_retval_t union

- reading in hipError_t_retval during serialization of pointer return value causes undefined behavior

* Fix compilation warning about unused but set parameter

- in hip/stream.cpp

* Add synchronization for async_copy_data

* Fix compilation error

* Fix compilation error

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
Madsen, Jonathan
2025-03-22 19:57:32 -05:00
committed by GitHub
parent 2d072f9217
commit e33dff7ad0
30 changed files with 548 additions and 118 deletions
+15 -12
View File
@@ -36,20 +36,22 @@ namespace hip
template <>
struct hip_domain_info<ROCPROFILER_HIP_TABLE_ID_LAST>
{
using args_type = rocprofiler_hip_api_args_t;
using retval_type = rocprofiler_hip_api_retval_t;
using callback_data_type = rocprofiler_callback_tracing_hip_api_data_t;
using buffered_data_type = rocprofiler_buffer_tracing_hip_api_record_t;
using args_type = rocprofiler_hip_api_args_t;
using retval_type = rocprofiler_hip_api_retval_t;
using callback_data_type = rocprofiler_callback_tracing_hip_api_data_t;
using buffered_data_type = rocprofiler_buffer_tracing_hip_api_record_t;
using buffered_ext_data_type = rocprofiler_buffer_tracing_hip_api_ext_record_t;
};
template <>
struct hip_domain_info<ROCPROFILER_HIP_TABLE_ID_Runtime>
: hip_domain_info<ROCPROFILER_HIP_TABLE_ID_LAST>
{
static constexpr auto callback_domain_idx = ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API;
static constexpr auto buffered_domain_idx = ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API;
static constexpr auto none = ROCPROFILER_HIP_RUNTIME_API_ID_NONE;
static constexpr auto last = ROCPROFILER_HIP_RUNTIME_API_ID_LAST;
static constexpr auto callback_domain_idx = ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API;
static constexpr auto buffered_domain_idx = ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API;
static constexpr auto buffered_ext_domain_idx = ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API_EXT;
static constexpr auto none = ROCPROFILER_HIP_RUNTIME_API_ID_NONE;
static constexpr auto last = ROCPROFILER_HIP_RUNTIME_API_ID_LAST;
static constexpr auto external_correlation_id_domain_idx =
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HIP_RUNTIME_API;
};
@@ -58,10 +60,11 @@ template <>
struct hip_domain_info<ROCPROFILER_HIP_TABLE_ID_Compiler>
: hip_domain_info<ROCPROFILER_HIP_TABLE_ID_LAST>
{
static constexpr auto callback_domain_idx = ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API;
static constexpr auto buffered_domain_idx = ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API;
static constexpr auto none = ROCPROFILER_HIP_COMPILER_API_ID_NONE;
static constexpr auto last = ROCPROFILER_HIP_COMPILER_API_ID_LAST;
static constexpr auto callback_domain_idx = ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API;
static constexpr auto buffered_domain_idx = ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API;
static constexpr auto buffered_ext_domain_idx = ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API_EXT;
static constexpr auto none = ROCPROFILER_HIP_COMPILER_API_ID_NONE;
static constexpr auto last = ROCPROFILER_HIP_COMPILER_API_ID_LAST;
static constexpr auto external_correlation_id_domain_idx =
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HIP_COMPILER_API;
};