mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:57:36 +00:00
Kernel: Move process exit perf events to PerformanceManager
This commit is contained in:
parent
8bf4201f50
commit
d7089a0417
2 changed files with 11 additions and 5 deletions
|
@ -29,6 +29,15 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void add_process_exit_event(Process& process)
|
||||||
|
{
|
||||||
|
if (g_profiling_all_threads) {
|
||||||
|
VERIFY(g_global_perf_events);
|
||||||
|
[[maybe_unused]] auto rc = g_global_perf_events->append_with_eip_and_ebp(
|
||||||
|
process.pid(), 0, 0, 0, PERF_EVENT_PROCESS_EXIT, 0, 0, nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline static void add_thread_created_event(Thread& thread)
|
inline static void add_thread_created_event(Thread& thread)
|
||||||
{
|
{
|
||||||
if (auto* event_buffer = thread.process().current_perf_events_buffer()) {
|
if (auto* event_buffer = thread.process().current_perf_events_buffer()) {
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <Kernel/KSyms.h>
|
#include <Kernel/KSyms.h>
|
||||||
#include <Kernel/Module.h>
|
#include <Kernel/Module.h>
|
||||||
#include <Kernel/PerformanceEventBuffer.h>
|
#include <Kernel/PerformanceEventBuffer.h>
|
||||||
|
#include <Kernel/PerformanceManager.h>
|
||||||
#include <Kernel/Process.h>
|
#include <Kernel/Process.h>
|
||||||
#include <Kernel/RTC.h>
|
#include <Kernel/RTC.h>
|
||||||
#include <Kernel/StdLib.h>
|
#include <Kernel/StdLib.h>
|
||||||
|
@ -245,11 +246,7 @@ Process::~Process()
|
||||||
VERIFY(thread_count() == 0); // all threads should have been finalized
|
VERIFY(thread_count() == 0); // all threads should have been finalized
|
||||||
VERIFY(!m_alarm_timer);
|
VERIFY(!m_alarm_timer);
|
||||||
|
|
||||||
if (g_profiling_all_threads) {
|
PerformanceManager::add_process_exit_event(*this);
|
||||||
VERIFY(g_global_perf_events);
|
|
||||||
[[maybe_unused]] auto rc = g_global_perf_events->append_with_eip_and_ebp(
|
|
||||||
pid(), 0, 0, 0, PERF_EVENT_PROCESS_EXIT, 0, 0, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ScopedSpinLock processes_lock(g_processes_lock);
|
ScopedSpinLock processes_lock(g_processes_lock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue