diff options
author | Tom <tomut@yahoo.com> | 2021-07-14 21:46:32 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-18 22:08:26 +0200 |
commit | a635ff4e600729fb7d12fdd16ac6ffbaa455bb30 (patch) | |
tree | 8625e110b4c9ca2510c3a8ac28b45bddae828af7 /Kernel/GlobalProcessExposed.cpp | |
parent | 7e77a2ec40bc339f41e75aa9fdc6744df449612c (diff) | |
download | serenity-a635ff4e600729fb7d12fdd16ac6ffbaa455bb30.zip |
Everywhere: Make tracking cpu usage independent from system ticks
This switches tracking CPU usage to more accurately measure time in
user and kernel land using either the TSC or another time source.
This will also come in handy when implementing a tickless kernel mode.
Diffstat (limited to 'Kernel/GlobalProcessExposed.cpp')
-rw-r--r-- | Kernel/GlobalProcessExposed.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/GlobalProcessExposed.cpp b/Kernel/GlobalProcessExposed.cpp index 99a0fa606e..eec1233ebf 100644 --- a/Kernel/GlobalProcessExposed.cpp +++ b/Kernel/GlobalProcessExposed.cpp @@ -469,8 +469,8 @@ private: thread_object.add("tid", thread.tid().value()); thread_object.add("name", thread.name()); thread_object.add("times_scheduled", thread.times_scheduled()); - thread_object.add("ticks_user", thread.ticks_in_user()); - thread_object.add("ticks_kernel", thread.ticks_in_kernel()); + thread_object.add("time_user", thread.time_in_user()); + thread_object.add("time_kernel", thread.time_in_kernel()); thread_object.add("state", thread.state_string()); thread_object.add("cpu", thread.cpu()); thread_object.add("priority", thread.priority()); @@ -497,9 +497,9 @@ private: build_process(array, process); } - auto total_ticks_scheduled = Scheduler::get_total_ticks_scheduled(); - json.add("total_ticks", total_ticks_scheduled.total); - json.add("total_ticks_kernel", total_ticks_scheduled.total_kernel); + auto total_time_scheduled = Scheduler::get_total_time_scheduled(); + json.add("total_time", total_time_scheduled.total); + json.add("total_time_kernel", total_time_scheduled.total_kernel); } return true; } |