1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:17:44 +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

@ -416,6 +416,7 @@ public:
ErrorOr<FlatPtr> sys$getkeymap(Userspace<Syscall::SC_getkeymap_params const*>);
ErrorOr<FlatPtr> sys$setkeymap(Userspace<Syscall::SC_setkeymap_params const*>);
ErrorOr<FlatPtr> sys$profiling_enable(pid_t, Userspace<u64 const*>);
ErrorOr<FlatPtr> profiling_enable(pid_t, u64 event_mask);
ErrorOr<FlatPtr> sys$profiling_disable(pid_t);
ErrorOr<FlatPtr> sys$profiling_free_buffer(pid_t);
ErrorOr<FlatPtr> sys$futex(Userspace<Syscall::SC_futex_params const*>);