summaryrefslogtreecommitdiff
path: root/Kernel/Profiling.cpp
AgeCommit message (Collapse)Author
2020-04-11LibELF: Move ELF classes into namespace ELFAndrew Kaster
This is for consistency with other namespace changes that were made a while back to the other libraries :)
2020-02-27Kernel: Don't blindly dereference Process::executable()Andreas Kling
When setting up profiling, don't assume that the profiled process has a valid executable.
2020-02-22Kernel: Reset profiling state on exec() (but keep it going)Andreas Kling
We now log the new executable on exec() and throw away all the samples we've accumulated so far. But profiling keeps going.
2020-02-22Kernel+ProfileViewer: Move symbolication to userspace for time profilesAndreas Kling
This makes the time profiles look like the memory profiles so we can use the userspace symbolication code in ProfileViewer.
2020-02-21Kernel: Commit the profiling sample buffer memory up frontAndreas Kling
This avoids getting page faults while storing samples in the timer IRQ.
2020-02-16Kernel: Move all code into the Kernel namespaceAndreas Kling
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-12Kernel: Separate out the symbol offsets in profile outputAndreas Kling
Instead of saying "main +39" and "main +57" etc, we now have a separate field in /proc/profile for the offset-into-the-symbol.
2019-12-11Kernel: Implement a simple process time profilerAndreas Kling
The kernel now supports basic profiling of all the threads in a process by calling profiling_enable(pid_t). You finish the profiling by calling profiling_disable(pid_t). This all works by recording thread stacks when the timer interrupt fires and the current thread is in a process being profiled. Note that symbolication is deferred until profiling_disable() to avoid adding more noise than necessary to the profile. A simple "/bin/profile" command is included here that can be used to start/stop profiling like so: $ profile 10 on ... wait ... $ profile 10 off After a profile has been recorded, it can be fetched in /proc/profile There are various limits (or "bugs") on this mechanism at the moment: - Only one process can be profiled at a time. - We allocate 8MB for the samples, if you use more space, things will not work, and probably break a bit. - Things will probably fall apart if the profiled process dies during profiling, or while extracing /proc/profile