mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Disable profiling if setting up the buffer or timer failed
This commit is contained in:
parent
d3f298c592
commit
ad6587424f
Notes:
sideshowbarker
2024-07-18 17:28:30 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/ad6587424fa Pull-request: https://github.com/SerenityOS/serenity/pull/7437
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;
|
||||
g_profiling_event_mask = event_mask;
|
||||
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;
|
||||
if (!TimeManagement::the().enable_profile_timer())
|
||||
}
|
||||
if (!TimeManagement::the().enable_profile_timer()) {
|
||||
process->set_profiling(false);
|
||||
return ENOTSUP;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue