1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibC: Allow opting into malloc() and free() performance event logging

If a program is started with LIBC_PROFILE_MALLOC in the environment,
it will now generate PERF_EVENT_MALLOC and PERF_EVENT_FREE.
This commit is contained in:
Andreas Kling 2020-02-02 20:28:29 +01:00
parent 3879e5b9d4
commit fa97ff1c83
4 changed files with 32 additions and 4 deletions

View file

@ -79,4 +79,9 @@ int purge(int mode)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int perf_event(int type, uintptr_t arg1, uintptr_t arg2)
{
int rc = syscall(SC_perf_event, type, arg1, arg2);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}