SWDEV-476512: Further rocsys fixes
Change-Id: I9ae8534a2b6b23f76514920a6c4d39025bc882bc
[ROCm/rocprofiler commit: c4adefccde]
This commit is contained in:
1 parent
9915421ec0
commit
6defbd0f2e
6 files changed
+98
-72
No files matched your search
@@ -538,10 +538,7 @@ void Queue::ResetSessionID(rocprofiler_session_id_t id)
|
||||
{
|
||||
std::unique_lock<std::shared_mutex> session_id_lock(session_id_mutex);
|
||||
session_id = id;
|
||||
if (session_id.handle != 0)
|
||||
session = rocprofiler::ROCProfiler_Singleton::GetInstance().GetSession(session_id);
|
||||
else
|
||||
session = nullptr;
|
||||
session = nullptr;
|
||||
}
|
||||
|
||||
bool Queue::CheckNeededProfileConfigs()
|
||||
@@ -618,7 +615,8 @@ void Queue::WriteInterceptor(const void* packets, uint64_t pkt_count, uint64_t u
|
||||
|
||||
std::shared_lock<std::shared_mutex> session_id_lock(session_id_mutex);
|
||||
|
||||
if (session_id.handle == 0 || session_id.handle != rocprofiler::ROCProfiler_Singleton::GetInstance().GetCurrentSessionId().handle)
|
||||
if (session == nullptr || session_id.handle == 0 ||
|
||||
session_id.handle != rocprofiler::ROCProfiler_Singleton::GetInstance().GetCurrentSessionId().handle)
|
||||
{
|
||||
session_id_lock.unlock();
|
||||
CheckNeededProfileConfigs();
|
||||
|
||||
@@ -57,7 +57,7 @@ void AttTracer::AddPendingSignals(
|
||||
kernel_object,
|
||||
original_completion_signal,
|
||||
new_completion_signal,
|
||||
session_id_,
|
||||
session_id,
|
||||
buffer_id,
|
||||
profile,
|
||||
kernel_properties,
|
||||
|
||||
@@ -125,8 +125,6 @@ void Profiler::AddPendingSignals(
|
||||
uint64_t correlation_id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(sessions_pending_signals_lock_);
|
||||
if (bIsSessionDestroying.load())
|
||||
return;
|
||||
|
||||
if (sessions_pending_signals_.find(writer_id) == sessions_pending_signals_.end())
|
||||
sessions_pending_signals_.emplace(writer_id, std::vector<pending_signal_ptr_t>{});
|
||||
@@ -134,7 +132,7 @@ void Profiler::AddPendingSignals(
|
||||
sessions_pending_signals_.at(writer_id).emplace_back(
|
||||
new pending_signal_t{
|
||||
kernel_object, original_completion_signal, new_completion_signal,
|
||||
session_id_, buffer_id, session_data_count, std::move(profile),
|
||||
session_id, buffer_id, session_data_count, std::move(profile),
|
||||
kernel_properties, thread_id, queue_index, correlation_id
|
||||
}
|
||||
);
|
||||
@@ -143,12 +141,10 @@ void Profiler::AddPendingSignals(
|
||||
std::vector<pending_signal_ptr_t> Profiler::MovePendingSignals(uint32_t writer_id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(sessions_pending_signals_lock_);
|
||||
|
||||
auto it = sessions_pending_signals_.find(writer_id);
|
||||
if (it == sessions_pending_signals_.end())
|
||||
{
|
||||
rocprofiler::warning("writer_id is not found in the pending_signals");
|
||||
return {};
|
||||
}
|
||||
|
||||
auto move_pending = std::move(it->second);
|
||||
sessions_pending_signals_.erase(writer_id);
|
||||
@@ -160,8 +156,8 @@ std::vector<pending_signal_ptr_t> Profiler::MovePendingSignals(uint32_t writer_i
|
||||
|
||||
void Profiler::WaitForPendingAndDestroy()
|
||||
{
|
||||
bIsSessionDestroying.store(true);
|
||||
std::unique_lock<std::mutex> lk(sessions_pending_signals_lock_);
|
||||
bIsSessionDestroying.store(true);
|
||||
if (sessions_pending_signals_.size() == 0)
|
||||
return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user