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
+4 -4
View File
@@ -121,7 +121,7 @@ roctx_api_impl<TableIdx, OpIdx>::exec(FuncT&& _func, Args&&... args)
}
using info_type = roctx_api_info<TableIdx, OpIdx>;
LOG(ERROR) << "nullptr to next roctx function for " << info_type::name << " ("
ROCP_ERROR << "nullptr to next roctx function for " << info_type::name << " ("
<< info_type::operation_idx << ")";
if constexpr(std::is_void<return_type>::value)
@@ -484,12 +484,12 @@ copy_table(Tp* _orig, uint64_t _tbl_instance, std::integral_constant<size_t, OpI
if(!_copy_func)
{
LOG(INFO) << "copying table entry for " << _info.name;
ROCP_INFO << "copying table entry for " << _info.name;
_copy_func = _orig_func;
}
else
{
LOG(INFO) << "skipping copying table entry for " << _info.name
ROCP_INFO << "skipping copying table entry for " << _info.name
<< " from table instance " << _tbl_instance;
}
}
@@ -514,7 +514,7 @@ update_table(Tp* _orig, std::integral_constant<size_t, OpIdx>)
_info.callback_domain_idx, _info.buffered_domain_idx, _info.operation_idx))
return;
LOG(INFO) << "updating table entry for " << _info.name;
ROCP_INFO << "updating table entry for " << _info.name;
// 1. get the sub-table containing the function pointer in original table
// 2. get reference to function pointer in sub-table in original table