From owner-svn-src-all@freebsd.org Sun Dec 31 09:24:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C67ABEACAD5; Sun, 31 Dec 2017 09:24:12 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F12E6B4A0; Sun, 31 Dec 2017 09:24:12 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBV9OB3n047001; Sun, 31 Dec 2017 09:24:11 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBV9OBWA047000; Sun, 31 Dec 2017 09:24:11 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201712310924.vBV9OBWA047000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 31 Dec 2017 09:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327431 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Dec 2017 09:24:12 -0000 Author: cperciva Date: Sun Dec 31 09:24:11 2017 New Revision: 327431 URL: https://svnweb.freebsd.org/changeset/base/327431 Log: 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. Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sun Dec 31 09:23:52 2017 (r327430) +++ head/sys/kern/kern_kthread.c Sun Dec 31 09:24:11 2017 (r327431) @@ -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); @@ -282,6 +284,8 @@ kthread_add(void (*func)(void *), void *arg, struct pr va_start(ap, fmt); 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 */