Add LOG_PAGE_FAULTS

This commit is contained in:
copy 2017-06-17 12:59:56 -05:00
parent 49b6fecdba
commit 8bdbe0cac9
2 changed files with 13 additions and 4 deletions

View file

@ -18,6 +18,12 @@ var LOG_TO_FILE = false;
*/
var LOG_ALL_IO = false;
/**
* @const
* Enables logging of page faults, quite verbose
*/
var LOG_PAGE_FAULTS = false;
var LOG_LEVEL = LOG_ALL & ~LOG_PS2 & ~LOG_PIT & ~LOG_VIRTIO & ~LOG_9P & ~LOG_PIC &
~LOG_DMA & ~LOG_SERIAL & ~LOG_NET & ~LOG_FLOPPY & ~LOG_DISK;

View file

@ -4484,10 +4484,13 @@ CPU.prototype.writable_or_pagefault = function(addr, size)
CPU.prototype.trigger_pagefault = function(write, user, present)
{
//dbg_log("page fault w=" + write + " u=" + user + " p=" + present +
// " eip=" + h(this.previous_ip >>> 0, 8) +
// " cr2=" + h(this.cr[2] >>> 0, 8), LOG_CPU);
//dbg_trace(LOG_CPU);
if(LOG_PAGE_FAULTS)
{
dbg_log("page fault w=" + write + " u=" + user + " p=" + present +
" eip=" + h(this.previous_ip >>> 0, 8) +
" cr2=" + h(this.cr[2] >>> 0, 8), LOG_CPU);
dbg_trace(LOG_CPU);
}
if(this.page_fault)
{