Kernel: Put page fault logspam behind PAGE_FAULT_DEBUG.

This commit is contained in:
Andreas Kling 2019-02-10 11:37:59 +01:00
parent 5e8d6b1bf4
commit 9860e55047
Notes: sideshowbarker 2024-07-19 15:48:18 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -357,17 +357,23 @@ PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault)
auto page_index_in_region = region->page_index_from_address(fault.laddr());
if (fault.is_not_present()) {
if (region->vmo().inode()) {
#ifdef PAGE_FAULT_DEBUG
dbgprintf("NP(inode) fault in Region{%p}[%u]\n", region, page_index_in_region);
#endif
page_in_from_inode(*region, page_index_in_region);
return PageFaultResponse::Continue;
} else {
#ifdef PAGE_FAULT_DEBUG
dbgprintf("NP(zero) fault in Region{%p}[%u]\n", region, page_index_in_region);
#endif
zero_page(*region, page_index_in_region);
return PageFaultResponse::Continue;
}
} else if (fault.is_protection_violation()) {
if (region->m_cow_map.get(page_index_in_region)) {
#ifdef PAGE_FAULT_DEBUG
dbgprintf("PV(cow) fault in Region{%p}[%u]\n", region, page_index_in_region);
#endif
bool success = copy_on_write(*region, page_index_in_region);
ASSERT(success);
return PageFaultResponse::Continue;

View file

@ -237,6 +237,7 @@ void exception_14_handler(RegisterDumpWithExceptionCode& regs)
dword fault_page_directory;
asm ("movl %%cr3, %%eax":"=a"(fault_page_directory));
#ifdef PAGE_FAULT_DEBUG
dbgprintf("%s(%u): ring%u %s page fault in PD=%x, %s L%x\n",
current->name().characters(),
current->pid(),
@ -245,6 +246,7 @@ void exception_14_handler(RegisterDumpWithExceptionCode& regs)
fault_page_directory,
regs.exception_code & 2 ? "write" : "read",
faultAddress);
#endif
word ss;
dword esp;