From d913278fc1c0659a5c21f735c38657799b2901cd Mon Sep 17 00:00:00 2001 From: cperciva Date: Sun, 31 Dec 2017 09:24:11 +0000 Subject: [PATCH] Instrument thread creations for the the benefit of the TSLOG framework. This assists in tracking time spent while the boot is being "held" waiting for something to happen. --- sys/kern/kern_kthread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index 05762cdae7dc..ae7eef5ff07d 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -124,6 +125,7 @@ kproc_create(void (*func)(void *), void *arg, #ifdef KTR sched_clear_tdname(td); #endif + TSTHREAD(td, td->td_name); /* call the processes' main()... */ cpu_fork_kthread_handler(td, func, arg); @@ -283,6 +285,8 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p, vsnprintf(newtd->td_name, sizeof(newtd->td_name), fmt, ap); va_end(ap); + TSTHREAD(newtd, newtd->td_name); + newtd->td_proc = p; /* needed for cpu_copy_thread */ /* might be further optimized for kthread */ cpu_copy_thread(newtd, oldtd);