Hardware counters Information

Hardware counters Information#

Rocprofiler SDK Developer API: Hardware counters Information
Rocprofiler SDK Developer API 0.4.0
ROCm Profiling API and tools
Hardware counters Information

Query functions related to hardware counters. More...

Typedefs

typedef rocprofiler_status_t(* rocprofiler_available_dimensions_cb_t) (rocprofiler_counter_id_t id, const rocprofiler_record_dimension_info_t *dim_info, unsigned long num_dims, void *user_data)
 Callback that gives a list of available dimensions for a counter.
 
typedef rocprofiler_status_t(* rocprofiler_available_counters_cb_t) (rocprofiler_agent_id_t agent_id, rocprofiler_counter_id_t *counters, unsigned long num_counters, void *user_data)
 Callback that gives a list of counters available on an agent. The counters variable is owned by rocprofiler and should not be free'd.
 

Functions

rocprofiler_status_t rocprofiler_query_record_counter_id (rocprofiler_counter_instance_id_t id, rocprofiler_counter_id_t *counter_id)
 Query counter id information from record_id.
 
rocprofiler_status_t rocprofiler_query_record_dimension_position (rocprofiler_counter_instance_id_t id, rocprofiler_counter_dimension_id_t dim, unsigned long *pos)
 Query dimension position from record_id. If the dimension does not exist in the counter, the return will be 0.
 
rocprofiler_status_t rocprofiler_iterate_counter_dimensions (rocprofiler_counter_id_t id, rocprofiler_available_dimensions_cb_t info_cb, void *user_data)
 Return information about the dimensions that exists for a specific counter and the extent of each dimension.
 
rocprofiler_status_t rocprofiler_query_counter_info (rocprofiler_counter_id_t counter_id, rocprofiler_counter_info_version_id_t version, void *info)
 Query Counter info such as name or description.
 
rocprofiler_status_t rocprofiler_query_counter_instance_count (rocprofiler_agent_id_t agent_id, rocprofiler_counter_id_t counter_id, unsigned long *instance_count)
 This call returns the number of instances specific counter contains.
 
rocprofiler_status_t rocprofiler_iterate_agent_supported_counters (rocprofiler_agent_id_t agent_id, rocprofiler_available_counters_cb_t cb, void *user_data)
 Query Agent Counters Availability.
 

Detailed Description

Query functions related to hardware counters.

Typedef Documentation

◆ rocprofiler_available_counters_cb_t

typedef rocprofiler_status_t(* rocprofiler_available_counters_cb_t) (rocprofiler_agent_id_t agent_id, rocprofiler_counter_id_t *counters, unsigned long num_counters, void *user_data)

Callback that gives a list of counters available on an agent. The counters variable is owned by rocprofiler and should not be free'd.

Parameters
[in]agent_idAgent ID of the current callback
[in]countersAn array of counters that are avialable on the agent rocprofiler_iterate_agent_supported_counters was called on.
[in]num_countersNumber of counters contained in counters
[in]user_dataUser data supplied by rocprofiler_iterate_agent_supported_counters

Definition at line 141 of file counters.h.

◆ rocprofiler_available_dimensions_cb_t

typedef rocprofiler_status_t(* rocprofiler_available_dimensions_cb_t) (rocprofiler_counter_id_t id, const rocprofiler_record_dimension_info_t *dim_info, unsigned long num_dims, void *user_data)

Callback that gives a list of available dimensions for a counter.

Parameters
[in]idCounter id the dimension data is for
[in]dim_infoAn array of dimensions for the counter rocprofiler_iterate_counter_dimensions was called on.
[in]num_dimsNumber of dimensions
[in]user_dataUser data supplied by rocprofiler_iterate_agent_supported_counters

Definition at line 75 of file counters.h.

Function Documentation

◆ rocprofiler_iterate_agent_supported_counters()

rocprofiler_status_t rocprofiler_iterate_agent_supported_counters ( rocprofiler_agent_id_t  agent_id,
rocprofiler_available_counters_cb_t  cb,
void *  user_data 
)

Query Agent Counters Availability.

Parameters
[in]agent_idGPU agent identifier
[in]cbcallback to caller to get counters
[in]user_datadata to pass into the callback
Returns
rocprofiler_status_t
Return values
ROCPROFILER_STATUS_SUCCESSif counters found for agent
ROCPROFILER_STATUS_ERRORif no counters found for agent

◆ rocprofiler_iterate_counter_dimensions()

rocprofiler_status_t rocprofiler_iterate_counter_dimensions ( rocprofiler_counter_id_t  id,
rocprofiler_available_dimensions_cb_t  info_cb,
void *  user_data 
)

Return information about the dimensions that exists for a specific counter and the extent of each dimension.

Parameters
[in]idcounter id to query dimension info for.
[in]info_cbCallback to return dimension information for counter
[in]user_datadata to pass into the callback
Returns
rocprofiler_status_t
Return values
ROCPROFILER_STATUS_SUCCESSif dimension exists
ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUNDif counter is not found
ROCPROFILER_STATUS_ERROR_DIM_NOT_FOUNDif counter does not have this dimension

◆ rocprofiler_query_counter_info()

rocprofiler_status_t rocprofiler_query_counter_info ( rocprofiler_counter_id_t  counter_id,
rocprofiler_counter_info_version_id_t  version,
void *  info 
)

Query Counter info such as name or description.

Parameters
[in]counter_idcounter to get info for
[in]versionVersion of struct in info, see rocprofiler_counter_info_version_id_t for available types
[out]inforocprofiler_counter_info_{version}_t struct to write info to.
Returns
rocprofiler_status_t
Return values
ROCPROFILER_STATUS_SUCCESSif counter found
ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUNDif counter not found
ROCPROFILER_STATUS_ERROR_INCOMPATIBLE_ABIVersion is not supported

◆ rocprofiler_query_counter_instance_count()

rocprofiler_status_t rocprofiler_query_counter_instance_count ( rocprofiler_agent_id_t  agent_id,
rocprofiler_counter_id_t  counter_id,
unsigned long *  instance_count 
)

This call returns the number of instances specific counter contains.

Parameters
[in]agent_idrocprofiler agent identifier
[in]counter_idcounter id (obtained from iterate_agent_supported_counters)
[out]instance_countnumber of instances the counter has
Returns
rocprofiler_status_t
Return values
ROCPROFILER_STATUS_SUCCESSif counter found
ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUNDif counter not found

◆ rocprofiler_query_record_counter_id()

rocprofiler_status_t rocprofiler_query_record_counter_id ( rocprofiler_counter_instance_id_t  id,
rocprofiler_counter_id_t counter_id 
)

Query counter id information from record_id.

Parameters
[in]idrecord id from rocprofiler_record_counter_t
[out]counter_idcounter id associated with the record
Returns
rocprofiler_status_t
Return values
ROCPROFILER_STATUS_SUCCESSif id decoded

◆ rocprofiler_query_record_dimension_position()

rocprofiler_status_t rocprofiler_query_record_dimension_position ( rocprofiler_counter_instance_id_t  id,
rocprofiler_counter_dimension_id_t  dim,
unsigned long *  pos 
)

Query dimension position from record_id. If the dimension does not exist in the counter, the return will be 0.

Parameters
[in]idrecord id from rocprofiler_record_counter_t
[in]dimdimension for which positional info is requested (currently only 0 is allowed, i.e. flat array without dimension).
[out]posvalue of the dimension in id
Returns
rocprofiler_status_t
Return values
ROCPROFILER_STATUS_SUCCESSif dimension decoded