rocprofiler-sdk/callback_tracing.h File Reference

rocprofiler-sdk/callback_tracing.h File Reference#

Rocprofiler SDK Developer API: rocprofiler-sdk/callback_tracing.h File Reference
Rocprofiler SDK Developer API 0.4.0
ROCm Profiling API and tools
callback_tracing.h File Reference
#include <rocprofiler-sdk/defines.h>
#include <rocprofiler-sdk/fwd.h>
#include <rocprofiler-sdk/hip.h>
#include <rocprofiler-sdk/hsa.h>
#include <rocprofiler-sdk/marker.h>
#include <hsa/hsa.h>
#include <hsa/hsa_amd_tool.h>
#include <hsa/hsa_ext_amd.h>
#include <hsa/hsa_ven_amd_loader.h>
#include <stdint.h>
+ Include dependency graph for callback_tracing.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rocprofiler_callback_tracing_hsa_api_data_t
 ROCProfiler HSA API Callback Data. More...
 
struct  rocprofiler_callback_tracing_hip_api_data_t
 ROCProfiler HIP runtime and compiler API Tracer Callback Data. More...
 
struct  rocprofiler_callback_tracing_marker_api_data_t
 ROCProfiler Marker Tracer Callback Data. More...
 
struct  rocprofiler_callback_tracing_code_object_load_data_t
 ROCProfiler Code Object Load Tracer Callback Record. More...
 
struct  rocprofiler_callback_tracing_code_object_kernel_symbol_register_data_t
 ROCProfiler Code Object Kernel Symbol Tracer Callback Record. More...
 
struct  rocprofiler_callback_tracing_kernel_dispatch_data_t
 ROCProfiler Kernel Dispatch Callback Tracer Record. More...
 
struct  rocprofiler_callback_tracing_memory_copy_data_t
 ROCProfiler Memory Copy Callback Tracer Record. More...
 
struct  rocprofiler_callback_tracing_scratch_memory_data_t
 ROCProfiler Scratch Memory Callback Data. More...
 
union  rocprofiler_callback_tracing_code_object_load_data_t.__unnamed10__
 
struct  rocprofiler_callback_tracing_code_object_load_data_t.__unnamed10__.__unnamed12__
 
struct  rocprofiler_callback_tracing_code_object_load_data_t.__unnamed10__.__unnamed14__
 

Typedefs

typedef void(* rocprofiler_callback_tracing_cb_t) (rocprofiler_callback_tracing_record_t record, rocprofiler_user_data_t *user_data, void *callback_data)
 API Tracing callback function. This function is invoked twice per API function: once before the function is invoked and once after the function is invoked. The external correlation id value within the record is assigned the value at the top of the external correlation id stack. It is permissible to invoke rocprofiler_push_external_correlation_id within the enter phase; when a new external correlation id is pushed during the enter phase, rocprofiler will use that external correlation id for any async events and provide the new external correlation id during the exit callback... In other words, pushing a new external correlation id within the enter callback will result in that external correlation id value in the exit callback (which may or may not be different from the external correlation id value in the enter callback). If a tool pushes new external correlation ids in the enter phase, it is recommended to pop the external correlation id in the exit callback.
 
typedef int(* rocprofiler_callback_tracing_kind_cb_t) (rocprofiler_callback_tracing_kind_t kind, void *data)
 Callback function for mapping rocprofiler_callback_tracing_kind_t ids to string names.
 
typedef int(* rocprofiler_callback_tracing_kind_operation_cb_t) (rocprofiler_callback_tracing_kind_t kind, uint32_t operation, void *data)
 Callback function for mapping the operations of a given rocprofiler_callback_tracing_kind_t to string names.
 
typedef int(* rocprofiler_callback_tracing_operation_args_cb_t) (rocprofiler_callback_tracing_kind_t kind, uint32_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, int32_t arg_dereference_count, void *data)
 Callback function for iterating over the function arguments to a traced function. This function will be invoked for each argument.
 

Enumerations

enum  rocprofiler_code_object_storage_type_t {
  ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_NONE = HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_NONE ,
  ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE = HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_FILE ,
  ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY ,
  ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_LAST
}
 ROCProfiler Enumeration for code object storage types (identical values to hsa_ven_amd_loader_code_object_storage_type_t enumeration) More...
 

Functions

rocprofiler_status_t rocprofiler_configure_callback_tracing_service (rocprofiler_context_id_t context_id, rocprofiler_callback_tracing_kind_t kind, rocprofiler_tracing_operation_t *operations, unsigned long operations_count, rocprofiler_callback_tracing_cb_t callback, void *callback_args)
 Configure Callback Tracing Service. The callback tracing service provides two synchronous callbacks around an API function on the same thread as the application which is invoking the API function. This function can only be invoked once per rocprofiler_callback_tracing_kind_t value, i.e. it can be invoked once for the HSA API, once for the HIP API, and so on but it will fail if it is invoked for the HSA API twice. Please note, the callback API does have the potentially non-trivial overhead of copying the function arguments into the record. If you are willing to let rocprofiler record the timestamps, do not require synchronous notifications of the API calls, and want to lowest possible overhead, use the.
 
rocprofiler_status_t rocprofiler_query_callback_tracing_kind_name (rocprofiler_callback_tracing_kind_t kind, const char **name, uint64_t *name_len)
 Query the name of the callback 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_callback_tracing_kind_operation_name (rocprofiler_callback_tracing_kind_t kind, uint32_t operation, const char **name, uint64_t *name_len)
 Query the name of the callback 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_callback_tracing_kinds (rocprofiler_callback_tracing_kind_cb_t callback, void *data)
 Iterate over all the mappings of the callback tracing kinds and get a callback for each kind.
 
rocprofiler_status_t rocprofiler_iterate_callback_tracing_kind_operations (rocprofiler_callback_tracing_kind_t kind, rocprofiler_callback_tracing_kind_operation_cb_t callback, void *data)
 Iterates over all the mappings of the operations for a given rocprofiler_callback_tracing_kind_t and invokes the callback with the kind id, operation id, and user-provided data.
 
rocprofiler_status_t rocprofiler_iterate_callback_tracing_kind_operation_args (rocprofiler_callback_tracing_record_t record, rocprofiler_callback_tracing_operation_args_cb_t callback, int32_t max_dereference_count, void *user_data)