mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +00:00
Kernel: Disable profiling if setting up the buffer or timer failed
This commit is contained in:
parent
d3f298c592
commit
ad6587424f
1 changed files with 6 additions and 2 deletions
|
@ -53,10 +53,14 @@ KResultOr<int> Process::sys$profiling_enable(pid_t pid, u64 event_mask)
|
||||||
return EPERM;
|
return EPERM;
|
||||||
g_profiling_event_mask = event_mask;
|
g_profiling_event_mask = event_mask;
|
||||||
process->set_profiling(true);
|
process->set_profiling(true);
|
||||||
if (!process->create_perf_events_buffer_if_needed())
|
if (!process->create_perf_events_buffer_if_needed()) {
|
||||||
|
process->set_profiling(false);
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
if (!TimeManagement::the().enable_profile_timer())
|
}
|
||||||
|
if (!TimeManagement::the().enable_profile_timer()) {
|
||||||
|
process->set_profiling(false);
|
||||||
return ENOTSUP;
|
return ENOTSUP;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue