Asynchronous Tracing Service#
Rocprofiler SDK Developer API 0.4.0
ROCm Profiling API and tools
|
Receive callbacks for batches of records from an internal (background) thread. More...
Typedefs | |
typedef int(* | rocprofiler_buffer_tracing_kind_cb_t) (rocprofiler_buffer_tracing_kind_t kind, void *data) |
Callback function for mapping rocprofiler_buffer_tracing_kind_t ids to string names. | |
typedef int(* | rocprofiler_buffer_tracing_kind_operation_cb_t) (rocprofiler_buffer_tracing_kind_t kind, uint32_t operation, void *data) |
Callback function for mapping the operations of a given rocprofiler_buffer_tracing_kind_t to string names. | |
Functions | |
rocprofiler_status_t | rocprofiler_configure_buffer_tracing_service (rocprofiler_context_id_t context_id, rocprofiler_buffer_tracing_kind_t kind, rocprofiler_tracing_operation_t *operations, unsigned long operations_count, rocprofiler_buffer_id_t buffer_id) |
Configure Buffer Tracing Service. | |
rocprofiler_status_t | rocprofiler_query_buffer_tracing_kind_name (rocprofiler_buffer_tracing_kind_t kind, const char **name, uint64_t *name_len) |
Query the name of the buffer tracing kind. The name retrieved from this function is a string literal that is encoded in the read-only section of the binary (i.e. it is always "allocated" and never "deallocated"). | |
rocprofiler_status_t | rocprofiler_query_buffer_tracing_kind_operation_name (rocprofiler_buffer_tracing_kind_t kind, uint32_t operation, const char **name, uint64_t *name_len) |
Query the name of the buffer tracing kind. The name retrieved from this function is a string literal that is encoded in the read-only section of the binary (i.e. it is always "allocated" and never "deallocated"). | |
rocprofiler_status_t | rocprofiler_iterate_buffer_tracing_kinds (rocprofiler_buffer_tracing_kind_cb_t callback, void *data) |
Iterate over all the buffer tracing kinds and invokes the callback for each buffer tracing kind. | |
rocprofiler_status_t | rocprofiler_iterate_buffer_tracing_kind_operations (rocprofiler_buffer_tracing_kind_t kind, rocprofiler_buffer_tracing_kind_operation_cb_t callback, void *data) |
Iterates over all the operations for a given rocprofiler_buffer_tracing_kind_t and invokes the callback with the kind and operation id. This is useful to build a map of the operation names during tool initialization instead of querying rocprofiler everytime in the callback hotpath. | |
Detailed Description
Receive callbacks for batches of records from an internal (background) thread.
Data Structure Documentation
◆ rocprofiler_buffer_tracing_hsa_api_record_t
struct rocprofiler_buffer_tracing_hsa_api_record_t |
ROCProfiler Buffer HSA API Tracer Record.
- Examples
- api_buffered_tracing/client.cpp.
Definition at line 86 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
rocprofiler_correlation_id_t | correlation_id | correlation ids for record |
rocprofiler_timestamp_t | end_timestamp | end time in nanoseconds |
rocprofiler_buffer_tracing_kind_t | kind | ROCPROFILER_CALLBACK_TRACING_HSA_CORE_API, ROCPROFILER_CALLBACK_TRACING_HSA_AMD_EXT_API, ROCPROFILER_CALLBACK_TRACING_HSA_IMAGE_EXT_API, or ROCPROFILER_CALLBACK_TRACING_HSA_FINALIZE_EXT_API |
rocprofiler_tracing_operation_t | operation | Specification of the API function, e.g., rocprofiler_hsa_core_api_id_t, rocprofiler_hsa_amd_ext_api_id_t, rocprofiler_hsa_image_ext_api_id_t, or rocprofiler_hsa_finalize_ext_api_id_t. |
uint64_t | size | size of this struct |
rocprofiler_timestamp_t | start_timestamp | start time in nanoseconds |
rocprofiler_thread_id_t | thread_id | id for thread generating this record |
◆ rocprofiler_buffer_tracing_hip_api_record_t
struct rocprofiler_buffer_tracing_hip_api_record_t |
ROCProfiler Buffer HIP API Tracer Record.
- Examples
- api_buffered_tracing/client.cpp.
Definition at line 110 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
rocprofiler_correlation_id_t | correlation_id | correlation ids for record |
rocprofiler_timestamp_t | end_timestamp | end time in nanoseconds |
rocprofiler_buffer_tracing_kind_t | kind | ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API or ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API |
rocprofiler_tracing_operation_t | operation | Specification of the API function, e.g., rocprofiler_hip_runtime_api_id_t or rocprofiler_hip_compiler_api_id_t. |
uint64_t | size | size of this struct |
rocprofiler_timestamp_t | start_timestamp | start time in nanoseconds |
rocprofiler_thread_id_t | thread_id | id for thread generating this record |
◆ rocprofiler_buffer_tracing_marker_api_record_t
struct rocprofiler_buffer_tracing_marker_api_record_t |
ROCProfiler Buffer Marker Tracer Record.
Definition at line 131 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
rocprofiler_correlation_id_t | correlation_id | correlation ids for record |
rocprofiler_timestamp_t | end_timestamp | end time in nanoseconds |
rocprofiler_buffer_tracing_kind_t | kind |
ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_API, ROCPROFILER_CALLBACK_TRACING_MARKER_CONTROL_API, or ROCPROFILER_CALLBACK_TRACING_MARKER_NAME_API Specification of the API function, e.g., rocprofiler_marker_core_api_id_t, rocprofiler_marker_control_api_id_t, or rocprofiler_marker_name_api_id_t |
rocprofiler_tracing_operation_t | operation | |
uint64_t | size | size of this struct |
rocprofiler_timestamp_t | start_timestamp | start time in nanoseconds |
rocprofiler_thread_id_t | thread_id | id for thread generating this record |
◆ rocprofiler_buffer_tracing_memory_copy_record_t
struct rocprofiler_buffer_tracing_memory_copy_record_t |
ROCProfiler Buffer Memory Copy Tracer Record.
- Examples
- api_buffered_tracing/client.cpp.
Definition at line 153 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
uint64_t | bytes | bytes copied |
rocprofiler_correlation_id_t | correlation_id | correlation ids for record |
rocprofiler_agent_id_t | dst_agent_id | destination agent of copy |
rocprofiler_timestamp_t | end_timestamp | end time in nanoseconds |
rocprofiler_buffer_tracing_kind_t | kind | ROCPROFILER_BUFFER_TRACING_MEMORY_COPY |
rocprofiler_memory_copy_operation_t | operation |
Specification of the memory copy direction (.
|
uint64_t | size | size of this struct |
rocprofiler_agent_id_t | src_agent_id | source agent of copy |
rocprofiler_timestamp_t | start_timestamp | start time in nanoseconds |
rocprofiler_thread_id_t | thread_id | id for thread that triggered copy |
◆ rocprofiler_buffer_tracing_kernel_dispatch_record_t
struct rocprofiler_buffer_tracing_kernel_dispatch_record_t |
ROCProfiler Buffer Kernel Dispatch Tracer Record.
- Examples
- api_buffered_tracing/client.cpp.
Definition at line 176 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
rocprofiler_correlation_id_t | correlation_id | correlation ids for record |
rocprofiler_kernel_dispatch_info_t | dispatch_info | Dispatch info. |
rocprofiler_timestamp_t | end_timestamp | end time in nanoseconds |
rocprofiler_buffer_tracing_kind_t | kind | ROCPROFILER_BUFFER_TRACING_KERNEL_DISPATCH |
rocprofiler_kernel_dispatch_operation_t | operation | Kernel dispatch buffer records only report the ROCPROFILER_KERNEL_DISPATCH_COMPLETE operation because there are no "real" wrapper around the enqueuing of an individual kernel dispatch. |
uint64_t | size | size of this struct |
rocprofiler_timestamp_t | start_timestamp | start time in nanoseconds |
rocprofiler_thread_id_t | thread_id | id for thread that launched kernel |
◆ rocprofiler_buffer_tracing_page_migration_page_fault_record_t
struct rocprofiler_buffer_tracing_page_migration_page_fault_record_t |
Definition at line 193 of file buffer_tracing.h.
◆ rocprofiler_buffer_tracing_page_migration_page_migrate_record_t
struct rocprofiler_buffer_tracing_page_migration_page_migrate_record_t |
Definition at line 201 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
uint64_t | end_addr | End address of the page being migrated. |
uint32_t | from_node | Source node. |
uint32_t | preferred_node | Preferred destinaion node. |
uint32_t | prefetch_node | Node from which page was prefetched. |
uint64_t | start_addr | Start address of the page being migrated. |
uint32_t | to_node | Destination node. |
rocprofiler_page_migration_trigger_t | trigger | Cause of migration. |
◆ rocprofiler_buffer_tracing_page_migration_queue_suspend_record_t
struct rocprofiler_buffer_tracing_page_migration_queue_suspend_record_t |
Definition at line 212 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
uint32_t | node_id | GPU node from which the queue was suspended. |
uint8_t | rescheduled: 1 | |
rocprofiler_page_migration_queue_suspend_trigger_t | trigger | Cause of queue suspension. |
◆ rocprofiler_buffer_tracing_page_migration_unmap_from_gpu_record_t
struct rocprofiler_buffer_tracing_page_migration_unmap_from_gpu_record_t |
Definition at line 219 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
uint64_t | end_addr | End address of unmapped page. |
uint32_t | node_id | Node ID from which page was unmapped. |
uint64_t | start_addr | Start address of unmapped page. |
rocprofiler_page_migration_unmap_from_gpu_trigger_t | trigger | Cause of unmap. |
◆ rocprofiler_buffer_tracing_page_migration_record_t
struct rocprofiler_buffer_tracing_page_migration_record_t |
ROCProfiler Buffer Page Migration Tracer Record.
- Examples
- api_buffered_tracing/client.cpp.
Definition at line 230 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
union rocprofiler_buffer_tracing_page_migration_record_t.__unnamed5__ | __unnamed__ | |
rocprofiler_timestamp_t | end_timestamp | end time in nanoseconds |
rocprofiler_buffer_tracing_kind_t | kind | ROCPROFILER_BUFFER_TRACING_PAGE_MIGRATION. |
rocprofiler_tracing_operation_t | operation | |
uint32_t | pid | |
uint64_t | size | size of this struct |
rocprofiler_timestamp_t | start_timestamp | start time in nanoseconds |
◆ rocprofiler_buffer_tracing_scratch_memory_record_t
struct rocprofiler_buffer_tracing_scratch_memory_record_t |
ROCProfiler Buffer Scratch Memory Tracer Record.
- Examples
- api_buffered_tracing/client.cpp.
Definition at line 255 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
rocprofiler_agent_id_t | agent_id | agent kernel was dispatched on |
rocprofiler_correlation_id_t | correlation_id | correlation ids for record |
rocprofiler_timestamp_t | end_timestamp | end time in nanoseconds |
rocprofiler_scratch_alloc_flag_t | flags | |
rocprofiler_buffer_tracing_kind_t | kind | ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY |
rocprofiler_scratch_memory_operation_t | operation | specification of the kind |
rocprofiler_queue_id_t | queue_id | queue kernel was dispatched on |
uint64_t | size | size of this struct |
rocprofiler_timestamp_t | start_timestamp | start time in nanoseconds |
rocprofiler_thread_id_t | thread_id | id for thread generating this record |
◆ rocprofiler_buffer_tracing_correlation_id_retirement_record_t
struct rocprofiler_buffer_tracing_correlation_id_retirement_record_t |
ROCProfiler Buffer Correlation ID Retirement Tracer Record.
Definition at line 272 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
uint64_t | internal_correlation_id | Only internal correlation ID is provided. |
rocprofiler_buffer_tracing_kind_t | kind | ROCPROFILER_BUFFER_TRACING_CORRELATION_ID_RETIREMENT |
uint64_t | size | size of this struct |
rocprofiler_timestamp_t | timestamp | Timestamp (in nanosec) of when rocprofiler detected the correlation ID could be retired. Due to clock skew between the CPU and GPU, this may at times, appear to be before the kernel or memory copy completed but the reality is that if this ever occurred, the API would report a FATAL error. |
◆ rocprofiler_buffer_tracing_page_migration_record_t.__unnamed5__
union rocprofiler_buffer_tracing_page_migration_record_t.__unnamed5__ |
Definition at line 239 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
struct rocprofiler_buffer_tracing_page_migration_record_t.__unnamed5__.__unnamed7__ | __unnamed__ | |
rocprofiler_buffer_tracing_page_migration_page_fault_record_t | page_fault | |
rocprofiler_buffer_tracing_page_migration_page_migrate_record_t | page_migrate | |
rocprofiler_buffer_tracing_page_migration_queue_suspend_record_t | queue_suspend | |
rocprofiler_buffer_tracing_page_migration_unmap_from_gpu_record_t | unmap_from_gpu |
◆ rocprofiler_buffer_tracing_page_migration_record_t.__unnamed5__.__unnamed7__
struct rocprofiler_buffer_tracing_page_migration_record_t.__unnamed5__.__unnamed7__ |
Definition at line 245 of file buffer_tracing.h.
Data Fields | ||
---|---|---|
uint64_t | reserved[12] |
Typedef Documentation
◆ rocprofiler_buffer_tracing_kind_cb_t
typedef int(* rocprofiler_buffer_tracing_kind_cb_t) (rocprofiler_buffer_tracing_kind_t kind, void *data) |
Callback function for mapping rocprofiler_buffer_tracing_kind_t ids to string names.
- See also
- rocprofiler_iterate_buffer_trace_kind_names.
Definition at line 294 of file buffer_tracing.h.
◆ rocprofiler_buffer_tracing_kind_operation_cb_t
typedef int(* rocprofiler_buffer_tracing_kind_operation_cb_t) (rocprofiler_buffer_tracing_kind_t kind, uint32_t operation, void *data) |
Callback function for mapping the operations of a given rocprofiler_buffer_tracing_kind_t to string names.
- See also
- rocprofiler_iterate_buffer_trace_kind_operation_names.
Definition at line 302 of file buffer_tracing.h.
Enumeration Type Documentation
◆ rocprofiler_page_migration_queue_suspend_trigger_t
Page migration triggers causing the queue to suspend.
Definition at line 58 of file buffer_tracing.h.
◆ rocprofiler_page_migration_trigger_t
Page migration triggers.
Definition at line 44 of file buffer_tracing.h.
◆ rocprofiler_page_migration_unmap_from_gpu_trigger_t
Page migration triggers causing an unmap from the GPU.
Definition at line 74 of file buffer_tracing.h.
Function Documentation
◆ rocprofiler_configure_buffer_tracing_service()
rocprofiler_status_t rocprofiler_configure_buffer_tracing_service | ( | rocprofiler_context_id_t | context_id, |
rocprofiler_buffer_tracing_kind_t | kind, | ||
rocprofiler_tracing_operation_t * | operations, | ||
unsigned long | operations_count, | ||
rocprofiler_buffer_id_t | buffer_id | ||
) |
Configure Buffer Tracing Service.
- Parameters
-
[in] context_id Associated context to control activation of service [in] kind Buffer tracing category [in] operations Array of specific operations (if desired) [in] operations_count Number of specific operations (if non-null set of operations) [in] buffer_id Buffer to store the records in
- Returns
- rocprofiler_status_t
- Return values
-
ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED rocprofiler_configure initialization phase has passed ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND context is not valid ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED Context has already been configured for the rocprofiler_buffer_tracing_kind_t kind ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Invalid rocprofiler_buffer_tracing_kind_t ROCPROFILER_STATUS_ERROR_OPERATION_NOT_FOUND Invalid operation id for rocprofiler_buffer_tracing_kind_t kind was found
- Examples
- api_buffered_tracing/client.cpp.
◆ rocprofiler_iterate_buffer_tracing_kind_operations()
rocprofiler_status_t rocprofiler_iterate_buffer_tracing_kind_operations | ( | rocprofiler_buffer_tracing_kind_t | kind, |
rocprofiler_buffer_tracing_kind_operation_cb_t | callback, | ||
void * | data | ||
) |
Iterates over all the operations for a given rocprofiler_buffer_tracing_kind_t and invokes the callback with the kind and operation id. This is useful to build a map of the operation names during tool initialization instead of querying rocprofiler everytime in the callback hotpath.
- Parameters
-
[in] kind which buffer tracing kind operations to iterate over [in] callback Callback function invoked for each operation associated with rocprofiler_buffer_tracing_kind_t with the exception of the NONE
andLAST
values.[in] data User data passed back into the callback
Referenced by rocprofiler::sdk::get_buffer_tracing_names().
◆ rocprofiler_iterate_buffer_tracing_kinds()
rocprofiler_status_t rocprofiler_iterate_buffer_tracing_kinds | ( | rocprofiler_buffer_tracing_kind_cb_t | callback, |
void * | data | ||
) |
Iterate over all the buffer tracing kinds and invokes the callback for each buffer tracing kind.
This is typically used to invoke rocprofiler_iterate_buffer_tracing_kind_operations for each buffer tracing kind.
- Parameters
-
[in] callback Callback function invoked for each enumeration value in rocprofiler_buffer_tracing_kind_t with the exception of the NONE
andLAST
values.[in] data User data passed back into the callback
Referenced by rocprofiler::sdk::get_buffer_tracing_names().
◆ rocprofiler_query_buffer_tracing_kind_name()
rocprofiler_status_t rocprofiler_query_buffer_tracing_kind_name | ( | rocprofiler_buffer_tracing_kind_t | kind, |
const char ** | name, | ||
uint64_t * | name_len | ||
) |
Query the name of the buffer tracing kind. The name retrieved from this function is a string literal that is encoded in the read-only section of the binary (i.e. it is always "allocated" and never "deallocated").
- Parameters
-
[in] kind Buffer tracing domain [out] name If non-null and the name is a constant string that does not require dynamic allocation, this paramter will be set to the address of the string literal, otherwise it will be set to nullptr [out] name_len If non-null, this will be assigned the length of the name (regardless of the name is a constant string or requires dynamic allocation)
- Returns
- rocprofiler_status_t
- Return values
-
ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Returned if the domain id is not valid ROCPROFILER_STATUS_SUCCESS Returned if a valid domain, regardless if there is a constant string or not.
- Examples
- api_buffered_tracing/client.cpp.
Referenced by rocprofiler::sdk::get_buffer_tracing_names().
◆ rocprofiler_query_buffer_tracing_kind_operation_name()
rocprofiler_status_t rocprofiler_query_buffer_tracing_kind_operation_name | ( | rocprofiler_buffer_tracing_kind_t | kind, |
uint32_t | operation, | ||
const char ** | name, | ||
uint64_t * | name_len | ||
) |
Query the name of the buffer tracing kind. The name retrieved from this function is a string literal that is encoded in the read-only section of the binary (i.e. it is always "allocated" and never "deallocated").
- Parameters
-
[in] kind Buffer tracing domain [in] operation Enumeration id value which maps to a specific API function or event type [out] name If non-null and the name is a constant string that does not require dynamic allocation, this paramter will be set to the address of the string literal, otherwise it will be set to nullptr [out] name_len If non-null, this will be assigned the length of the name (regardless of the name is a constant string or requires dynamic allocation)
- Returns
- rocprofiler_status_t
- Return values
-
ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND An invalid domain id ROCPROFILER_STATUS_ERROR_OPERATION_NOT_FOUND The operation number is not recognized for the given domain ROCPROFILER_STATUS_ERROR_NOT_IMPLEMENTED Rocprofiler does not support providing the operation name within this domain ROCPROFILER_STATUS_SUCCESS Valid domain and operation, regardless of whether there is a constant string or not.
Referenced by rocprofiler::sdk::get_buffer_tracing_names().
Generated by 1.9.8