mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
Kernel: Make PerformanceEventBuffer::add_process fallible with ErrorOr
This commit is contained in:
parent
d2ffcfb762
commit
8a4654a924
Notes:
sideshowbarker
2024-07-17 21:03:32 +09:00
Author: https://github.com/IdanHo
Commit: 8a4654a924
Pull-request: https://github.com/SerenityOS/serenity/pull/11817
Reviewed-by: https://github.com/bgianfo ✅
4 changed files with 22 additions and 16 deletions
|
@ -788,11 +788,12 @@ void Process::tracer_trap(Thread& thread, const RegisterState& regs)
|
|||
|
||||
bool Process::create_perf_events_buffer_if_needed()
|
||||
{
|
||||
if (!m_perf_event_buffer) {
|
||||
m_perf_event_buffer = PerformanceEventBuffer::try_create_with_size(4 * MiB);
|
||||
m_perf_event_buffer->add_process(*this, ProcessEventType::Create);
|
||||
}
|
||||
return !!m_perf_event_buffer;
|
||||
if (m_perf_event_buffer)
|
||||
return true;
|
||||
m_perf_event_buffer = PerformanceEventBuffer::try_create_with_size(4 * MiB);
|
||||
if (!m_perf_event_buffer)
|
||||
return false;
|
||||
return !m_perf_event_buffer->add_process(*this, ProcessEventType::Create).is_error();
|
||||
}
|
||||
|
||||
void Process::delete_perf_events_buffer()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue