mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
Kernel: Move process creation perf events to PerformanceManager
This commit is contained in:
parent
ccdcb6a635
commit
8bf4201f50
4 changed files with 23 additions and 13 deletions
|
@ -7,7 +7,7 @@
|
|||
#include <Kernel/CoreDump.h>
|
||||
#include <Kernel/FileSystem/FileDescription.h>
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/PerformanceEventBuffer.h>
|
||||
#include <Kernel/PerformanceManager.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -27,12 +27,13 @@ KResultOr<int> Process::sys$profiling_enable(pid_t pid)
|
|||
g_global_perf_events->clear();
|
||||
else
|
||||
g_global_perf_events = PerformanceEventBuffer::try_create_with_size(32 * MiB).leak_ptr();
|
||||
|
||||
ScopedSpinLock lock(g_processes_lock);
|
||||
g_profiling_all_threads = true;
|
||||
Process::for_each([](auto& process) {
|
||||
g_global_perf_events->add_process(process, ProcessEventType::Create);
|
||||
PerformanceManager::add_process_created_event(process);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
g_profiling_all_threads = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue