mi_startup: Instrument the bubblesort with TSLOG

The bubblesort of SYSINITs is currently responsible for 7% of the
kernel boot time when booting a 1 CPU / 128 MB VM under Firecracker.

It needs to be replaced with a faster sort, but until that happens
at least instrumenting it with TSLOG makes it show up in flamecharts.
This commit is contained in:
Colin Percival 2023-05-19 06:46:42 -07:00
parent f3546eacf0
commit 40b2870545
1 changed files with 2 additions and 0 deletions

View File

@ -255,6 +255,7 @@ restart:
* Perform a bubble sort of the system initialization objects by
* their subsystem (primary key) and order (secondary key).
*/
TSENTER2("bubblesort");
for (sipp = sysinit; sipp < sysinit_end; sipp++) {
for (xipp = sipp + 1; xipp < sysinit_end; xipp++) {
if ((*sipp)->subsystem < (*xipp)->subsystem ||
@ -266,6 +267,7 @@ restart:
*xipp = save;
}
}
TSEXIT2("bubblesort");
last = SI_SUB_COPYRIGHT;
#if defined(VERBOSE_SYSINIT)