Remove fatal error when callback and buffer tracing API in one context (#952)

- one context for callback and buffer tracing of same API produces erroneous fatal error -- this is a valid use case

[ROCm/rocprofiler-sdk commit: b62ba5f096]
This commit is contained in:
Jonathan R. Madsen
2024-06-25 02:51:41 -05:00
committad av GitHub
förälder 0ce0771c23
incheckning 869a5693d1
4 ändrade filer med 0 tillägg och 97 borttagningar
@@ -222,9 +222,6 @@ hip_api_impl<TableIdx, OpIdx>::functor(Args... args)
return;
}
ROCP_FATAL_IF(external_corr_ids.size() < (callback_contexts.size() + buffered_contexts.size()))
<< "missing external correlation ids";
auto buffer_record = common::init_public_api_struct(buffered_api_data_t{});
auto tracer_data = common::init_public_api_struct(callback_api_data_t{});
auto* corr_id = tracing::correlation_service::construct(ref_count);
@@ -337,9 +337,6 @@ hsa_api_impl<TableIdx, OpIdx>::functor(Args... args)
return;
}
ROCP_FATAL_IF(external_corr_ids.size() < (callback_contexts.size() + buffered_contexts.size()))
<< "missing external correlation ids";
auto buffer_record = common::init_public_api_struct(buffer_hsa_api_record_t{});
auto tracer_data = common::init_public_api_struct(callback_hsa_api_data_t{});
auto* corr_id = tracing::correlation_service::construct(ref_count);
@@ -165,9 +165,6 @@ roctx_api_impl<TableIdx, OpIdx>::functor(Args... args)
return;
}
ROCP_FATAL_IF(external_corr_ids.size() < (callback_contexts.size() + buffered_contexts.size()))
<< "missing external correlation ids";
auto ref_count = 2;
auto buffer_record = common::init_public_api_struct(buffered_api_data_t{});
auto tracer_data = common::init_public_api_struct(callback_api_data_t{});
@@ -37,94 +37,6 @@ namespace rocprofiler
{
namespace tracing
{
// template <typename DomainT, typename... Args>
// bool
// context_filter(const context::context* ctx, DomainT domain, Args... args);
// template <typename ClearContainersT = std::false_type>
// void
// populate_contexts(rocprofiler_callback_tracing_kind_t callback_domain_idx,
// rocprofiler_buffer_tracing_kind_t buffered_domain_idx,
// rocprofiler_tracing_operation_t operation_idx,
// callback_context_data_vec_t& callback_contexts,
// buffered_context_data_vec_t& buffered_contexts,
// external_correlation_id_map_t& extern_corr_ids,
// ClearContainersT = ClearContainersT{});
// template <typename ClearContainersT = std::false_type>
// void
// populate_contexts(rocprofiler_callback_tracing_kind_t callback_domain_idx,
// rocprofiler_buffer_tracing_kind_t buffered_domain_idx,
// callback_context_data_vec_t& callback_contexts,
// buffered_context_data_vec_t& buffered_contexts,
// external_correlation_id_map_t& extern_corr_ids,
// ClearContainersT = ClearContainersT{});
// template <typename ClearContainersT = std::false_type>
// void
// populate_contexts(rocprofiler_callback_tracing_kind_t callback_domain_idx,
// rocprofiler_buffer_tracing_kind_t buffered_domain_idx,
// rocprofiler_tracing_operation_t operation_idx,
// tracing_data& data,
// ClearContainersT = ClearContainersT{});
// template <typename ClearContainersT = std::false_type>
// void
// populate_contexts(rocprofiler_callback_tracing_kind_t callback_domain_idx,
// rocprofiler_buffer_tracing_kind_t buffered_domain_idx,
// tracing_data& data,
// ClearContainersT = ClearContainersT{});
// void
// populate_external_correlation_ids(external_correlation_id_map_t& external_corr_ids,
// rocprofiler_thread_id_t thr_id,
// rocprofiler_external_correlation_id_request_kind_t kind,
// rocprofiler_tracing_operation_t operation,
// uint64_t internal_corr_id);
// void
// update_external_correlation_ids(external_correlation_id_map_t& external_corr_ids,
// rocprofiler_thread_id_t thr_id,
// rocprofiler_external_correlation_id_request_kind_t kind);
// template <typename TracerDataT>
// void
// execute_phase_none_callbacks(callback_context_data_vec_t& callback_contexts,
// rocprofiler_thread_id_t thr_id,
// uint64_t internal_corr_id,
// external_correlation_id_map_t& external_corr_ids,
// rocprofiler_callback_tracing_kind_t domain,
// rocprofiler_tracing_operation_t operation,
// TracerDataT& tracer_data);
// template <typename TracerDataT>
// void
// execute_phase_enter_callbacks(callback_context_data_vec_t& callback_contexts,
// rocprofiler_thread_id_t thr_id,
// uint64_t internal_corr_id,
// external_correlation_id_map_t& external_corr_ids,
// rocprofiler_callback_tracing_kind_t domain,
// rocprofiler_tracing_operation_t operation,
// TracerDataT& tracer_data);
// template <typename TracerDataT>
// void
// execute_phase_exit_callbacks(callback_context_data_vec_t& callback_contexts,
// external_correlation_id_map_t& external_corr_ids,
// rocprofiler_callback_tracing_kind_t domain,
// rocprofiler_tracing_operation_t operation,
// TracerDataT& tracer_data);
// template <typename BufferRecordT, typename OperationT = rocprofiler_tracing_operation_t>
// void
// execute_buffer_record_emplace(buffered_context_data_vec_t& buffered_contexts,
// rocprofiler_thread_id_t thr_id,
// uint64_t internal_corr_id,
// external_correlation_id_map_t& external_corr_ids,
// rocprofiler_buffer_tracing_kind_t domain,
// OperationT operation,
// BufferRecordT&& base_record);
template <typename DomainT, typename... Args>
inline bool
context_filter(const context::context* ctx, DomainT domain, Args... args)