summaryrefslogtreecommitdiff
path: root/Kernel/TTY
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-15 00:18:55 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-22 22:14:30 +0100
commit7b0a1a98d9edc5ae91df9138b695fb2bb3ead4b7 (patch)
tree460a80e34939ad908e27412bd123d733866784a2 /Kernel/TTY
parenta348ab55b038386bd2d0acc0c8de1c8927de12fe (diff)
downloadserenity-7b0a1a98d9edc5ae91df9138b695fb2bb3ead4b7.zip
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
Diffstat (limited to 'Kernel/TTY')
-rw-r--r--Kernel/TTY/MasterPTY.cpp11
-rw-r--r--Kernel/TTY/PTYMultiplexer.cpp11
-rw-r--r--Kernel/TTY/SlavePTY.cpp7
3 files changed, 8 insertions, 21 deletions
diff --git a/Kernel/TTY/MasterPTY.cpp b/Kernel/TTY/MasterPTY.cpp
index 538b471699..79512b40a2 100644
--- a/Kernel/TTY/MasterPTY.cpp
+++ b/Kernel/TTY/MasterPTY.cpp
@@ -27,13 +27,12 @@
#include "MasterPTY.h"
#include "PTYMultiplexer.h"
#include "SlavePTY.h"
+#include <AK/Debug.h>
#include <Kernel/Process.h>
#include <LibC/errno_numbers.h>
#include <LibC/signal_numbers.h>
#include <LibC/sys/ioctl_numbers.h>
-//#define MASTERPTY_DEBUG
-
namespace Kernel {
MasterPTY::MasterPTY(unsigned index)
@@ -54,9 +53,7 @@ MasterPTY::MasterPTY(unsigned index)
MasterPTY::~MasterPTY()
{
-#ifdef MASTERPTY_DEBUG
- dbg() << "~MasterPTY(" << m_index << ")";
-#endif
+ dbgln<debug_masterpty>("~MasterPTY({})", m_index);
PTYMultiplexer::the().notify_master_destroyed({}, m_index);
}
@@ -94,9 +91,7 @@ bool MasterPTY::can_write(const FileDescription&, size_t) const
void MasterPTY::notify_slave_closed(Badge<SlavePTY>)
{
-#ifdef MASTERPTY_DEBUG
- dbg() << "MasterPTY(" << m_index << "): slave closed, my retains: " << ref_count() << ", slave retains: " << m_slave->ref_count();
-#endif
+ dbgln<debug_masterpty>("MasterPTY({}): slave closed, my retains: {}, slave retains: {}", m_index, ref_count(), m_slave->ref_count());
// +1 ref for my MasterPTY::m_slave
// +1 ref for FileDescription::m_device
if (m_slave->ref_count() == 2)
diff --git a/Kernel/TTY/PTYMultiplexer.cpp b/Kernel/TTY/PTYMultiplexer.cpp
index 3ccf768b6d..65e0e6339c 100644
--- a/Kernel/TTY/PTYMultiplexer.cpp
+++ b/Kernel/TTY/PTYMultiplexer.cpp
@@ -26,13 +26,12 @@
#include "PTYMultiplexer.h"
#include "MasterPTY.h"
+#include <AK/Debug.h>
#include <AK/Singleton.h>
#include <Kernel/FileSystem/FileDescription.h>
#include <Kernel/Process.h>
#include <LibC/errno_numbers.h>
-//#define PTMX_DEBUG
-
namespace Kernel {
static const unsigned s_max_pty_pairs = 8;
@@ -62,9 +61,7 @@ KResultOr<NonnullRefPtr<FileDescription>> PTYMultiplexer::open(int options)
return EBUSY;
auto master_index = m_freelist.take_last();
auto master = adopt(*new MasterPTY(master_index));
-#ifdef PTMX_DEBUG
- dbg() << "PTYMultiplexer::open: Vending master " << master->index();
-#endif
+ dbgln<debug_ptmx>("PTYMultiplexer::open: Vending master {}", master->index());
auto description = FileDescription::create(move(master));
if (!description.is_error()) {
description.value()->set_rw_mode(options);
@@ -77,9 +74,7 @@ void PTYMultiplexer::notify_master_destroyed(Badge<MasterPTY>, unsigned index)
{
LOCKER(m_lock);
m_freelist.append(index);
-#ifdef PTMX_DEBUG
- dbg() << "PTYMultiplexer: " << index << " added to freelist";
-#endif
+ dbgln<debug_ptmx>("PTYMultiplexer: {} added to freelist", index);
}
}
diff --git a/Kernel/TTY/SlavePTY.cpp b/Kernel/TTY/SlavePTY.cpp
index 8d74137d69..a4704616dd 100644
--- a/Kernel/TTY/SlavePTY.cpp
+++ b/Kernel/TTY/SlavePTY.cpp
@@ -26,11 +26,10 @@
#include "SlavePTY.h"
#include "MasterPTY.h"
+#include <AK/Debug.h>
#include <Kernel/FileSystem/DevPtsFS.h>
#include <Kernel/Process.h>
-//#define SLAVEPTY_DEBUG
-
namespace Kernel {
SlavePTY::SlavePTY(MasterPTY& master, unsigned index)
@@ -48,9 +47,7 @@ SlavePTY::SlavePTY(MasterPTY& master, unsigned index)
SlavePTY::~SlavePTY()
{
-#ifdef SLAVEPTY_DEBUG
- dbg() << "~SlavePTY(" << m_index << ")";
-#endif
+ dbgln<debug_slavepty>("~SlavePTY({})", m_index);
DevPtsFS::unregister_slave_pty(*this);
}