1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

Kernel: Generate coredumps for profiled processes

These coredumps will be used by the Profile Viewer to symbolicate the
profiling samples.
This commit is contained in:
Itamar 2020-11-14 12:09:40 +02:00 committed by Andreas Kling
parent 39890af833
commit 5392f42731
2 changed files with 18 additions and 3 deletions

View file

@ -56,6 +56,12 @@ int Process::sys$profiling_disable(pid_t pid)
return -EPERM;
process->set_profiling(false);
Profiling::stop();
// We explicitly unlock here because we can't hold the lock when writing the coredump VFS
lock.unlock();
auto coredump = CoreDump::create(*process, LexicalPath { String::format("/tmp/profiler_coredumps/%d", pid) });
coredump->write();
return 0;
}