mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
SPU debugger: Implement blocking functions dumping
This commit is contained in:
parent
2e397e38a4
commit
ec1e82bc9d
@ -999,6 +999,8 @@ std::string spu_thread::dump_regs() const
|
|||||||
|
|
||||||
fmt::append(ret, "\nEvent Stat: 0x%x\n", +ch_event_stat);
|
fmt::append(ret, "\nEvent Stat: 0x%x\n", +ch_event_stat);
|
||||||
fmt::append(ret, "Event Mask: 0x%x\n", +ch_event_mask);
|
fmt::append(ret, "Event Mask: 0x%x\n", +ch_event_mask);
|
||||||
|
fmt::append(ret, "Stall Mask: 0x%x\n", ch_stall_mask);
|
||||||
|
fmt::append(ret, "Tag Stat: %s\n", ch_tag_stat);
|
||||||
|
|
||||||
if (const u32 addr = raddr)
|
if (const u32 addr = raddr)
|
||||||
fmt::append(ret, "Reservation Addr: 0x%x\n", addr);
|
fmt::append(ret, "Reservation Addr: 0x%x\n", addr);
|
||||||
@ -1045,10 +1047,31 @@ std::string spu_thread::dump_misc() const
|
|||||||
// Print chunk address from lowest 16 bits
|
// Print chunk address from lowest 16 bits
|
||||||
fmt::append(ret, "...chunk-0x%05x", (name & 0xffff) * 4);
|
fmt::append(ret, "...chunk-0x%05x", (name & 0xffff) * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt::append(ret, "\n[%s]", ch_mfc_cmd);
|
fmt::append(ret, "\n[%s]", ch_mfc_cmd);
|
||||||
fmt::append(ret, "\nLocal Storage: 0x%08x..0x%08x", offset, offset + 0x3ffff);
|
fmt::append(ret, "\nLocal Storage: 0x%08x..0x%08x", offset, offset + 0x3ffff);
|
||||||
|
|
||||||
|
if (const u64 _time = start_time)
|
||||||
|
{
|
||||||
|
if (const auto func = current_func)
|
||||||
|
{
|
||||||
|
ret += "\nCurrent function: ";
|
||||||
|
ret += func;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret += '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fmt::append(ret, "\nWaiting: %fs", (get_system_time() - _time) / 1000000.);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret += "\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
fmt::append(ret, "\nTag Mask: 0x%08x", ch_tag_mask);
|
fmt::append(ret, "\nTag Mask: 0x%08x", ch_tag_mask);
|
||||||
fmt::append(ret, "\nMFC Stall: 0x%08x", ch_stall_mask);
|
|
||||||
fmt::append(ret, "\nMFC Queue Size: %u", mfc_size);
|
fmt::append(ret, "\nMFC Queue Size: %u", mfc_size);
|
||||||
|
|
||||||
for (u32 i = 0; i < 16; i++)
|
for (u32 i = 0; i < 16; i++)
|
||||||
@ -2482,6 +2505,8 @@ s64 spu_thread::get_ch_value(u32 ch)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spu_function_logger logger(*this, "MFC Events read");
|
||||||
|
|
||||||
const u32 mask1 = ch_event_mask;
|
const u32 mask1 = ch_event_mask;
|
||||||
|
|
||||||
if (mask1 & SPU_EVENT_LR && raddr)
|
if (mask1 & SPU_EVENT_LR && raddr)
|
||||||
@ -2968,6 +2993,8 @@ bool spu_thread::stop_and_signal(u32 code)
|
|||||||
|
|
||||||
state += cpu_flag::wait;
|
state += cpu_flag::wait;
|
||||||
|
|
||||||
|
spu_function_logger logger(*this, "sys_spu_thread_receive_event");
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
queue.reset();
|
queue.reset();
|
||||||
@ -3265,6 +3292,13 @@ void spu_thread::fast_call(u32 ls_addr)
|
|||||||
gpr[1]._u32[3] = old_stack;
|
gpr[1]._u32[3] = old_stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spu_function_logger::spu_function_logger(spu_thread& spu, const char* func)
|
||||||
|
: spu(spu)
|
||||||
|
{
|
||||||
|
spu.current_func = func;
|
||||||
|
spu.start_time = get_system_time();
|
||||||
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void fmt_class_string<spu_channel>::format(std::string& out, u64 arg)
|
void fmt_class_string<spu_channel>::format(std::string& out, u64 arg)
|
||||||
{
|
{
|
||||||
|
@ -619,6 +619,9 @@ public:
|
|||||||
|
|
||||||
std::array<v128, 0x4000> stack_mirror; // Return address information
|
std::array<v128, 0x4000> stack_mirror; // Return address information
|
||||||
|
|
||||||
|
const char* current_func{}; // Current STOP or RDCH blocking function
|
||||||
|
u64 start_time{}; // Starting time of STOP or RDCH bloking function
|
||||||
|
|
||||||
void push_snr(u32 number, u32 value);
|
void push_snr(u32 number, u32 value);
|
||||||
void do_dma_transfer(const spu_mfc_cmd& args);
|
void do_dma_transfer(const spu_mfc_cmd& args);
|
||||||
bool do_dma_check(const spu_mfc_cmd& args);
|
bool do_dma_check(const spu_mfc_cmd& args);
|
||||||
@ -669,3 +672,16 @@ public:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class spu_function_logger
|
||||||
|
{
|
||||||
|
spu_thread& spu;
|
||||||
|
|
||||||
|
public:
|
||||||
|
spu_function_logger(spu_thread& spu, const char* func);
|
||||||
|
|
||||||
|
~spu_function_logger()
|
||||||
|
{
|
||||||
|
spu.start_time = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user