mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Kernel: Put page fault logspam behind PAGE_FAULT_DEBUG.
This commit is contained in:
parent
5e8d6b1bf4
commit
9860e55047
Notes:
sideshowbarker
2024-07-19 15:48:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9860e550478
2 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue