From 4d429ba9ea70750adbd797a1aa45c05bef51c580 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 15 May 2021 21:25:54 +0200 Subject: [PATCH] Kernel: Unbreak profiling all processes Regressed in 8a4cc735b9114a197c01ba113082b82471ebf104. We stopped generating "process created" when enabling profiling, which led to Profiler getting confused about the missing events. --- Kernel/Syscalls/profiling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Syscalls/profiling.cpp b/Kernel/Syscalls/profiling.cpp index d905dea449..9fbc7c599e 100644 --- a/Kernel/Syscalls/profiling.cpp +++ b/Kernel/Syscalls/profiling.cpp @@ -32,11 +32,11 @@ KResultOr Process::sys$profiling_enable(pid_t pid) ScopedSpinLock lock(g_processes_lock); if (!TimeManagement::the().enable_profile_timer()) return ENOTSUP; + g_profiling_all_threads = true; Process::for_each([](auto& process) { PerformanceManager::add_process_created_event(process); return IterationDecision::Continue; }); - g_profiling_all_threads = true; return 0; }