Skip to content

Commit

Permalink
ProcFS: Use dbg() instead of dbgprintf()
Browse files Browse the repository at this point in the history
  • Loading branch information
supercomputer7 authored and awesomekling committed Feb 27, 2020
1 parent 03592a8 commit 67994cd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Kernel/FileSystem/ProcFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ enum ProcFileType {
static inline pid_t to_pid(const InodeIdentifier& identifier)
{
#ifdef PROCFS_DEBUG
dbgprintf("to_pid, index=%08x -> %u\n", identifier.index(), identifier.index() >> 16);
dbg() << "to_pid, index=" << String::format("%08x", identifier.index()) << " -> " << (identifier.index() >> 16);
#endif
return identifier.index() >> 16u;
}
Expand Down Expand Up @@ -1092,7 +1092,7 @@ InodeIdentifier ProcFS::root_inode() const
RefPtr<Inode> ProcFS::get_inode(InodeIdentifier inode_id) const
{
#ifdef PROCFS_DEBUG
dbgprintf("ProcFS::get_inode(%u)\n", inode_id.index());
dbg() << "ProcFS::get_inode(" << inode_id.index() << ")";
#endif
if (inode_id == root_inode())
return m_root_inode;
Expand Down Expand Up @@ -1121,7 +1121,7 @@ ProcFSInode::~ProcFSInode()
InodeMetadata ProcFSInode::metadata() const
{
#ifdef PROCFS_DEBUG
dbgprintf("ProcFSInode::metadata(%u)\n", index());
dbg() << "ProcFSInode::metadata(" << index() << ")";
#endif
InodeMetadata metadata;
metadata.inode = identifier();
Expand All @@ -1133,7 +1133,7 @@ InodeMetadata ProcFSInode::metadata() const
auto proc_file_type = to_proc_file_type(identifier());

#ifdef PROCFS_DEBUG
dbgprintf(" -> pid: %d, fi: %u, pdi: %u\n", pid, proc_file_type, proc_parent_directory);
dbg() << " -> pid: " << pid << ", fi: " << proc_file_type << ", pdi: " << proc_parent_directory;
#endif

if (is_process_related_file(identifier())) {
Expand Down Expand Up @@ -1179,15 +1179,15 @@ InodeMetadata ProcFSInode::metadata() const
}

#ifdef PROCFS_DEBUG
dbgprintf("Returning mode %o\n", metadata.mode);
dbg() << "Returning mode " << String::format("%o", metadata.mode);
#endif
return metadata;
}

ssize_t ProcFSInode::read_bytes(off_t offset, ssize_t count, u8* buffer, FileDescription* description) const
{
#ifdef PROCFS_DEBUG
dbgprintf("ProcFS: read_bytes %u\n", index());
dbg() << "ProcFS: read_bytes " << index();
#endif
ASSERT(offset >= 0);
ASSERT(buffer);
Expand Down Expand Up @@ -1255,7 +1255,7 @@ InodeIdentifier ProcFS::ProcFSDirectoryEntry::identifier(unsigned fsid) const
bool ProcFSInode::traverse_as_directory(Function<bool(const FS::DirectoryEntry&)> callback) const
{
#ifdef PROCFS_DEBUG
dbgprintf("ProcFS: traverse_as_directory %u\n", index());
dbg() << "ProcFS: traverse_as_directory " << index();
#endif

if (!Kernel::is_directory(identifier()))
Expand Down

0 comments on commit 67994cd

Please sign in to comment.