summaryrefslogtreecommitdiff
path: root/Userland/top.cpp
AgeCommit message (Collapse)Author
2020-02-18top: Use pledge() and unveil()Andreas Kling
2020-02-06LibCore: Remove leading C from filenamesAndreas Kling
2020-02-02LibCore: Put all classes in the Core namespace and remove the leading CAndreas Kling
I've been wanting to do this for a long time. It's time we start being consistent about how this stuff works. The new convention is: - "LibFoo" is a userspace library that provides the "Foo" namespace. That's it :^) This was pretty tedious to convert and I didn't even start on LibGUI yet. But it's coming up next.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-12-30Kernel: Refactor scheduler to use dynamic thread prioritiesAndreas Kling
Threads now have numeric priorities with a base priority in the 1-99 range. Whenever a runnable thread is *not* scheduled, its effective priority is incremented by 1. This is tracked in Thread::m_extra_priority. The effective priority of a thread is m_priority + m_extra_priority. When a runnable thread *is* scheduled, its m_extra_priority is reset to zero and the effective priority returns to base. This means that lower-priority threads will always eventually get scheduled to run, once its effective priority becomes high enough to exceed the base priority of threads "above" it. The previous values for ThreadPriority (Low, Normal and High) are now replaced as follows: Low -> 10 Normal -> 30 High -> 50 In other words, it will take 20 ticks for a "Low" priority thread to get to "Normal" effective priority, and another 20 to reach "High". This is not perfect, and I've used some quite naive data structures, but I think the mechanism will allow us to build various new and interesting optimizations, and we can figure out better data structures later on. :^)
2019-11-26Kernel: Make syscall counters and page fault counters per-threadAndreas Kling
Now that we show individual threads in SystemMonitor and "top", it's also very nice to have individual counters for the threads. :^)
2019-11-26Kernel: Expose per-thread information in /proc/allAndreas Kling
Previously it was not possible to see what each thread in a process was up to, or how much CPU it was consuming. This patch fixes that. SystemMonitor and "top" now show threads instead of just processes. "ps" is gonna need some more fixing, but it at least builds for now. Fixes #66.
2019-09-06AK: Rename <AK/AKString.h> to <AK/String.h>Andreas Kling
This was a workaround to be able to build on case-insensitive file systems where it might get confused about <string.h> vs <String.h>. Let's just not support building that way, so String.h can have an objectively nicer name. :^)
2019-07-18CProcessStatisticsReader: Be consistent about terminology from the kernel downRobin Burchell
2019-07-17top: Widen "state" field slightly to accomodate "Condition".Andreas Kling
2019-07-10top: Remove some unused code.Andreas Kling
2019-07-10Userland+LibCore: Use CProcessStatisticsReader to implement top.Andreas Kling
Also tweaked CProcessStatisticsReader a bit to simplify the API.
2019-07-03AK: Rename the common integer typedefs to make it obvious what they are.Andreas Kling
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
2019-06-29Kernel: Change the format of /proc/all to JSON.Andreas Kling
Update ProcessManager, top and WSCPUMonitor to handle the new format. Since the kernel is not allowed to use floating-point math, we now compile the JSON classes in AK without JsonValue::Type::Double support. To accomodate large unsigned ints, I added a JsonValue::Type::UnsignedInt.
2019-06-22printf: Oops, '-' is the left padding modifier, not ' '.Andreas Kling
It's kinda funny how I can make a mistake like this in Serenity and then get so used to it by spending lots of time using this API that I start to believe that this is how printf() always worked..
2019-06-07ProcessManager+top: Rename "linear" size to "virtual" size.Andreas Kling
I originally called it "linear" because that's how the Intel manual names virtual addresses in many cases. I'm ready to accept that most people know this as "virtual" so let's just call it that.
2019-06-07Userland: Run clang-format on everything.Andreas Kling
2019-03-09Userland: Use AK::quick_sort() in /bin/topAndreas Kling
2019-02-17Kernel: Remove tracking of bitmap memory.Andreas Kling
There are no more kernel bitmaps. It's much better this way.
2019-02-07Kernel: Add basic process priority support.Andreas Kling
For now, the WindowServer process will run with high priority, while the Finalizer process will run with low priority. Everyone else gets to be "normal". At the moment, priority simply determines the size of your time slices.
2019-02-07Kernel: When a lock is busy, donate remaining process ticks to lock holder.Andreas Kling
Since we know who's holding the lock, and we're gonna have to yield anyway, we can just ask the scheduler to donate any remaining ticks to that process.
2019-02-05Show the amount of memory in GraphicsBitmaps in /bin/top.Andreas Kling
This seems like an extremely relevant metric to track.
2019-02-04Add a /bin/top program for process table monitoring.Andreas Kling
It automagically computes %CPU usage based on the number of times a process has been scheduled between samples. The colonel task is used as idle timer. This is pretty cool. :^)