From 9b5ec5368d6f08d833de166e4f342f97bc3b0f0a Mon Sep 17 00:00:00 2001 From: Sriraksha Nagaraj Date: Wed, 15 Feb 2023 20:09:43 +0000 Subject: [PATCH] SWDEV-382125: Adding a description when counter is not supported on a hardware Change-Id: Ic835f59029aa1a95d32b80bf79375978e8ea9635 [ROCm/rocprofiler commit: 1d0703b21e44a1b0771a662b24a2932b9c7f351d] --- projects/rocprofiler/src/core/context.h | 3 ++- .../src/core/counters/metrics/eval_metrics.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/projects/rocprofiler/src/core/context.h b/projects/rocprofiler/src/core/context.h index 34e3835632..b66b1584a6 100644 --- a/projects/rocprofiler/src/core/context.h +++ b/projects/rocprofiler/src/core/context.h @@ -436,7 +436,8 @@ class Context { if (kind == ROCPROFILER_FEATURE_KIND_METRIC) { // Processing metrics features const Metric* metric = metrics_->Get(name); if (metric == NULL) - EXC_RAISING(HSA_STATUS_ERROR, "input metric '" << name << "' is not found"); + EXC_RAISING(HSA_STATUS_ERROR, "input metric '" << name << "' is not supported on this hardware: " + << agent_info_->name); #if 0 std::cout << " " << name << (metric->GetExpr() ? " = " + metric->GetExpr()->String() : " counter") << std::endl; #endif diff --git a/projects/rocprofiler/src/core/counters/metrics/eval_metrics.cpp b/projects/rocprofiler/src/core/counters/metrics/eval_metrics.cpp index 3ef0353fde..bbe39d61c6 100644 --- a/projects/rocprofiler/src/core/counters/metrics/eval_metrics.cpp +++ b/projects/rocprofiler/src/core/counters/metrics/eval_metrics.cpp @@ -1,6 +1,6 @@ #include "eval_metrics.h" #include "src/utils/helper.h" - +#include "src/core/hsa/hsa_common.h" #include using namespace rocmtools; @@ -92,7 +92,12 @@ bool metrics::ExtractMetricEvents( // TODO: saurabh // const Metric* metric = metrics_dict->GetMetricByName(metric_names[i]); const Metric* metric = metrics_dict->Get(metric_names[i]); - if (metric == nullptr) fatal("input metric'%s' not found", metric_names[i].c_str()); + if (metric == nullptr) { + Agent::AgentInfo& agentInfo = rocmtools::hsa_support::GetAgentInfo(gpu_agent.handle); + fatal("input metric'%s' not supported on this hardware: %s ", metric_names[i].c_str(), + agentInfo.getName().data()); + + } // adding result object for derived metric std::lock_guard lock(extract_metric_events_lock);