From owner-svn-src-all@freebsd.org Sun Dec 31 09:22:33 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 4362DEAC7F7; Sun, 31 Dec 2017 09:22:33 +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 E79456ACFD; Sun, 31 Dec 2017 09:22:32 +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 vBV9MVrE046594; Sun, 31 Dec 2017 09:22:31 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBV9MVs4046592; Sun, 31 Dec 2017 09:22:31 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201712310922.vBV9MVs4046592@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:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327426 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327426 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:22:33 -0000 Author: cperciva Date: Sun Dec 31 09:22:31 2017 New Revision: 327426 URL: https://svnweb.freebsd.org/changeset/base/327426 Log: 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. Modified: head/sys/kern/init_main.c head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sun Dec 31 09:22:07 2017 (r327425) +++ head/sys/kern/init_main.c Sun Dec 31 09:22:31 2017 (r327426) @@ -220,6 +220,8 @@ mi_startup(void) int verbose; #endif + TSENTER(); + if (boothowto & RB_VERBOSE) bootverbose++; @@ -313,6 +315,8 @@ restart: } } + 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) Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Sun Dec 31 09:22:07 2017 (r327425) +++ head/sys/kern/vfs_mountroot.c Sun Dec 31 09:22:31 2017 (r327426) @@ -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 *