diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/thread_trace/att_core.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/thread_trace/att_core.cpp index 3a1fa5d56c..8f24f97f16 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/thread_trace/att_core.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/thread_trace/att_core.cpp @@ -456,6 +456,8 @@ DispatchThreadTracer::start_context() void DispatchThreadTracer::stop_context() // NOLINT(readability-convert-member-functions-to-static) { + CHECK_NOTNULL(hsa::get_queue_controller())->disable_serialization(); + client.wlock([&](auto& client_id) { if(!client_id) return; @@ -463,8 +465,6 @@ DispatchThreadTracer::stop_context() // NOLINT(readability-convert-member-funct CHECK_NOTNULL(hsa::get_queue_controller())->remove_callback(*client_id); client_id = std::nullopt; }); - - CHECK_NOTNULL(hsa::get_queue_controller())->disable_serialization(); } void