mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:17:35 +00:00
Kernel: Make sure we only log profiling events when m_profiling is true
Previously the process' m_profiling flag was ignored for all event types other than CPU samples. The kfree tracing code relies on temporarily disabling tracing during exec. This didn't work for per-process profiles and would instead panic. This updates the profiling code so that the m_profiling flag isn't ignored.
This commit is contained in:
parent
a8ca4751b9
commit
0688e02339
4 changed files with 15 additions and 16 deletions
|
@ -51,12 +51,12 @@ KResultOr<int> Process::sys$profiling_enable(pid_t pid, u64 event_mask)
|
|||
return ESRCH;
|
||||
if (!is_superuser() && process->uid() != euid())
|
||||
return EPERM;
|
||||
g_profiling_event_mask = event_mask;
|
||||
process->set_profiling(true);
|
||||
if (!process->create_perf_events_buffer_if_needed())
|
||||
return ENOMEM;
|
||||
if (!TimeManagement::the().enable_profile_timer())
|
||||
return ENOTSUP;
|
||||
g_profiling_event_mask = event_mask;
|
||||
process->set_profiling(true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue