summaryrefslogtreecommitdiff
path: root/Kernel/PerformanceManager.h
AgeCommit message (Collapse)Author
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-02-14Kernel/Profiling: Add profiling to read syscallJakub Berkop
Syscalls to read can now be profiled, allowing us to monitor filesystem usage by different applications.
2022-01-12Kernel: Make PerformanceEventBuffer::add_process fallible with ErrorOrIdan Horowitz
2021-11-14Kernel: Resolve clang-tidy readability-qualified-auto warningAndrew Kaster
... In files included by Kernel/Process.cpp or Kernel/Thread.cpp
2021-10-12Kernel: Pass RegisterState by ref to event bufferJames Mintram
2021-10-02Kernel: Access Processor static methods staticallyBrian Gianforcaro
SonarCloud flagged this "Code Smell", where we are accessing these static methods as if they are instance methods. While it is technically possible, it is very confusing to read when you realize they are static functions.
2021-08-10Kernel: Add syscall performance event typeJean-Baptiste Boric
This allows tracing the syscalls made by a thread through the kernel's performance event framework, which is similar in principle to strace. Currently, this merely logs a stack backtrace to the current thread's performance event buffer whenever a syscall is made, if profiling is enabled. Future improvements could include tracing the arguments and the return value, for example.
2021-08-06Kernel: Rename Range => VirtualRangeAndreas Kling
...and also RangeAllocator => VirtualRangeAllocator. This clarifies that the ranges we're dealing with are *virtual* memory ranges and not anything else.
2021-08-06Kernel: Move Kernel/Memory/ code into Kernel::Memory namespaceAndreas Kling
2021-07-19Kernel: Rename PerformanceEvent methods to be more ARCH independentBrian Gianforcaro
2021-06-27Kernel+Userland: Add x86_64 registers to RegisterState/PtraceRegistersGunnar Beutner
2021-05-30Kernel: Don't log profile data before/after the process/thread lifetimeGunnar Beutner
There were a few cases where we could end up logging profiling events before or after the associated process or thread exists in the profile: After enabling profiling we might end up with CPU samples before we had a chance to synthesize process/thread creation events. After a thread exits we would still log associated kmalloc/kfree events. Instead we now just ignore those events.
2021-05-23Kernel: Make sure we only log profiling events when m_profiling is trueGunnar Beutner
Previously the process' m_profiling flag was ignored for all event types other than CPU samples. The kfree tracing code relies on temporarily disabling tracing during exec. This didn't work for per-process profiles and would instead panic. This updates the profiling code so that the m_profiling flag isn't ignored.
2021-05-19Kernel: Generate page fault events from the kernel profilerBrian Gianforcaro
Hook the kernel page fault handler and capture page fault events when the fault has a current thread attached in TLS. We capture the eip and ebp so we can unwind the stack and locate which pieces of code are generating the most page faults. Co-authored-by: Gunnar Beutner <gbeutner@serenityos.org>
2021-05-19Kernel: Add support for profiling kmalloc()/kfree()Gunnar Beutner
2021-05-19Kernel: Track performance events for context switchesGunnar Beutner
2021-05-14Kernel+Profiler: Track lost time between profiler timer ticksGunnar Beutner
We can lose profiling timer events for a few reasons, for example disabled interrupts or system slowness. This accounts for lost time between CPU samples by adding a field lost_samples to each profiling event which tracks how many samples were lost immediately preceding the event.
2021-05-14Kernel: Use a separate timer for profiling the systemGunnar Beutner
This updates the profiling subsystem to use a separate timer to trigger CPU sampling. This timer has a higher resolution (1000Hz) and is independent from the scheduler. At a later time the resolution could even be made configurable with an argument for sys$profiling_enable() - but not today.
2021-05-07Kernel: Move cpu sample perf event to PerformanceManagerBrian Gianforcaro
2021-05-07Kernel: Move process exit perf events to PerformanceManagerBrian Gianforcaro
2021-05-07Kernel: Move process creation perf events to PerformanceManagerBrian Gianforcaro
2021-05-07Kernel: Add PerformanceManager static class, move perf event APIs thereBrian Gianforcaro
The current method of emitting performance events requires a bit of boiler plate at every invocation, as well as having to ignore the return code which isn't used outside of the perf event syscall. This change attempts to clean that up by exposing high level API's that can be used around the code base.