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
committed by GitHub
parent 5e4dd502d9
commit 41c0ddd72d
38 changed files with 193 additions and 152 deletions
@@ -219,7 +219,7 @@ add_constants(std::unordered_map<std::string, Metric>& metrics, uint64_t start_i
rocprofiler::agent::get_agents();
for(const auto& prop : rocprofiler::agent::get_agent_available_properties())
{
LOG(ERROR) << prop;
ROCP_ERROR << prop;
metrics[prop] = {"constant",
prop,
"",
@@ -299,7 +299,7 @@ TEST(evaluate_ast, counter_constants)
{
auto eval_counters =
rocprofiler::counters::get_required_hardware_counters(asts, "gfx9", metrics[name]);
LOG(INFO) << name;
ROCP_INFO << name;
ASSERT_TRUE(eval_counters);
EXPECT_EQ(eval_counters->size(), expected.size());
for(const auto& c : *eval_counters)
@@ -505,7 +505,7 @@ TEST(evaluate_ast, evaluate_simple_counters)
for(auto& [name, expected, eval_count] : derived_counters)
{
LOG(INFO) << name;
ROCP_INFO << name;
auto eval_counters =
rocprofiler::counters::get_required_hardware_counters(asts, "gfx9", metrics[name]);
ASSERT_TRUE(eval_counters);
@@ -558,7 +558,7 @@ run_reduce_test(
for(auto& [name, expected, eval_count] : derived_counters)
{
LOG(INFO) << name;
ROCP_INFO << name;
auto eval_counters =
rocprofiler::counters::get_required_hardware_counters(asts, "gfx9", metrics[name]);
ASSERT_TRUE(eval_counters);
@@ -1001,7 +1001,7 @@ TEST(evaluate_ast, evaluate_mixed_counters)
for(auto& [name, expected, eval_count] : derived_counters)
{
LOG(INFO) << name;
ROCP_INFO << name;
auto eval_counters =
rocprofiler::counters::get_required_hardware_counters(asts, "gfx9", metrics[name]);
ASSERT_TRUE(eval_counters);