1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 01:15:07 +00:00

Kernel: Make syscall counters and page fault counters per-thread

Now that we show individual threads in SystemMonitor and "top",
it's also very nice to have individual counters for the threads. :^)
This commit is contained in:
Andreas Kling 2019-11-26 21:35:24 +01:00
parent 712ae73581
commit 5b8cf2ee23
9 changed files with 38 additions and 38 deletions

View file

@ -331,6 +331,15 @@ public:
void make_thread_specific_region(Badge<Process>);
unsigned syscall_count() const { return m_syscall_count; }
void did_syscall() { ++m_syscall_count; }
unsigned inode_faults() const { return m_inode_faults; }
void did_inode_fault() { ++m_inode_faults; }
unsigned zero_faults() const { return m_zero_faults; }
void did_zero_fault() { ++m_zero_faults; }
unsigned cow_faults() const { return m_cow_faults; }
void did_cow_fault() { ++m_cow_faults; }
Thread* clone(Process&);
template<typename Callback>
@ -376,6 +385,11 @@ private:
Thread* m_joinee { nullptr };
void* m_exit_value { nullptr };
unsigned m_syscall_count { 0 };
unsigned m_inode_faults { 0 };
unsigned m_zero_faults { 0 };
unsigned m_cow_faults { 0 };
FPUState* m_fpu_state { nullptr };
State m_state { Invalid };
ThreadPriority m_priority { ThreadPriority::Normal };