Make dimension error message print the counter name (#658)

* temp

* source formatting (clang-format v11) (#659)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>
Этот коммит содержится в:
Benjamin Welton
2024-03-26 15:19:04 -07:00
коммит произвёл GitHub
родитель f633278720
Коммит f0924c6aa7
2 изменённых файлов: 20 добавлений и 3 удалений
+10 -1
Просмотреть файл
@@ -206,7 +206,16 @@ counter_callback_info::setup_profile_config(const hsa::AgentCache& age
return ROCPROFILER_STATUS_ERROR_AST_NOT_FOUND;
}
config.asts.push_back(*counter_ast);
config.asts.back().set_dimensions();
try
{
config.asts.back().set_dimensions();
} catch(std::runtime_error& e)
{
LOG(ERROR) << metric.name() << " has improper dimensions"
<< " " << e.what();
return ROCPROFILER_STATUS_ERROR_AST_NOT_FOUND;
}
}
profile->pkt_generator = std::make_unique<rocprofiler::aql::AQLPacketConstruct>(
+10 -2
Просмотреть файл
@@ -117,10 +117,18 @@ get_dimension_cache()
const auto& asts = counters::get_ast_map();
for(const auto& [gfx, metrics] : asts)
{
for(const auto& [_, ast] : metrics)
for(const auto& [metric, ast] : metrics)
{
auto ast_copy = ast;
dims.emplace(ast.out_id().handle, ast_copy.set_dimensions());
try
{
dims.emplace(ast.out_id().handle, ast_copy.set_dimensions());
} catch(std::runtime_error& e)
{
LOG(ERROR) << metric << " has improper dimensions"
<< " " << e.what();
throw;
}
}
}
return dims;