mirror of
https://github.com/RGBCube/serenity
synced 2025-06-30 10:12:07 +00:00
Kernel: Show module memory size in /proc/modules
Note that this only shows the size of the loaded module sections, and does not include any memory allocated *by* the module.
This commit is contained in:
parent
5ca88bf9b4
commit
3ad0e6e198
1 changed files with 5 additions and 0 deletions
|
@ -337,6 +337,11 @@ Optional<KBuffer> procfs$modules(InodeIdentifier)
|
|||
obj.add("name", it.value->name);
|
||||
obj.add("module_init", (u32)it.value->module_init);
|
||||
obj.add("module_fini", (u32)it.value->module_fini);
|
||||
u32 size = 0;
|
||||
for (auto& section : it.value->sections) {
|
||||
size += section.capacity();
|
||||
}
|
||||
obj.add("size", size);
|
||||
}
|
||||
array.finish();
|
||||
return builder.build();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue