From owner-svn-src-head@freebsd.org Wed Jan 17 23:47:02 2018 Return-Path: Delivered-To: svn-src-head@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 13C56EC01E8 for ; Wed, 17 Jan 2018 23:47:02 +0000 (UTC) (envelope-from 01000161067f4f4b-03c47956-d81c-4470-b7fb-6f1512699d36-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDDB768E6B for ; Wed, 17 Jan 2018 23:47:01 +0000 (UTC) (envelope-from 01000161067f4f4b-03c47956-d81c-4470-b7fb-6f1512699d36-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1516232462; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=Ra/rpFnrlABKJKh2ADukoiriDZ1ZUfPBUhwpJGvf2EU=; b=GSZGS5YDaw9EyGS2hwjA42vS29w86eXeU72oVQxo7PFhW4TucdWCnBAXDU6kXQRG qRrnoTqeJGuocuto4hunqa0fOSGLii26rS5RM4ckdWpd9MMOTjA3rE7N4Fjumr06PCg P2En5HJHjiQzLySZXcaUak98fixC1Xa2jPX6mv4Y= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1516232462; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=Ra/rpFnrlABKJKh2ADukoiriDZ1ZUfPBUhwpJGvf2EU=; b=TszAhNE5OX8xiFZ2JhIJK3XXyQqUVwoVCdy5Bgw3yzlEuPGJLmZPZBjTai5FkcK7 k/5+feiHs9TChw2OcrfcEuGrBDlxpD+x4pYcZ66XR+WWEgvAIZ+KQNaR8qnr3wOAiCn BQMuGsKTMfcoNGBU11q6LqyAAxs4QK3mmoQRi/To= Subject: Re: svn commit: r327423 - in head/sys: kern sys To: Gleb Smirnoff References: <201712310921.vBV9L133042419@repo.freebsd.org> <20180117230902.GP8113@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Colin Percival Message-ID: <01000161067f4f4b-03c47956-d81c-4470-b7fb-6f1512699d36-000000@email.amazonses.com> Date: Wed, 17 Jan 2018 23:41:02 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20180117230902.GP8113@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2018.01.17-54.240.8.176 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2018 23:47:02 -0000 On 01/17/18 15:09, Gleb Smirnoff wrote: > On Sun, Dec 31, 2017 at 09:21:01AM +0000, Colin Percival wrote: > C> Code for recording timestamps of events, especially function entries/exits. > C> This is a very primitive system, intended for use in measuring performance > C> during the early system boot, before more sophisticated tools like DTrace > C> or infrastructure like kernel memory allocation and mutexes are available. > > Sorry if my question is too lame and late. Why can't you use ktr(4) tracer > for that purpose? The discussion on freebsd-current also doesn't have answer. I considered it, but it wasn't a good fit for a couple reasons: 1. ktr uses a circular buffer, while (since I'm looking at the boot process) I want to fill a buffer and then stop recording. 2. I would have needed to hack up ktr in order to make it work early enough in the boot process. (Most obviously: When we enter hammer_time, trying to access 'curthread' is a Bad Idea.) Since the timestamp recording framework I needed was just a few lines of code -- all the other commits are to add the points where timestamps are recorded, and would have been needed even if I used ktr -- it seemed better to just add my own code rather than coercing ktr to do what I needed. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid