diff options
author | Brendan Coles <bcoles@gmail.com> | 2021-01-29 08:33:32 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-29 09:53:50 +0100 |
commit | ef06215e7a8f11961a063e63697370fa941b3544 (patch) | |
tree | c06cb77fe3f66b4d290ced0215a61c84a5cb6a52 /Userland | |
parent | a061bd2ab961d7e5f9cf44e553fa634f71a66394 (diff) | |
download | serenity-ef06215e7a8f11961a063e63697370fa941b3544.zip |
pmap: Add shared flag to access column and align-right numeric columns
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Utilities/pmap.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Userland/Utilities/pmap.cpp b/Userland/Utilities/pmap.cpp index d25edcb294..6f948b64b0 100644 --- a/Userland/Utilities/pmap.cpp +++ b/Userland/Utilities/pmap.cpp @@ -63,9 +63,9 @@ int main(int argc, char** argv) printf("%s:\n", pid); if (extended) { - printf("Address Size Resident Dirty Access VMObject Type Purgeable CoW Pages Name\n"); + printf("Address Size Resident Dirty Access VMObject Type Purgeable CoW Pages Name\n"); } else { - printf("Address Size Access Name\n"); + printf("Address Size Access Name\n"); } auto file_contents = file->read_all(); @@ -82,30 +82,31 @@ int main(int argc, char** argv) auto address = map.get("address").to_int(); auto size = map.get("size").to_string(); - auto readable = map.get("readable").to_bool(); - auto writable = map.get("writable").to_bool(); - auto executable = map.get("executable").to_bool(); - auto access = String::format("%s%s%s", (readable ? "r" : "-"), (writable ? "w" : "-"), (executable ? "x" : "-")); + auto access = String::format("%s%s%s%s", + (map.get("readable").to_bool() ? "r" : "-"), + (map.get("writable").to_bool() ? "w" : "-"), + (map.get("executable").to_bool() ? "x" : "-"), + (map.get("shared").to_bool() ? "s" : "-")); printf("%08x ", address); - printf("%-10s ", size.characters()); + printf("%10s ", size.characters()); if (extended) { auto resident = map.get("amount_resident").to_string(); auto dirty = map.get("amount_dirty").to_string(); auto vmobject = map.get("vmobject").to_string(); auto purgeable = map.get("purgeable").to_string(); auto cow_pages = map.get("cow_pages").to_string(); - printf("%-10s ", resident.characters()); - printf("%-10s ", dirty.characters()); - printf("%-6s ", access.characters()); + printf("%10s ", resident.characters()); + printf("%10s ", dirty.characters()); + printf("%-6s ", access.characters()); printf("%-22s ", vmobject.characters()); printf("%-10s ", purgeable.characters()); - printf("%-12s ", cow_pages.characters()); + printf("%10s ", cow_pages.characters()); } else { - printf("%-6s ", access.characters()); + printf("%-6s ", access.characters()); } auto name = map.get("name").to_string(); - printf("%-20s ", name.characters()); + printf("%-20s", name.characters()); printf("\n"); } |