Kernel: Expose the VMObject type of each Region in /proc/PID/vm

This commit is contained in:
Andreas Kling 2020-02-28 20:58:57 +01:00
parent 8fbdda5a2d
commit 5f7056d62c
Notes: sideshowbarker 2024-07-19 08:58:59 +09:00
6 changed files with 11 additions and 0 deletions

View file

@ -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) {

View file

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

View file

@ -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;
};

View file

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

View file

@ -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;
};

View file

@ -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 };