summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-28 20:58:57 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-28 23:25:40 +0100
commit5f7056d62c6ecf51bd5e5a1cdc597850a03915c2 (patch)
treea76f886cd2510638a878399495acf48dce97ebbe /Kernel
parent8fbdda5a2dae61d336e5fabcc6b6adf5c8efa308 (diff)
downloadserenity-5f7056d62c6ecf51bd5e5a1cdc597850a03915c2.zip
Kernel: Expose the VMObject type of each Region in /proc/PID/vm
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/FileSystem/ProcFS.cpp1
-rw-r--r--Kernel/VM/AnonymousVMObject.h2
-rw-r--r--Kernel/VM/PrivateInodeVMObject.h2
-rw-r--r--Kernel/VM/PurgeableVMObject.h2
-rw-r--r--Kernel/VM/SharedInodeVMObject.h2
-rw-r--r--Kernel/VM/VMObject.h2
6 files changed, 11 insertions, 0 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp
index 79c4840ed8..66b6721bc8 100644
--- a/Kernel/FileSystem/ProcFS.cpp
+++ b/Kernel/FileSystem/ProcFS.cpp
@@ -315,6 +315,7 @@ Optional<KBuffer> procfs$pid_vm(InodeIdentifier identifier)
region_object.add("amount_dirty", (u32)region.amount_dirty());
region_object.add("cow_pages", region.cow_pages());
region_object.add("name", region.name());
+ region_object.add("vmobject", region.vmobject().class_name());
StringBuilder pagemap_builder;
for (size_t i = 0; i < region.page_count(); ++i) {
diff --git a/Kernel/VM/AnonymousVMObject.h b/Kernel/VM/AnonymousVMObject.h
index 3b9631c6f0..9972bab1a4 100644
--- a/Kernel/VM/AnonymousVMObject.h
+++ b/Kernel/VM/AnonymousVMObject.h
@@ -44,6 +44,8 @@ protected:
explicit AnonymousVMObject(size_t);
explicit AnonymousVMObject(const AnonymousVMObject&);
+ virtual const char* class_name() const override { return "AnonymousVMObject"; }
+
private:
AnonymousVMObject(PhysicalAddress, size_t);
diff --git a/Kernel/VM/PrivateInodeVMObject.h b/Kernel/VM/PrivateInodeVMObject.h
index 4a1d8a87a4..7f0d3998bc 100644
--- a/Kernel/VM/PrivateInodeVMObject.h
+++ b/Kernel/VM/PrivateInodeVMObject.h
@@ -45,6 +45,8 @@ private:
explicit PrivateInodeVMObject(Inode&, size_t);
explicit PrivateInodeVMObject(const PrivateInodeVMObject&);
+ virtual const char* class_name() const override { return "PrivateInodeVMObject"; }
+
PrivateInodeVMObject& operator=(const PrivateInodeVMObject&) = delete;
};
diff --git a/Kernel/VM/PurgeableVMObject.h b/Kernel/VM/PurgeableVMObject.h
index 715df1d774..5e100aa5f0 100644
--- a/Kernel/VM/PurgeableVMObject.h
+++ b/Kernel/VM/PurgeableVMObject.h
@@ -50,6 +50,8 @@ private:
explicit PurgeableVMObject(size_t);
explicit PurgeableVMObject(const PurgeableVMObject&);
+ virtual const char* class_name() const override { return "PurgeableVMObject"; }
+
int purge_impl();
PurgeableVMObject& operator=(const PurgeableVMObject&) = delete;
diff --git a/Kernel/VM/SharedInodeVMObject.h b/Kernel/VM/SharedInodeVMObject.h
index c8c33206c9..f817ac673c 100644
--- a/Kernel/VM/SharedInodeVMObject.h
+++ b/Kernel/VM/SharedInodeVMObject.h
@@ -45,6 +45,8 @@ private:
explicit SharedInodeVMObject(Inode&, size_t);
explicit SharedInodeVMObject(const SharedInodeVMObject&);
+ virtual const char* class_name() const override { return "SharedInodeVMObject"; }
+
SharedInodeVMObject& operator=(const SharedInodeVMObject&) = delete;
};
diff --git a/Kernel/VM/VMObject.h b/Kernel/VM/VMObject.h
index 67bb137850..ff62f8d0a9 100644
--- a/Kernel/VM/VMObject.h
+++ b/Kernel/VM/VMObject.h
@@ -59,6 +59,8 @@ public:
size_t size() const { return m_physical_pages.size() * PAGE_SIZE; }
+ virtual const char* class_name() const = 0;
+
// For InlineLinkedListNode
VMObject* m_next { nullptr };
VMObject* m_prev { nullptr };