From 581bf2cd874f263a91123397b45dd8a7ed2a4986 Mon Sep 17 00:00:00 2001 From: vlaindic Date: Thu, 24 Aug 2023 12:49:12 +0200 Subject: [PATCH] SWDEV-418738: Listing counters of all GPU agents Using `gfxip` when listing counters on the system with multi-GPUs all belonging to the same family results in showing counters of the first agent multiple times. Instead, use the agent's `name` to observe counters of all agents. Change-Id: I7b46c0670bc7c918e2ba0357fa659df9d23379d4 [ROCm/rocprofiler commit: 03a63791b04a1b43c159ff590b5a67eabbaaf359] --- projects/rocprofiler/src/core/counters/metrics/metrics.h | 2 +- projects/rocprofiler/src/core/metrics.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocprofiler/src/core/counters/metrics/metrics.h b/projects/rocprofiler/src/core/counters/metrics/metrics.h index 7a06f7efdb..f51171454f 100644 --- a/projects/rocprofiler/src/core/counters/metrics/metrics.h +++ b/projects/rocprofiler/src/core/counters/metrics/metrics.h @@ -126,7 +126,7 @@ class MetricsDict { static MetricsDict* Create(const rocprofiler::HSAAgentInfo* agent_info) { std::lock_guard lck(mutex_); if (map_ == NULL) map_ = new map_t; - std::string name = agent_info->GetDeviceInfo().getGfxip(); + std::string name = std::string(agent_info->GetDeviceInfo().getName()); auto ret = map_->insert({name, NULL}); if (ret.second) ret.first->second = new MetricsDict(agent_info); return ret.first->second; diff --git a/projects/rocprofiler/src/core/metrics.h b/projects/rocprofiler/src/core/metrics.h index 8c36533731..26bdeef807 100644 --- a/projects/rocprofiler/src/core/metrics.h +++ b/projects/rocprofiler/src/core/metrics.h @@ -120,7 +120,7 @@ class MetricsDict { static MetricsDict* Create(const util::AgentInfo* agent_info) { std::lock_guard lck(mutex_); if (map_ == NULL) map_ = new map_t; - auto ret = map_->insert({agent_info->gfxip, NULL}); + auto ret = map_->insert({agent_info->name, NULL}); if (ret.second) ret.first->second = new MetricsDict(agent_info); return ret.first->second; }