mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Add debugging info for when sys_tty_write is executed
This commit is contained in:
parent
c7f5475b56
commit
677d5f09ce
@ -95,16 +95,16 @@ error_code console_getc()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void console_putc(char ch)
|
||||
void console_putc(ppu_thread& ppu, char ch)
|
||||
{
|
||||
sysPrxForUser.trace("console_putc(ch=0x%x)", ch);
|
||||
sys_tty_write(0, vm::var<char>(ch), 1, vm::var<u32>{});
|
||||
sys_tty_write(ppu, 0, vm::var<char>(ch), 1, vm::var<u32>{});
|
||||
}
|
||||
|
||||
error_code console_write(vm::ptr<char> data, u32 len)
|
||||
error_code console_write(ppu_thread& ppu, vm::ptr<char> data, u32 len)
|
||||
{
|
||||
sysPrxForUser.trace("console_write(data=*0x%x, len=%d)", data, len);
|
||||
sys_tty_write(0, data, len, vm::var<u32>{});
|
||||
sys_tty_write(ppu, 0, data, len, vm::var<u32>{});
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,7 @@ error_code _sys_printf(ppu_thread& ppu, vm::cptr<char> fmt, ppu_va_args_t va_arg
|
||||
|
||||
const auto buf = vm::make_str(ps3_fmt(ppu, fmt, va_args.count));
|
||||
|
||||
sys_tty_write(0, buf, buf.get_count() - 1, vm::var<u32>{});
|
||||
sys_tty_write(ppu, 0, buf, buf.get_count() - 1, vm::var<u32>{});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/system_config.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/Cell/timers.hpp"
|
||||
|
||||
#include "sys_tty.h"
|
||||
|
||||
@ -86,7 +88,7 @@ error_code sys_tty_read(s32 ch, vm::ptr<char> buf, u32 len, vm::ptr<u32> preadle
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_tty_write(s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen)
|
||||
error_code sys_tty_write(ppu_thread& ppu, s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen)
|
||||
{
|
||||
sys_tty.notice("sys_tty_write(ch=%d, buf=*0x%x, len=%d, pwritelen=*0x%x)", ch, buf, len, pwritelen);
|
||||
|
||||
@ -102,6 +104,19 @@ error_code sys_tty_write(s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwrit
|
||||
}
|
||||
}
|
||||
|
||||
if (msg.find("abort"sv) != umax || msg.find("error"sv) != umax || [&]()
|
||||
{
|
||||
static atomic_t<u64> last_write = 0;
|
||||
|
||||
// Dump thread about every period which TTY was not being touched for about half a second
|
||||
const u64 current = get_system_time();
|
||||
return current - last_write.exchange(current) >= 500'000;
|
||||
}())
|
||||
{
|
||||
std::string dump_useful_thread_info();
|
||||
ppu_log.notice("\n%s", dump_useful_thread_info());
|
||||
}
|
||||
|
||||
// Hack: write to tty even on CEX mode, but disable all error checks
|
||||
if (ch < 0 || ch > 15)
|
||||
{
|
||||
|
@ -25,6 +25,8 @@ enum
|
||||
SYS_TTYP_USER13 = 15,
|
||||
};
|
||||
|
||||
class ppu_thread;
|
||||
|
||||
// SysCalls
|
||||
error_code sys_tty_read(s32 ch, vm::ptr<char> buf, u32 len, vm::ptr<u32> preadlen);
|
||||
error_code sys_tty_write(s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen);
|
||||
error_code sys_tty_write(ppu_thread& ppu, s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen);
|
||||
|
Loading…
Reference in New Issue
Block a user