1
Fork 0
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:
Andreas Kling 2019-11-29 21:18:37 +01:00
parent 5ca88bf9b4
commit 3ad0e6e198

View file

@ -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();