1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:57:44 +00:00

Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)

Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
This commit is contained in:
AnotherTest 2021-02-07 15:33:24 +03:30 committed by Andreas Kling
parent 1f8a633cc7
commit 09a43969ba
95 changed files with 427 additions and 425 deletions

View file

@ -33,7 +33,7 @@ namespace Kernel {
int Process::sys$fcntl(int fd, int cmd, u32 arg)
{
REQUIRE_PROMISE(stdio);
dbgln<IO_DEBUG>("sys$fcntl: fd={}, cmd={}, arg={}", fd, cmd, arg);
dbgln_if(IO_DEBUG, "sys$fcntl: fd={}, cmd={}, arg={}", fd, cmd, arg);
auto description = file_description(fd);
if (!description)
return -EBADF;

View file

@ -53,7 +53,7 @@ pid_t Process::sys$fork(RegisterState& regs)
child->m_pg = m_pg;
child->m_umask = m_umask;
dbgln<FORK_DEBUG>("fork: child={}", child);
dbgln_if(FORK_DEBUG, "fork: child={}", child);
child->m_extra_gids = m_extra_gids;
@ -82,7 +82,7 @@ pid_t Process::sys$fork(RegisterState& regs)
{
ScopedSpinLock lock(m_lock);
for (auto& region : m_regions) {
dbgln<FORK_DEBUG>("fork: cloning Region({}) '{}' @ {}", &region, region.name(), region.vaddr());
dbgln_if(FORK_DEBUG, "fork: cloning Region({}) '{}' @ {}", &region, region.name(), region.vaddr());
auto region_clone = region.clone(*child);
if (!region_clone) {
dbgln("fork: Cannot clone region, insufficient memory");

View file

@ -39,7 +39,7 @@ FutexQueue::FutexQueue(FlatPtr user_address_or_offset, VMObject* vmobject)
: m_user_address_or_offset(user_address_or_offset)
, m_is_global(vmobject != nullptr)
{
dbgln<FUTEX_DEBUG>("Futex @ {}{}",
dbgln_if(FUTEX_DEBUG, "Futex @ {}{}",
this,
m_is_global ? " (global)" : " (local)");
@ -56,7 +56,7 @@ FutexQueue::~FutexQueue()
if (auto vmobject = m_vmobject.strong_ref())
vmobject->unregister_on_deleted_handler(*this);
}
dbgln<FUTEX_DEBUG>("~Futex @ {}{}",
dbgln_if(FUTEX_DEBUG, "~Futex @ {}{}",
this,
m_is_global ? " (global)" : " (local)");
}
@ -68,7 +68,7 @@ void FutexQueue::vmobject_deleted(VMObject& vmobject)
// to make sure we have at last a reference until we're done
NonnullRefPtr<FutexQueue> own_ref(*this);
dbgln<FUTEX_DEBUG>("Futex::vmobject_deleted @ {}{}",
dbgln_if(FUTEX_DEBUG, "Futex::vmobject_deleted @ {}{}",
this,
m_is_global ? " (global)" : " (local)");

View file

@ -63,7 +63,7 @@ int Process::sys$open(Userspace<const Syscall::SC_open_params*> user_params)
if (path.is_error())
return path.error();
dbgln<IO_DEBUG>("sys$open(dirfd={}, path='{}', options={}, mode={})", dirfd, path.value(), options, mode);
dbgln_if(IO_DEBUG, "sys$open(dirfd={}, path='{}', options={}, mode={})", dirfd, path.value(), options, mode);
int fd = alloc_fd();
if (fd < 0)
return fd;
@ -99,7 +99,7 @@ int Process::sys$close(int fd)
{
REQUIRE_PROMISE(stdio);
auto description = file_description(fd);
dbgln<IO_DEBUG>("sys$close({}) {}", fd, description.ptr());
dbgln_if(IO_DEBUG, "sys$close({}) {}", fd, description.ptr());
if (!description)
return -EBADF;
int rc = description->close();

View file

@ -37,7 +37,7 @@ ssize_t Process::sys$read(int fd, Userspace<u8*> buffer, ssize_t size)
return -EINVAL;
if (size == 0)
return 0;
dbgln<IO_DEBUG>("sys$read({}, {}, {})", fd, buffer.ptr(), size);
dbgln_if(IO_DEBUG, "sys$read({}, {}, {})", fd, buffer.ptr(), size);
auto description = file_description(fd);
if (!description)
return -EBADF;

View file

@ -99,7 +99,7 @@ int Process::sys$select(const Syscall::SC_select_params* user_params)
dbgln("selecting on {} fds, timeout={}", fds_info.size(), params.timeout);
if (current_thread->block<Thread::SelectBlocker>(timeout, fds_info).was_interrupted()) {
dbgln<POLL_SELECT_DEBUG>("select was interrupted");
dbgln_if(POLL_SELECT_DEBUG, "select was interrupted");
return -EINTR;
}

View file

@ -55,7 +55,7 @@ pid_t Process::sys$waitid(Userspace<const Syscall::SC_waitid_params*> user_param
if (!copy_from_user(&params, user_params))
return -EFAULT;
dbgln<PROCESS_DEBUG>("sys$waitid({}, {}, {}, {})", params.idtype, params.id, params.infop, params.options);
dbgln_if(PROCESS_DEBUG, "sys$waitid({}, {}, {}, {})", params.idtype, params.id, params.infop, params.options);
auto siginfo_or_error = do_waitid(static_cast<idtype_t>(params.idtype), params.id, params.options);
if (siginfo_or_error.is_error())

View file

@ -125,7 +125,7 @@ ssize_t Process::sys$write(int fd, const u8* data, ssize_t size)
if (size == 0)
return 0;
dbgln<IO_DEBUG>("sys$write({}, {}, {})", fd, data, size);
dbgln_if(IO_DEBUG, "sys$write({}, {}, {})", fd, data, size);
auto description = file_description(fd);
if (!description)
return -EBADF;