1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:07:34 +00:00

Kernel: Fix boot profiling

Boot profiling was previously broken due to init_stage2() passing the
event mask to sys$profiling_enable() via kernel pointer, but a user
pointer is expected.

To fix this, I added Process::profiling_enable() as an alternative to
Process::sys$profiling_enable which takes a u64 rather than a
Userspace<u64 const*>. It's a bit of a hack, but it works.
This commit is contained in:
Samuel Bowman 2022-08-20 21:55:55 -04:00 committed by Andreas Kling
parent 0abe4d8b97
commit 91574ed677
3 changed files with 9 additions and 1 deletions

View file

@ -393,7 +393,7 @@ void init_stage2(void*)
dbgln("Starting full system boot profiling");
MutexLocker mutex_locker(Process::current().big_lock());
auto const enable_all = ~(u64)0;
auto result = Process::current().sys$profiling_enable(-1, reinterpret_cast<FlatPtr>(&enable_all));
auto result = Process::current().profiling_enable(-1, enable_all);
VERIFY(!result.is_error());
}