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>

[ROCm/rocprofiler-sdk commit: 41c0ddd72d]
This commit is contained in:
Benjamin Welton
2024-04-02 17:15:30 -07:00
committed by GitHub
parent d7781d0b40
commit 80e32505d5
38 changed files with 193 additions and 152 deletions
@@ -22,6 +22,7 @@
//
#include "lib/common/utility.hpp"
#include "lib/common/logging.hpp"
#include <glog/logging.h>
@@ -77,13 +78,13 @@ get_clock_period_ns_impl(clockid_t _clk_id)
if(ROCPROFILER_UNLIKELY(ret != 0))
{
auto _err = errno;
LOG(FATAL) << "error getting clock resolution for " << get_clock_name(_clk_id) << ": "
ROCP_FATAL << "error getting clock resolution for " << get_clock_name(_clk_id) << ": "
<< strerror(_err);
}
else if(ROCPROFILER_UNLIKELY(ts.tv_sec != 0 ||
ts.tv_nsec >= std::numeric_limits<uint32_t>::max()))
{
LOG(FATAL) << "clock_getres(" << get_clock_name(_clk_id)
ROCP_FATAL << "clock_getres(" << get_clock_name(_clk_id)
<< ") returned very low frequency (<1Hz)";
}