mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
Kernel: Add 'boot_prof' option to enable full system profiling on boot
The full system profiling functionality is useful for profiling the boot performance of the system. Add a new kernel boot option to start the system with profiling enabled. This lets you disable and view a profile once the system is booted. You can use it by running: ``` $ run.sh qcmd boot_prof ```
This commit is contained in:
parent
0f424afd5a
commit
afe099388e
3 changed files with 13 additions and 1 deletions
|
@ -246,7 +246,7 @@ void init_stage2(void*)
|
|||
FinalizerTask::spawn();
|
||||
|
||||
PCI::initialize();
|
||||
|
||||
auto boot_profiling = kernel_command_line().is_boot_profiling_enabled();
|
||||
auto is_text_mode = kernel_command_line().is_text_mode();
|
||||
if (is_text_mode) {
|
||||
dbgln("Text mode enabled");
|
||||
|
@ -319,6 +319,12 @@ void init_stage2(void*)
|
|||
}
|
||||
thread->set_priority(THREAD_PRIORITY_HIGH);
|
||||
|
||||
if (boot_profiling) {
|
||||
dbgln("Starting full system boot profiling");
|
||||
auto result = Process::current()->sys$profiling_enable(-1);
|
||||
VERIFY(!result.is_error());
|
||||
}
|
||||
|
||||
NetworkTask::spawn();
|
||||
|
||||
Process::current()->sys$exit(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue