Asynchronous Tracing Service

Asynchronous Tracing Service#

ROCprofiler-SDK developer API: Asynchronous Tracing Service
ROCprofiler-SDK developer API 1.0.0
ROCm Profiling API and tools
Asynchronous Tracing Service

Receive callbacks for batches of records from an internal (background) thread. More...

Data Structures

struct  rocprofiler_buffer_tracing_hsa_api_record_t
 ROCProfiler Buffer HSA API Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_hip_api_record_t
 ROCProfiler Buffer HIP API Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_hip_api_ext_record_t
 ROCProfiler Buffer HIP API Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_ompt_target_t
 Additional trace data for OpenMP target routines. More...
 
struct  rocprofiler_buffer_tracing_ompt_record_t
 ROCProfiler Buffer OMPT Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_marker_api_record_t
 ROCProfiler Buffer Marker Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_rccl_api_record_t
 ROCProfiler Buffer RCCL API Record. More...
 
struct  rocprofiler_buffer_tracing_rocdecode_api_record_t
 ROCProfiler Buffer rocDecode API Record. More...
 
struct  rocprofiler_buffer_tracing_rocdecode_api_ext_record_t
 An extended ROCProfiler rocDecode API Tracer Record which includes function arguments. Pointers are not dereferenced. More...
 
struct  rocprofiler_buffer_tracing_rocjpeg_api_record_t
 ROCProfiler Buffer rocJPEG API Record. More...
 
struct  rocprofiler_buffer_tracing_memory_copy_record_t
 ROCProfiler Buffer Memory Copy Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_memory_allocation_record_t
 ROCProfiler Buffer Memory Allocation Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_kernel_dispatch_record_t
 ROCProfiler Buffer Kernel Dispatch Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_kfd_event_page_migrate_record_t
 ROCProfiler Buffer Page Migration event record from KFD. More...
 
struct  rocprofiler_buffer_tracing_kfd_event_page_fault_record_t
 ROCProfiler Buffer Page Fault event record from KFD. More...
 
struct  rocprofiler_buffer_tracing_kfd_event_queue_record_t
 ROCProfiler Buffer Queue event record from KFD. More...
 
struct  rocprofiler_buffer_tracing_kfd_event_unmap_from_gpu_record_t
 ROCProfiler Buffer Unmap of memory from GPU event record from KFD. More...
 
struct  rocprofiler_buffer_tracing_kfd_event_dropped_events_record_t
 ROCProfiler Buffer Dropped events event record, for when KFD reports that it has dropped some events. More...
 
struct  rocprofiler_buffer_tracing_kfd_page_migrate_record_t
 ROCProfiler Buffer Page Migration (paired) record from KFD. More...
 
struct  rocprofiler_buffer_tracing_kfd_page_fault_record_t
 ROCProfiler Buffer Page Fault (paired) record from KFD. More...
 
struct  rocprofiler_buffer_tracing_kfd_queue_record_t
 ROCProfiler Buffer Queue suspend (paired) record from KFD. More...
 
struct  rocprofiler_buffer_tracing_scratch_memory_record_t
 ROCProfiler Buffer Scratch Memory Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_correlation_id_retirement_record_t
 ROCProfiler Buffer Correlation ID Retirement Tracer Record. More...
 
struct  rocprofiler_buffer_tracing_runtime_initialization_record_t
 ROCProfiler Buffer Runtime Initialization Tracer Record. 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, rocprofiler_tracing_operation_t operation, void *data)
 Callback function for mapping the operations of a given rocprofiler_buffer_tracing_kind_t to string names.
 
typedef int(* rocprofiler_buffer_tracing_operation_args_cb_t) (rocprofiler_buffer_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, uint32_t arg_number, const void *const arg_value_addr, int32_t arg_indirection_count, const char *arg_type, const char *arg_name, const char *arg_value_str, void *data)
 Callback function for iterating over the function arguments to a traced function. This function will be invoked for each argument.
 

Functions

rocprofiler_status_t rocprofiler_configure_buffer_tracing_service (rocprofiler_context_id_t context_id, rocprofiler_buffer_tracing_kind_t kind, const 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, rocprofiler_tracing_operation_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.
 
rocprofiler_status_t rocprofiler_iterate_buffer_tracing_record_args (rocprofiler_record_header_t record, rocprofiler_buffer_tracing_operation_args_cb_t callback, void *user_data)
 

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, and samples/api_buffered_tracing/client.cpp.

Definition at line 47 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_hsa_api_record_t:
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, and samples/api_buffered_tracing/client.cpp.

Definition at line 71 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_hip_api_record_t:
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_hip_api_ext_record_t

struct rocprofiler_buffer_tracing_hip_api_ext_record_t

ROCProfiler Buffer HIP API Tracer Record.

Definition at line 92 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_hip_api_ext_record_t:
Data Fields
rocprofiler_hip_api_args_t args arguments of function call
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.
rocprofiler_hip_api_retval_t retval return value of function call
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_ompt_target_t

struct rocprofiler_buffer_tracing_ompt_target_t

Additional trace data for OpenMP target routines.

Definition at line 116 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_ompt_target_t:
Data Fields
const void * codeptr_ra
int32_t device_num
int32_t kind
uint64_t target_id
uint64_t task_id

◆ rocprofiler_buffer_tracing_ompt_record_t

struct rocprofiler_buffer_tracing_ompt_record_t

ROCProfiler Buffer OMPT Tracer Record.

Definition at line 146 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_ompt_record_t:
Data Fields
union rocprofiler_buffer_tracing_ompt_record_t.__unnamed1__ __unnamed__
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_BUFFER_TRACING_OMPT
rocprofiler_tracing_operation_t operation Specification of the rocprofiler_ompt_operation_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 172 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_marker_api_record_t:
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
rocprofiler_tracing_operation_t operation 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.
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_rccl_api_record_t

struct rocprofiler_buffer_tracing_rccl_api_record_t

ROCProfiler Buffer RCCL API Record.

Definition at line 195 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_rccl_api_record_t:
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_RCCL_API
rocprofiler_tracing_operation_t operation Specification of the API function, e.g., rocprofiler_rccl_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_rocdecode_api_record_t

struct rocprofiler_buffer_tracing_rocdecode_api_record_t

ROCProfiler Buffer rocDecode API Record.

Definition at line 214 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_rocdecode_api_record_t:
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_ROCDECODE_API
rocprofiler_rocdecode_api_id_t operation Specification of the API function, e.g., rocprofiler_rocdecode_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_rocdecode_api_ext_record_t

struct rocprofiler_buffer_tracing_rocdecode_api_ext_record_t

An extended ROCProfiler rocDecode API Tracer Record which includes function arguments. Pointers are not dereferenced.

Definition at line 234 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_rocdecode_api_ext_record_t:
Data Fields
rocprofiler_rocdecode_api_args_t args arguments of function call
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_BUFFER_TRACING_ROCDECODE_API_EXT
rocprofiler_rocdecode_api_id_t operation Specification of the API function (.
See also
rocprofiler_rocdecode_api_id_t)
rocprofiler_rocdecode_api_retval_t retval return value of function call
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_rocjpeg_api_record_t

struct rocprofiler_buffer_tracing_rocjpeg_api_record_t

ROCProfiler Buffer rocJPEG API Record.

Definition at line 256 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_rocjpeg_api_record_t:
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_ROCJPEG_API
rocprofiler_tracing_operation_t operation Specification of the API function (.
See also
rocprofiler_rocjpeg_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_memory_copy_record_t

struct rocprofiler_buffer_tracing_memory_copy_record_t

ROCProfiler Buffer Memory Copy Tracer Record.

Examples
api_buffered_tracing/client.cpp, and samples/api_buffered_tracing/client.cpp.

Definition at line 276 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_memory_copy_record_t:
Data Fields
uint64_t bytes bytes copied
rocprofiler_async_correlation_id_t correlation_id correlation ids for record
rocprofiler_address_t dst_address destination address
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 (.
See also
rocprofiler_memory_copy_operation_t)
uint64_t size size of this struct
rocprofiler_address_t src_address source address
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_memory_allocation_record_t

struct rocprofiler_buffer_tracing_memory_allocation_record_t

ROCProfiler Buffer Memory Allocation Tracer Record.

Definition at line 301 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_memory_allocation_record_t:
Data Fields
rocprofiler_address_t address starting address for memory allocation
rocprofiler_agent_id_t agent_id agent information for memory allocation
uint64_t allocation_size size for memory allocation
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_BUFFER_TRACING_MEMORY_ALLOCATION
rocprofiler_memory_allocation_operation_t operation Specification of the memory allocation function (.
See also
rocprofiler_memory_allocation_operation_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 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, and samples/api_buffered_tracing/client.cpp.

Definition at line 324 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kernel_dispatch_record_t:
Data Fields
rocprofiler_async_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_kfd_event_page_migrate_record_t

struct rocprofiler_buffer_tracing_kfd_event_page_migrate_record_t

ROCProfiler Buffer Page Migration event record from KFD.

Definition at line 344 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kfd_event_page_migrate_record_t:
Data Fields
rocprofiler_agent_id_t dst_agent Destination agent to which pages were migrated.
rocprofiler_address_t end_address End address of the memory range being migrated.
rocprofiler_buffer_tracing_kind_t kind
rocprofiler_kfd_event_page_migrate_operation_t operation
See also
rocprofiler_kfd_page_migrate_operation_t
uint32_t pid PID of the process as reported by KFD.
rocprofiler_agent_id_t preferred_agent Preferred location for this memory This field should be ignored on a migrate-end event.
rocprofiler_agent_id_t prefetch_agent Agent to which memory is to be prefetched. This field should be ignored on a migrate-end event.
uint64_t size Size of this struct.
rocprofiler_agent_id_t src_agent Source agent from which pages were migrated.
rocprofiler_address_t start_address Start address of the memory range being migrated.
rocprofiler_timestamp_t timestamp Timestamp of the event as reported by KFD.

◆ rocprofiler_buffer_tracing_kfd_event_page_fault_record_t

struct rocprofiler_buffer_tracing_kfd_event_page_fault_record_t

ROCProfiler Buffer Page Fault event record from KFD.

Definition at line 374 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kfd_event_page_fault_record_t:
Data Fields
rocprofiler_agent_id_t agent_id Agent ID which generated the fault.
rocprofiler_buffer_tracing_kind_t kind ROCPROFILER_BUFFER_TRACING_KFD_EVENT_PAGE_FAULT
rocprofiler_kfd_event_page_fault_operation_t operation
uint32_t pid PID of the process as reported by KFD.
uint64_t size Size of this struct.
rocprofiler_timestamp_t timestamp Timestamp of the event as reported by KFD.

◆ rocprofiler_buffer_tracing_kfd_event_queue_record_t

struct rocprofiler_buffer_tracing_kfd_event_queue_record_t

ROCProfiler Buffer Queue event record from KFD.

Definition at line 391 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kfd_event_queue_record_t:
Data Fields
rocprofiler_agent_id_t agent_id Agent ID on which this event occurred.
rocprofiler_buffer_tracing_kind_t kind ROCPROFILER_BUFFER_TRACING_KFD_EVENT_QUEUE
rocprofiler_kfd_event_queue_operation_t operation
See also
rocprofiler_kfd_queue_operation_t
uint32_t pid PID of the process as reported by KFD.
uint64_t size Size of this struct.
rocprofiler_timestamp_t timestamp Timestamp of the event as reported by KFD.

◆ rocprofiler_buffer_tracing_kfd_event_unmap_from_gpu_record_t

struct rocprofiler_buffer_tracing_kfd_event_unmap_from_gpu_record_t

ROCProfiler Buffer Unmap of memory from GPU event record from KFD.

Definition at line 404 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kfd_event_unmap_from_gpu_record_t:
Data Fields
rocprofiler_agent_id_t agent_id Agent ID on which memory ranges were unmapped.
rocprofiler_buffer_tracing_kind_t kind
rocprofiler_kfd_event_unmap_from_gpu_operation_t operation
See also
rocprofiler_kfd_unmap_from_gpu_operation_t
uint32_t pid PID of the process as reported by KFD.
uint64_t size Size of this struct.
rocprofiler_address_t start_address Start address of the memory range being unmapped.
rocprofiler_timestamp_t timestamp Timestamp of the event as reported by KFD.

◆ rocprofiler_buffer_tracing_kfd_event_dropped_events_record_t

struct rocprofiler_buffer_tracing_kfd_event_dropped_events_record_t

ROCProfiler Buffer Dropped events event record, for when KFD reports that it has dropped some events.

Definition at line 425 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kfd_event_dropped_events_record_t:
Data Fields
rocprofiler_buffer_tracing_kind_t kind
rocprofiler_kfd_event_dropped_events_operation_t operation
See also
rocprofiler_kfd_event_dropped_events_operation_t
uint32_t pid PID of the process as reported by KFD.
uint64_t size Size of this struct.
rocprofiler_timestamp_t timestamp Timestamp of the event as reported by KFD.

◆ rocprofiler_buffer_tracing_kfd_page_migrate_record_t

struct rocprofiler_buffer_tracing_kfd_page_migrate_record_t

ROCProfiler Buffer Page Migration (paired) record from KFD.

Definition at line 443 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kfd_page_migrate_record_t:
Data Fields
rocprofiler_agent_id_t dst_agent Destination agent to which pages were migrated.
rocprofiler_address_t end_address End address of the memory range being migrated.
rocprofiler_timestamp_t end_timestamp End timestamp as reported by KFD.
rocprofiler_buffer_tracing_kind_t kind ROCPROFILER_BUFFER_TRACING_KFD_PAGE_MIGRATE
rocprofiler_kfd_page_migrate_operation_t operation
uint32_t pid PID of the process as reported by KFD.
rocprofiler_agent_id_t preferred_agent Preferred location for this memory.
rocprofiler_agent_id_t prefetch_agent Agent to which memory is to be prefetched.
uint64_t size Size of this struct.
rocprofiler_agent_id_t src_agent Source agent from which pages were migrated.
rocprofiler_address_t start_address Start address of the memory range being migrated.
rocprofiler_timestamp_t start_timestamp Start timestamp as reported by KFD.

◆ rocprofiler_buffer_tracing_kfd_page_fault_record_t

struct rocprofiler_buffer_tracing_kfd_page_fault_record_t

ROCProfiler Buffer Page Fault (paired) record from KFD.

Definition at line 469 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kfd_page_fault_record_t:
Data Fields
rocprofiler_agent_id_t agent_id Agent ID which generated the fault.
rocprofiler_timestamp_t end_timestamp End timestamp as reported by KFD.
rocprofiler_buffer_tracing_kind_t kind ROCPROFILER_BUFFER_TRACING_KFD_PAGE_FAULT
rocprofiler_kfd_page_fault_operation_t operation
uint32_t pid PID of the process as reported by KFD.
uint64_t size Size of this struct.
rocprofiler_timestamp_t start_timestamp Start timestamp as reported by KFD.

◆ rocprofiler_buffer_tracing_kfd_queue_record_t

struct rocprofiler_buffer_tracing_kfd_queue_record_t

ROCProfiler Buffer Queue suspend (paired) record from KFD.

Definition at line 486 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_kfd_queue_record_t:
Data Fields
rocprofiler_agent_id_t agent_id Agent ID on which this event occurred.
rocprofiler_timestamp_t end_timestamp End timestamp as reported by KFD.
rocprofiler_buffer_tracing_kind_t kind ROCPROFILER_BUFFER_TRACING_KFD_QUEUE
rocprofiler_kfd_queue_operation_t operation
See also
rocprofiler_kfd_queue_operation_t
uint32_t pid PID of the process as reported by KFD.
uint64_t size Size of this struct.
rocprofiler_timestamp_t start_timestamp Start timestamp as reported by KFD.

◆ 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, and samples/api_buffered_tracing/client.cpp.

Definition at line 500 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_scratch_memory_record_t:
Data Fields
rocprofiler_agent_id_t agent_id agent kernel was dispatched on
uint64_t allocation_size size of scratch memory allocation in bytes
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 518 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_correlation_id_retirement_record_t:
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_runtime_initialization_record_t

struct rocprofiler_buffer_tracing_runtime_initialization_record_t

ROCProfiler Buffer Runtime Initialization Tracer Record.

Definition at line 539 of file buffer_tracing.h.

+ Collaboration diagram for rocprofiler_buffer_tracing_runtime_initialization_record_t:
Data Fields
rocprofiler_correlation_id_t correlation_id Correlation ID for these records are always zero.
uint64_t instance Number of times this runtime had been loaded previously.
rocprofiler_buffer_tracing_kind_t kind ROCPROFILER_BUFFER_TRACING_RUNTIME_INITIALIZATION
rocprofiler_runtime_initialization_operation_t operation Indicates which runtime was initialized/loaded.
uint64_t size size of this struct
rocprofiler_thread_id_t thread_id ID for thread which loaded this runtime.
rocprofiler_timestamp_t timestamp Timestamp (in nanosec) of when runtime was initialized/loaded.
uint64_t version The version number of the runtime.

Version number is encoded as: (10000 * MAJOR) + (100 * MINOR) + PATCH

Typedef Documentation

◆ rocprofiler_buffer_tracing_kind_cb_t

typedef int(* rocprofiler_buffer_tracing_kind_cb_t) (rocprofiler_buffer_tracing_kind_t kind, void *data)

#include <rocprofiler-sdk/buffer_tracing.h>

Callback function for mapping rocprofiler_buffer_tracing_kind_t ids to string names.

See also
rocprofiler_iterate_buffer_trace_kind_names.

Definition at line 572 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, rocprofiler_tracing_operation_t operation, void *data)

#include <rocprofiler-sdk/buffer_tracing.h>

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 580 of file buffer_tracing.h.

◆ rocprofiler_buffer_tracing_operation_args_cb_t

typedef int(* rocprofiler_buffer_tracing_operation_args_cb_t) (rocprofiler_buffer_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, uint32_t arg_number, const void *const arg_value_addr, int32_t arg_indirection_count, const char *arg_type, const char *arg_name, const char *arg_value_str, void *data)

#include <rocprofiler-sdk/buffer_tracing.h>

Callback function for iterating over the function arguments to a traced function. This function will be invoked for each argument.

See also
rocprofiler_iterate_buffer_tracing_record_args
Parameters
[in]kinddomain
[in]operationassociated domain operation
[in]arg_numberthe argument number, starting at zero
[in]arg_value_addrthe address of the argument stored by rocprofiler.
[in]arg_indirection_countthe total number of indirection levels for the argument, e.g. int == 0, int* == 1, int** == 2
[in]arg_typethe typeid name of the argument (not demangled)
[in]arg_namethe name of the argument in the prototype (or rocprofiler union)
[in]arg_value_strconversion of the argument to a string, e.g. operator<< overload
[in]datauser data

Definition at line 709 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,
const rocprofiler_tracing_operation_t operations,
unsigned long  operations_count,
rocprofiler_buffer_id_t  buffer_id 
)

#include <rocprofiler-sdk/buffer_tracing.h>

Configure Buffer Tracing Service.

Parameters
[in]context_idAssociated context to control activation of service
[in]kindBuffer tracing category
[in]operationsArray of specific operations (if desired)
[in]operations_countNumber of specific operations (if non-null set of operations)
[in]buffer_idBuffer to store the records in
Returns
rocprofiler_status_t
Return values
ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKEDrocprofiler_configure initialization phase has passed
ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUNDcontext is not valid
ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGUREDContext has already been configured for the rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUNDInvalid rocprofiler_buffer_tracing_kind_t
ROCPROFILER_STATUS_ERROR_OPERATION_NOT_FOUNDInvalid operation id for rocprofiler_buffer_tracing_kind_t kind was found
Examples
api_buffered_tracing/client.cpp, and samples/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 
)

#include <rocprofiler-sdk/buffer_tracing.h>

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]kindwhich buffer tracing kind operations to iterate over
[in]callbackCallback function invoked for each operation associated with rocprofiler_buffer_tracing_kind_t with the exception of the NONE and LAST values.
[in]dataUser data passed back into the callback
Returns
rocprofiler_status_t

◆ rocprofiler_iterate_buffer_tracing_kinds()

rocprofiler_status_t rocprofiler_iterate_buffer_tracing_kinds ( rocprofiler_buffer_tracing_kind_cb_t  callback,
void *  data 
)

#include <rocprofiler-sdk/buffer_tracing.h>

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]callbackCallback function invoked for each enumeration value in rocprofiler_buffer_tracing_kind_t with the exception of the NONE and LAST values.
[in]dataUser data passed back into the callback
Returns
rocprofiler_status_t

◆ 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 
)

#include <rocprofiler-sdk/buffer_tracing.h>

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]kindBuffer tracing domain
[out]nameIf 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_lenIf 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_FOUNDReturned if the domain id is not valid
ROCPROFILER_STATUS_SUCCESSReturned if a valid domain, regardless if there is a constant string or not.
Examples
api_buffered_tracing/client.cpp, and samples/api_buffered_tracing/client.cpp.

◆ rocprofiler_query_buffer_tracing_kind_operation_name()

rocprofiler_status_t rocprofiler_query_buffer_tracing_kind_operation_name ( rocprofiler_buffer_tracing_kind_t  kind,
rocprofiler_tracing_operation_t  operation,
const char **  name,
uint64_t *  name_len 
)

#include <rocprofiler-sdk/buffer_tracing.h>

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]kindBuffer tracing domain
[in]operationEnumeration id value which maps to a specific API function or event type
[out]nameIf 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_lenIf 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_FOUNDAn invalid domain id
ROCPROFILER_STATUS_ERROR_OPERATION_NOT_FOUNDThe operation number is not recognized for the given domain
ROCPROFILER_STATUS_ERROR_NOT_IMPLEMENTEDRocprofiler does not support providing the operation name within this domain
ROCPROFILER_STATUS_SUCCESSValid domain and operation, regardless of whether there is a constant string or not.