diff options
author | Gunnar Beutner <gunnar@beutner.name> | 2021-04-25 23:42:36 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-26 17:13:55 +0200 |
commit | eb798d5538ea3c978034d8d8364ecfd7fbc6a8ee (patch) | |
tree | e023bc175ec5e7d89898f5214701e6d50154b75f /Kernel/Process.h | |
parent | f57c57966bb560a7090f4da528e5486d4c4de3f6 (diff) | |
download | serenity-eb798d5538ea3c978034d8d8364ecfd7fbc6a8ee.zip |
Kernel+Profiler: Improve profiling subsystem
This turns the perfcore format into more a log than it was before,
which lets us properly log process, thread and region
creation/destruction. This also makes it unnecessary to dump the
process' regions every time it is scheduled like we did before.
Incidentally this also fixes 'profile -c' because we previously ended
up incorrectly dumping the parent's region map into the profile data.
Log-based mmap support enables profiling shared libraries which
are loaded at runtime, e.g. via dlopen().
This enables profiling both the parent and child process for
programs which use execve(). Previously we'd discard the profiling
data for the old process.
The Profiler tool has been updated to not treat thread IDs as
process IDs anymore. This enables support for processes with more
than one thread. Also, there's a new widget to filter which
process should be displayed.
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r-- | Kernel/Process.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h index a388af94bc..34e9d3bf8a 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -20,6 +20,7 @@ #include <Kernel/Forward.h> #include <Kernel/FutexQueue.h> #include <Kernel/Lock.h> +#include <Kernel/PerformanceEventBuffer.h> #include <Kernel/ProcessGroup.h> #include <Kernel/StdLib.h> #include <Kernel/Thread.h> @@ -528,6 +529,11 @@ private: void clear_futex_queues_on_exec(); + inline PerformanceEventBuffer* current_perf_events_buffer() + { + return g_profiling_all_threads ? g_global_perf_events : m_perf_event_buffer.ptr(); + } + Process* m_prev { nullptr }; Process* m_next { nullptr }; |