Skip to content

Commit

Permalink
Decrease log levels of info entries to verbose.
Browse files Browse the repository at this point in the history
  • Loading branch information
Keita Iwabuchi committed Sep 10, 2024
1 parent fc5d7e8 commit a20fd64
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions include/metall/detail/mmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ inline bool uncommit_private_anonymous_pages(void *const addr,
const size_t length) {
#ifdef MADV_FREE
if (!os_madvise(addr, length, MADV_FREE)) {
logger::perror(logger::level::info, __FILE__, __LINE__,
logger::perror(logger::level::verbose, __FILE__, __LINE__,
"madvise MADV_FREE");
return false;
}
Expand All @@ -298,7 +298,7 @@ inline bool uncommit_private_anonymous_pages(void *const addr,
#warning "MADV_FREE is not defined. Metall uses MADV_DONTNEED instead."
#endif
if (!os_madvise(addr, length, MADV_DONTNEED)) {
logger::perror(logger::level::info, __FILE__, __LINE__,
logger::perror(logger::level::verbose, __FILE__, __LINE__,
"madvise MADV_DONTNEED");
return false;
}
Expand All @@ -309,7 +309,7 @@ inline bool uncommit_private_anonymous_pages(void *const addr,
inline bool uncommit_private_nonanonymous_pages(void *const addr,
const size_t length) {
if (!os_madvise(addr, length, MADV_DONTNEED)) {
logger::perror(logger::level::info, __FILE__, __LINE__,
logger::perror(logger::level::verbose, __FILE__, __LINE__,
"madvise MADV_DONTNEED");
return false;
}
Expand All @@ -319,7 +319,7 @@ inline bool uncommit_private_nonanonymous_pages(void *const addr,

inline bool uncommit_shared_pages(void *const addr, const size_t length) {
if (!os_madvise(addr, length, MADV_DONTNEED)) {
logger::perror(logger::level::info, __FILE__, __LINE__,
logger::perror(logger::level::verbose, __FILE__, __LINE__,
"madvise MADV_DONTNEED");
return false;
}
Expand All @@ -330,7 +330,7 @@ inline bool uncommit_shared_pages_and_free_file_space(
[[maybe_unused]] void *const addr, [[maybe_unused]] const size_t length) {
#ifdef MADV_REMOVE
if (!os_madvise(addr, length, MADV_REMOVE)) {
logger::perror(logger::level::info, __FILE__, __LINE__,
logger::perror(logger::level::verbose, __FILE__, __LINE__,
"madvise MADV_REMOVE");
return uncommit_shared_pages(addr, length);
}
Expand Down
26 changes: 13 additions & 13 deletions include/metall/kernel/segment_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class segment_storage {

segment_storage() {
#ifdef METALL_USE_ANONYMOUS_NEW_MAP
logger::out(logger::level::info, __FILE__, __LINE__,
logger::out(logger::level::verbose, __FILE__, __LINE__,
"METALL_USE_ANONYMOUS_NEW_MAP is defined");
#endif

Expand Down Expand Up @@ -296,12 +296,12 @@ class segment_storage {

if (clone) {
std::string s("Clone: " + source_path.string());
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
return mdtl::clone_files_in_directory_in_parallel(
source_path, destination_path, max_num_threads);
} else {
std::string s("Copy: " + source_path.string());
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
return mdtl::copy_files_in_directory_in_parallel(
source_path, destination_path, max_num_threads);
}
Expand Down Expand Up @@ -386,7 +386,7 @@ class segment_storage {

{
std::string s("Create a segment under: " + top_path.string());
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
}

if (!mdtl::directory_exist(top_path)) {
Expand Down Expand Up @@ -439,7 +439,7 @@ class segment_storage {

{
std::string s("Open a segment under: " + top_path.string());
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
}

const auto header_size =
Expand Down Expand Up @@ -550,7 +550,7 @@ class segment_storage {
{
std::string s("Create and extend a file " + file_name.string() +
" with " + std::to_string(file_size) + " bytes");
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
}

if (!mdtl::create_file(file_name)) return false;
Expand Down Expand Up @@ -603,7 +603,7 @@ class segment_storage {
ss << "Map a file " << path << " at " << segment_offset << " with "
<< file_size << " bytes; read-only mode is "
<< std::to_string(read_only);
logger::out(logger::level::info, __FILE__, __LINE__, ss.str().c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, ss.str().c_str());
}

const auto ret =
Expand Down Expand Up @@ -635,7 +635,7 @@ class segment_storage {
std::string s("Map an anonymous region at " +
std::to_string(segment_offset) + " with " +
std::to_string(region_size));
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
}

const auto *addr =
Expand Down Expand Up @@ -709,7 +709,7 @@ class segment_storage {
return false;
}

logger::out(logger::level::info, __FILE__, __LINE__,
logger::out(logger::level::verbose, __FILE__, __LINE__,
"msync() for the application data segment");
if (!priv_parallel_msync(sync)) {
logger::out(logger::level::error, __FILE__, __LINE__,
Expand Down Expand Up @@ -755,7 +755,7 @@ class segment_storage {
{
std::stringstream ss;
ss << "Sync files with " << num_threads << " threads";
logger::out(logger::level::info, __FILE__, __LINE__, ss.str().c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, ss.str().c_str());
}
std::vector<std::unique_ptr<std::thread>> threads(num_threads);
for (auto &th : threads) {
Expand Down Expand Up @@ -812,7 +812,7 @@ class segment_storage {
assert(m_anonymous_map_flag_list[block_no]);
{
std::string s("Sync anonymous map at block " + std::to_string(block_no));
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
}

auto *const addr = static_cast<char *>(m_segment) + block_no * k_block_size;
Expand All @@ -829,7 +829,7 @@ class segment_storage {
{
std::string s("Map block " + std::to_string(block_no) +
" as a non-anonymous map");
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
}
[[maybe_unused]] static constexpr int map_nosync =
#ifdef MAP_NOSYNC
Expand Down Expand Up @@ -912,7 +912,7 @@ class segment_storage {
{
std::string s("File free test result: ");
s += m_free_file_space ? "success" : "failed";
logger::out(logger::level::info, __FILE__, __LINE__, s.c_str());
logger::out(logger::level::verbose, __FILE__, __LINE__, s.c_str());
}

return true;
Expand Down

0 comments on commit a20fd64

Please sign in to comment.