1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

Kernel: Track performance events for context switches

This commit is contained in:
Gunnar Beutner 2021-05-14 07:48:53 +02:00 committed by Andreas Kling
parent c94440860e
commit 8b2ace0326
6 changed files with 29 additions and 2 deletions

View file

@ -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];