summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-02 14:13:49 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-02 14:13:49 +0200
commit35138437efed0f37f303ba9c44d831a889871a29 (patch)
tree7bdd870ca191b86ffa1838a08ecf1b0175017100 /Kernel/FileSystem
parentc33ac7f1704fb26533a532e09ee9010c73077920 (diff)
downloadserenity-35138437efed0f37f303ba9c44d831a889871a29.zip
Kernel+SystemMonitor: Add fault counters
This patch adds three separate per-process fault counters: - Inode faults An inode fault happens when we've memory-mapped a file from disk and we end up having to load 1 page (4KB) of the file into memory. - Zero faults Memory returned by mmap() is lazily zeroed out. Every time we have to zero out 1 page, we count a zero fault. - CoW faults VM objects can be shared by multiple mappings that make their own unique copy iff they want to modify it. The typical reason here is memory shared between a parent and child process.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/ProcFS.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp
index 397056866c..e523464914 100644
--- a/Kernel/FileSystem/ProcFS.cpp
+++ b/Kernel/FileSystem/ProcFS.cpp
@@ -685,6 +685,9 @@ Optional<KBuffer> procfs$all(InodeIdentifier)
process_object.add("ticks", process.main_thread().ticks());
process_object.add("priority", to_string(process.priority()));
process_object.add("syscall_count", process.syscall_count());
+ process_object.add("inode_faults", process.inode_faults());
+ process_object.add("zero_faults", process.zero_faults());
+ process_object.add("cow_faults", process.cow_faults());
process_object.add("icon_id", process.icon_id());
};
build_process(*Scheduler::colonel());