From 637abbf8d7a6997eb0833dfe8c8ce993049ec8b8 Mon Sep 17 00:00:00 2001 From: Giovanni LB Date: Fri, 19 Jul 2024 03:28:24 -0300 Subject: [PATCH] SWDEV-474615: Adding barrier bit to read and stop packets Change-Id: I895dc7389d870ed111ac3b9c400e6946023ffe97 --- src/core/hsa/queues/queue.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/hsa/queues/queue.cpp b/src/core/hsa/queues/queue.cpp index 7208dced61..5206ce83b4 100644 --- a/src/core/hsa/queues/queue.cpp +++ b/src/core/hsa/queues/queue.cpp @@ -549,7 +549,6 @@ bool Queue::CheckNeededProfileConfigs() std::unique_lock session_id_lock(session_id_mutex); is_counter_collection_mode = false; is_timestamp_collection_mode = false; - is_timestamp_collection_mode = false; is_att_collection_mode = false; is_pc_sampling_collection_mode = false; session_data_count = 0; @@ -561,6 +560,7 @@ bool Queue::CheckNeededProfileConfigs() session_id = rocprofiler_singleton.GetCurrentSessionId(); // Getting Counters count from the Session if (session_id.handle == 0) return false; + session = rocprofiler_singleton.GetSession(session_id); if (session && session->FindFilterWithKind(ROCPROFILER_COUNTERS_COLLECTION)) { @@ -758,9 +758,9 @@ void Queue::WriteInterceptor(const void* packets, uint64_t pkt_count, uint64_t u if (session_data_count > 0 && is_counter_collection_mode && context_backup) { hsa_signal_t dummy_signal{}; - context_backup->read_packet->header = HSA_PACKET_TYPE_VENDOR_SPECIFIC << HSA_PACKET_HEADER_TYPE; + context_backup->read_packet->header = (HSA_PACKET_TYPE_VENDOR_SPECIFIC << HSA_PACKET_HEADER_TYPE) | (1 << HSA_PACKET_HEADER_BARRIER); Packet::AddVendorSpecificPacket(context_backup->read_packet, &transformed_packets, dummy_signal); - context_backup->stop_packet->header = HSA_PACKET_TYPE_VENDOR_SPECIFIC << HSA_PACKET_HEADER_TYPE; + context_backup->stop_packet->header = (HSA_PACKET_TYPE_VENDOR_SPECIFIC << HSA_PACKET_HEADER_TYPE) | (1 << HSA_PACKET_HEADER_BARRIER); Packet::AddVendorSpecificPacket(context_backup->stop_packet, &transformed_packets, interrupt_signal); // Added Interrupt Signal with barrier and provided handler for it