summaryrefslogtreecommitdiff
path: root/Kernel/PerformanceManager.h
AgeCommit message (Collapse)Author
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.