mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
ccdcb6a635
The current method of emitting performance events requires a bit of boiler plate at every invocation, as well as having to ignore the return code which isn't used outside of the perf event syscall. This change attempts to clean that up by exposing high level API's that can be used around the code base.
29 lines
596 B
C++
29 lines
596 B
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <Kernel/KSyms.h>
|
|
#include <Kernel/PerformanceManager.h>
|
|
#include <Kernel/Process.h>
|
|
|
|
namespace Kernel {
|
|
|
|
void Process::sys$exit(int status)
|
|
{
|
|
{
|
|
ProtectedDataMutationScope scope { *this };
|
|
m_termination_status = status;
|
|
m_termination_signal = 0;
|
|
}
|
|
|
|
auto* current_thread = Thread::current();
|
|
PerformanceManager::add_thread_exit_event(*current_thread);
|
|
|
|
die();
|
|
current_thread->die_if_needed();
|
|
VERIFY_NOT_REACHED();
|
|
}
|
|
|
|
}
|