Improve SPURS debugger (#9090)

This commit is contained in:
Eladash 2020-10-18 11:07:01 +03:00 committed by GitHub
parent 6590366f8e
commit 701f7f39d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View File

@ -820,6 +820,18 @@ struct alignas(128) CellSpurs
return wklH1[wid & 0xf];
}
}
WorkloadInfo& wklInfo(u32 wid)
{
if (wid & 0x10)
{
return wklInfo2[wid & 0xf];
}
else
{
return wklInfo1[wid & 0xf];
}
}
};
CHECK_SIZE_ALIGN(CellSpurs, 0x2000, 128);

View File

@ -560,7 +560,19 @@ void kernel_explorer::Update()
const u8 status = spurs.wklStatus(wid);
const auto has_signal = (signal_mask & (0x80000000u >> wid)) ? "Signalled"sv : "No Signal"sv;
add_leaf(spurs_tree, qstr(fmt::format("Work.%u, class: %s, %s, %s, Status: %#x, Event: %#x, %s, ReadyCnt: %u", wid, +name.nameClass, +name.nameInstance, state, status, evt, has_signal, ready_count)));
QTreeWidgetItem* wkl_tree = add_solid_node(m_tree, spurs_tree, qstr(fmt::format("Work.%u", wid)), qstr(fmt::format("Work.%u, class: %s, %s, %s, Status: %#x, Event: %#x, %s, ReadyCnt: %u", wid, +name.nameClass, +name.nameInstance, state, status, evt, has_signal, ready_count)));
auto contention = [&](u8 v)
{
if (wid >= CELL_SPURS_MAX_WORKLOAD)
return (v >> 4);
else
return v & 0xf;
};
const auto& winfo = spurs.wklInfo(wid);
add_leaf(wkl_tree, qstr(fmt::format("Contention: %u/%u (pending: %u), Image: *0x%x (size: 0x%x), Priority (BE64): %016x", contention(spurs.wklCurrentContention[wid % 16])
, contention(spurs.wklMaxContention[wid % 16]), contention(spurs.wklPendingContention[wid % 16]), +winfo.addr, winfo.size, std::bit_cast<be_t<u64>>(winfo.priority))));
}
add_leaf(spurs_tree, qstr(fmt::format("Handler Info: PPU0: 0x%x, PPU1: 0x%x, DirtyState: %u, Waiting: %u, Exiting: %u", spurs.ppu0, spurs.ppu1