mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 08:04:23 -04:00
kern: add kernel object debug
This commit is contained in:
parent
0acd79c8c2
commit
1a6e003a5d
16 changed files with 341 additions and 15 deletions
|
@ -132,4 +132,29 @@ namespace ams::kern {
|
|||
return util::AlignUp(overhead_size, PageSize);
|
||||
}
|
||||
|
||||
void KPageHeap::DumpFreeList() const {
|
||||
MESOSPHERE_RELEASE_LOG("KPageHeap::DumpFreeList %p\n", this);
|
||||
|
||||
for (size_t i = 0; i < this->num_blocks; ++i) {
|
||||
const size_t block_size = this->blocks[i].GetSize();
|
||||
const char *suffix;
|
||||
size_t size;
|
||||
if (block_size >= 1_GB) {
|
||||
suffix = "GiB";
|
||||
size = block_size / 1_GB;
|
||||
} else if (block_size >= 1_MB) {
|
||||
suffix = "MiB";
|
||||
size = block_size / 1_MB;
|
||||
} else if (block_size >= 1_KB) {
|
||||
suffix = "KiB";
|
||||
size = block_size / 1_KB;
|
||||
} else {
|
||||
suffix = "B";
|
||||
size = block_size;
|
||||
}
|
||||
|
||||
MESOSPHERE_RELEASE_LOG(" %4zu %s block x %zu\n", size, suffix, this->blocks[i].GetNumFreeBlocks());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue