1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 10:04:59 +00:00

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.
This commit is contained in:
Andreas Kling 2019-10-02 14:13:49 +02:00
parent c33ac7f170
commit 35138437ef
7 changed files with 62 additions and 0 deletions

View file

@ -43,6 +43,9 @@ HashMap<pid_t, CProcessStatistics> CProcessStatisticsReader::get_all()
process.ticks = process_object.get("ticks").to_u32();
process.priority = process_object.get("priority").to_string();
process.syscall_count = process_object.get("syscall_count").to_u32();
process.inode_faults = process_object.get("inode_faults").to_u32();
process.zero_faults = process_object.get("zero_faults").to_u32();
process.cow_faults = process_object.get("cow_faults").to_u32();
process.icon_id = process_object.get("icon_id").to_int();
// and synthetic data last