Fixing Reached HW Limits message for counters

Change-Id: I61830307c7a45fd689adddc8f5ddc9411aa138f8
此提交包含在:
Ammar ELWazir
2023-06-22 16:22:57 +00:00
提交者 Ammar Elwazir
父節點 1f9927abf7
當前提交 b6836ad330
共有 2 個檔案被更改,包括 9 行新增7 行删除
+9 -6
查看文件
@@ -100,9 +100,9 @@ bool metrics::ExtractMetricEvents(
// const Metric* metric = metrics_dict->GetMetricByName(metric_names[i]);
const Metric* metric = metrics_dict->Get(metric_names[i]);
if (metric == nullptr) {
Agent::AgentInfo& agentInfo = rocprofiler::hsa_support::GetAgentInfo(gpu_agent.handle);
fatal("input metric'%s' not supported on this hardware: %s ", metric_names[i].c_str(),
agentInfo.getName().data());
Agent::AgentInfo& agentInfo = rocprofiler::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
@@ -119,8 +119,7 @@ bool metrics::ExtractMetricEvents(
}
for (const counter_t* counter : counters_vec) {
if (results_map.find(counter->name) != results_map.end())
continue;
if (results_map.find(counter->name) != results_map.end()) continue;
results_t* result = new results_t(counter->name, {}, xcc_count);
results_map[counter->name] = result;
@@ -143,7 +142,11 @@ bool metrics::ExtractMetricEvents(
}
if (block_status.counter_index >= block_status.max_counters) {
rocprofiler::fatal("Metrics specified have exceeded HW limits!");
std::cerr << "Error: "
<< std::string_view(counter->name)
.substr(0, std::string_view(counter->name).find("_"))
<< " exceeded hardware block counters limit (" << block_status.max_counters
<< ")" << std::endl;
return false;
}
block_status.counter_index += 1;