summaryrefslogtreecommitdiff
path: root/Kernel/PerformanceEventBuffer.h
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-14 07:48:53 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-19 22:51:42 +0200
commit8b2ace0326bceb28bdf80c0a09e8297acf39df97 (patch)
treea1c0cd63cef77a6793035a9ca8a5820c773f6e56 /Kernel/PerformanceEventBuffer.h
parentc94440860e46cca9b66afba833c0771515da16fb (diff)
downloadserenity-8b2ace0326bceb28bdf80c0a09e8297acf39df97.zip
Kernel: Track performance events for context switches
Diffstat (limited to 'Kernel/PerformanceEventBuffer.h')
-rw-r--r--Kernel/PerformanceEventBuffer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/PerformanceEventBuffer.h b/Kernel/PerformanceEventBuffer.h
index cfff3ac2e5..4b31b5f516 100644
--- a/Kernel/PerformanceEventBuffer.h
+++ b/Kernel/PerformanceEventBuffer.h
@@ -47,6 +47,11 @@ struct [[gnu::packed]] ThreadCreatePerformanceEvent {
pid_t parent_tid;
};
+struct [[gnu::packed]] ContextSwitchPerformanceEvent {
+ pid_t next_pid;
+ u32 next_tid;
+};
+
struct [[gnu::packed]] PerformanceEvent {
u8 type { 0 };
u8 stack_size { 0 };
@@ -62,6 +67,7 @@ struct [[gnu::packed]] PerformanceEvent {
ProcessCreatePerformanceEvent process_create;
ProcessExecPerformanceEvent process_exec;
ThreadCreatePerformanceEvent thread_create;
+ ContextSwitchPerformanceEvent context_switch;
} data;
static constexpr size_t max_stack_frame_count = 64;
FlatPtr stack[max_stack_frame_count];