[1/N] Agent Counter Collection Implementation (#832)

Added public API call to setup agent counter collection on a context.

Refactored the return types internally for dispatch counter collection
to use rocprofiler_status_t (allow for more verbose failures to be
surfaced via the API)

Subsequent commits will fill out the sampling functionality for agent
counter collection.

Co-authored-by: Benjamin Welton <ben@amd.com>
This commit is contained in:
Benjamin Welton
2024-05-01 13:34:54 -07:00
committad av GitHub
förälder e21609c80e
incheckning cb3fc070c7
14 ändrade filer med 192 tillägg och 53 borttagningar
+7 -19
Visa fil
@@ -34,30 +34,18 @@ ROCPROFILER_EXTERN_C_INIT
* @{
*/
/**
* @brief ROCProfiler Agent Profile Counting Data.
*
* Counters, including identifiers to get counter information and Counters values
*/
typedef struct
{
/**
*/
rocprofiler_record_counter_t* counters;
uint64_t counters_count;
} rocprofiler_agent_profile_counting_data_t;
/**
* @brief Configure Profile Counting Service for agent.
*
* @param [in] buffer_id
* @param [in] profile_config_id
* @param [in] context_id context id
* @param [in] buffer_id id of the buffer to use for the counting service
* @param [in] config_id Profile config detailing the counters to collect for this kernel
* @return ::rocprofiler_status_t
*/
rocprofiler_status_t ROCPROFILER_API
rocprofiler_configure_agent_profile_counting_service(
rocprofiler_buffer_id_t buffer_id,
rocprofiler_profile_config_id_t profile_config_id);
rocprofiler_configure_agent_profile_counting_service(rocprofiler_context_id_t context_id,
rocprofiler_buffer_id_t buffer_id,
rocprofiler_profile_config_id_t config_id);
/**
* @brief Sample Profile Counting Service for agent.
@@ -66,7 +54,7 @@ rocprofiler_configure_agent_profile_counting_service(
* @return ::rocprofiler_status_t
*/
rocprofiler_status_t ROCPROFILER_API
rocprofiler_sample_agent_profile_counting_service(rocprofiler_agent_profile_counting_data_t* data);
rocprofiler_sample_agent_profile_counting_service(rocprofiler_context_id_t context_id);
/** @} */