Convert LOG() -> ROCP_X logging macros. (#695)

* Convert LOG() -> ROCP_X logging macros.

This patch converts the LOG() macro to the ROCP_X logging macros.
There are the following levels of logs.

Logs whos expressions are not evaluated unless the log level is enabled:

ROCP_TRACE - VLOG(2) (enabeled by env variable GLOG_v=2)
ROCP_INFO - VLOG(1) (enabeled by env variable GLOG_v=1)

Logs whos expressions are always evaluated:

ROCP_WARNING - LOG(WARNING)
ROCP_ERROR - LOG(ERROR)
ROCP_FATAL - LOG(FATAL)
ROCP_DFATAL - DLOG(FATAL) (only fatal in debug mode)

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

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

* Minor fix

* Fixes for VLOG before main

* fix vmodule

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

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

* memory leak fix

* Vlog change

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>
This commit is contained in:
Benjamin Welton
2024-04-02 17:15:30 -07:00
gecommit door GitHub
bovenliggende 5e4dd502d9
commit 41c0ddd72d
38 gewijzigde bestanden met toevoegingen van 193 en 152 verwijderingen
@@ -173,7 +173,7 @@ counter_callback_info::setup_profile_config(const hsa::AgentCache& age
if(!req_counters)
{
LOG(ERROR) << fmt::format("Could not find counter {}", metric.name());
ROCP_ERROR << fmt::format("Could not find counter {}", metric.name());
return ROCPROFILER_STATUS_ERROR_PROFILE_COUNTER_NOT_FOUND;
}
@@ -195,14 +195,14 @@ counter_callback_info::setup_profile_config(const hsa::AgentCache& age
const auto* agent_map = rocprofiler::common::get_val(asts, agent_name);
if(!agent_map)
{
LOG(ERROR) << fmt::format("Coult not build AST for {}", agent_name);
ROCP_ERROR << fmt::format("Coult not build AST for {}", agent_name);
return ROCPROFILER_STATUS_ERROR_AST_GENERATION_FAILED;
}
const auto* counter_ast = rocprofiler::common::get_val(*agent_map, metric.name());
if(!counter_ast)
{
LOG(ERROR) << fmt::format("Coult not find AST for {}", metric.name());
ROCP_ERROR << fmt::format("Coult not find AST for {}", metric.name());
return ROCPROFILER_STATUS_ERROR_AST_NOT_FOUND;
}
config.asts.push_back(*counter_ast);
@@ -212,7 +212,7 @@ counter_callback_info::setup_profile_config(const hsa::AgentCache& age
config.asts.back().set_dimensions();
} catch(std::runtime_error& e)
{
LOG(ERROR) << metric.name() << " has improper dimensions"
ROCP_ERROR << metric.name() << " has improper dimensions"
<< " " << e.what();
return ROCPROFILER_STATUS_ERROR_AST_NOT_FOUND;
}