diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-10 13:02:38 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-10 13:02:38 +0100 |
commit | ae4811fbae3f9c5c0ec50ff7c8a2f92f74f363f7 (patch) | |
tree | f6a59de6231dc2157d59f359204539265a184475 | |
parent | 6103e374cc57bac0f9bb827259f4c16dce76e2e9 (diff) | |
download | serenity-ae4811fbae3f9c5c0ec50ff7c8a2f92f74f363f7.zip |
ProcFS: Show region flags in /proc/PID/vm
It's useful to be able to see the readable, writable and bitmap flags.
-rw-r--r-- | Kernel/ProcFS.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Kernel/ProcFS.cpp b/Kernel/ProcFS.cpp index 7520ce14d5..9f24279e0f 100644 --- a/Kernel/ProcFS.cpp +++ b/Kernel/ProcFS.cpp @@ -211,13 +211,21 @@ ByteBuffer procfs$pid_vm(InodeIdentifier identifier) return { }; auto& process = handle->process(); StringBuilder builder; - builder.appendf("BEGIN END SIZE COMMIT NAME\n"); + builder.appendf("BEGIN END SIZE COMMIT FLAGS NAME\n"); for (auto& region : process.regions()) { - builder.appendf("%x -- %x %x %x %s\n", + StringBuilder flags_builder; + if (region->is_readable()) + flags_builder.append('R'); + if (region->is_writable()) + flags_builder.append('W'); + if (region->is_bitmap()) + flags_builder.append('B'); + builder.appendf("%x -- %x %x %x % 4s %s\n", region->laddr().get(), region->laddr().offset(region->size() - 1).get(), region->size(), region->amount_resident(), + flags_builder.to_string().characters(), region->name().characters()); } return builder.to_byte_buffer(); |