Stop all client contexts prior to finalization (#721)

* Stop all client contexts prior to finalization

* Update lib/common/container/static_vector.hpp

- improve emplace_back for non-{move,copy}-assignable object

* Update samples/intercept_table/client.cpp

- improve robustness against static object destruction

* Update lib/rocprofiler-sdk/context/context.cpp

- change storage of registered context array
  - stable_vector of optional contexts
  - common::static_object wrapper around stable_vector

* Update samples/intercept_table/client.cpp

- use variable template for underlying function pointer
Αυτή η υποβολή περιλαμβάνεται σε:
Jonathan R. Madsen
2024-04-02 03:05:11 -05:00
υποβλήθηκε από GitHub
γονέας e3c7eed7c0
υποβολή 939e23e9d1
9 αρχεία άλλαξαν με 115 προσθήκες και 63 διαγραφές
@@ -278,8 +278,10 @@ TEST(rocprofiler_lib, callback_registration_lambda_with_result)
static fini_func_t tool_fini = [](void* client_data) -> void {
auto* cb_data = static_cast<callback_data*>(client_data);
ROCPROFILER_CALL(rocprofiler_stop_context(cb_data->client_ctx),
"rocprofiler context stop failed");
int status = 0;
ROCPROFILER_CALL(rocprofiler_context_is_active(cb_data->client_ctx, &status),
"rocprofiler_context_is_active failed");
EXPECT_EQ(status, 0);
static_cast<callback_data*>(client_data)->client_workflow_count++;
};
@@ -429,8 +431,10 @@ TEST(rocprofiler_lib, buffer_registration_lambda_with_result)
auto* cb_data = static_cast<callback_data*>(client_data);
ROCPROFILER_CALL(rocprofiler_flush_buffer(cb_data->client_buffer),
"rocprofiler context stop failed");
ROCPROFILER_CALL(rocprofiler_stop_context(cb_data->client_ctx),
"rocprofiler context stop failed");
int status = 0;
ROCPROFILER_CALL(rocprofiler_context_is_active(cb_data->client_ctx, &status),
"rocprofiler_context_is_active failed");
EXPECT_EQ(status, 0);
static_cast<callback_data*>(client_data)->client_workflow_count++;
};