Use the TSLOG framework to record entry/exit timestamps for machine

independent functions with important roles in the early boot process:
mi_startup (with the "exit" recorded when it becomes swapper),
start_init (with the "exit" recorded when the thread is about to
"return" into the newly created init process), vfs_mountroot, and
vfs_mountroot_wait.
This commit is contained in:
Colin Percival 2017-12-31 09:22:31 +00:00
parent 31a55efdc5
commit 6032e08810
2 changed files with 15 additions and 0 deletions

View File

@ -220,6 +220,8 @@ mi_startup(void)
int verbose;
#endif
TSENTER();
if (boothowto & RB_VERBOSE)
bootverbose++;
@ -313,6 +315,8 @@ mi_startup(void)
}
}
TSEXIT(); /* Here so we don't overlap with start_init. */
mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED);
mtx_unlock(&Giant);
@ -706,6 +710,8 @@ start_init(void *dummy)
GIANT_REQUIRED;
TSENTER(); /* Here so we don't overlap with mi_startup. */
td = curthread;
p = td->td_proc;
@ -799,6 +805,7 @@ start_init(void *dummy)
*/
if ((error = sys_execve(td, &args)) == EJUSTRETURN) {
mtx_unlock(&Giant);
TSEXIT();
return;
}
if (error != ENOENT)

View File

@ -938,6 +938,8 @@ vfs_mountroot_wait(void)
struct timeval lastfail;
int curfail;
TSENTER();
curfail = 0;
while (1) {
DROP_GIANT();
@ -957,6 +959,8 @@ vfs_mountroot_wait(void)
msleep(&root_holds, &root_holds_mtx, PZERO | PDROP, "roothold",
hz);
}
TSEXIT();
}
static int
@ -1013,6 +1017,8 @@ vfs_mountroot(void)
struct thread *td;
time_t timebase;
int error;
TSENTER();
td = curthread;
@ -1062,6 +1068,8 @@ vfs_mountroot(void)
mtx_unlock(&root_holds_mtx);
EVENTHANDLER_INVOKE(mountroot);
TSEXIT();
}
static struct mntarg *