SWDEV-382125: Adding a description when counter is not supported on a hardware

Change-Id: Ic835f59029aa1a95d32b80bf79375978e8ea9635
This commit is contained in:
Sriraksha Nagaraj
2023-02-15 20:09:43 +00:00
committed by Ammar ELWazir
parent 33ae878846
commit 1d0703b21e
2 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -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
+7 -2
View File
@@ -1,6 +1,6 @@
#include "eval_metrics.h"
#include "src/utils/helper.h"
#include "src/core/hsa/hsa_common.h"
#include <set>
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<std::mutex> lock(extract_metric_events_lock);