From owner-svn-src-all@freebsd.org Tue Feb 21 21:21:57 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 172D5CE87C4; Tue, 21 Feb 2017 21:21:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4734D8A; Tue, 21 Feb 2017 21:21:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x243.google.com with SMTP id n127so9182143qkf.2; Tue, 21 Feb 2017 13:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UJAJXjJ44NJdPbcxoZ0U2rsmWRdpVzyRint1lRZvc3E=; b=HSDmo+8FKEI5IuNxPI6c/DlZm5uyydFH1Ioq/V21Oev2JDpUtK5JniU/myFIuddtRo /C07u9H23Nx8GjP8jsNAKcVAf0USYwE7Se42A7qexhOs/aC/jzCpbJHsQcqkM1rKGqYP 9ciwuMYKtXTd91QkXkevTMxGu9u8SzgTg2WNJOGeWVQd589GJepO+klEng3lM/H+80Mm xgLwzRs98zjryu2zhz2K1zyMZccstcBGapi3/LWKHoMbGuFISZvRVf5XEyDdEwZdMbqt Cotg3opwjjEMyXBB8APzRm+0XmhCCGZK8KK36vpH7dw2Xt6o3omvpd7NajQUvVP5I3Ma dYFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=UJAJXjJ44NJdPbcxoZ0U2rsmWRdpVzyRint1lRZvc3E=; b=OpX87gPGk67gnME8HTzE4w6auoma+fERbSEbqomqcIBpDzfXcM/awY+FpLXeM75Ptt by1gsdr1WvtE4E6I9Qnz8YyH9F9/63H4AT3gJO6W4gUKuQhRezTTUpQ/EenDJ7lhBjha VXk+AtitfgfBDVj0Sz4FWvpC5wGgu8dbPUkR25qJFQ7nlf/sTB7j8aHl3huRLcL8kO1i dRvg1UVr6EPiK2dgKaZGAoPw57m05sVTNtC6m9CltFtduaN10J5eNV1y89H6RMspQe7e HRjYClpK9uINhdEsXseDfUl7npti7GXGtalvjEuk8E2tYaJ96M8B+70Y7nu7IWKNpJBv aHhA== X-Gm-Message-State: AMke39k+xTBWPnBoFBCnSadJEvJvtJpiBzOznTCLcBiNHn7HfW8kYm+jxbUxvG21MPmuaQ== X-Received: by 10.55.135.1 with SMTP id j1mr29058859qkd.107.1487712115959; Tue, 21 Feb 2017 13:21:55 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id a70sm14735281qkc.1.2017.02.21.13.21.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Feb 2017 13:21:55 -0800 (PST) Sender: Mark Johnston Date: Tue, 21 Feb 2017 13:29:06 -0800 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313850 - in head/sys/cddl/dev/dtrace: amd64 i386 Message-ID: <20170221212906.GA46447@wkstn-mjohnston.west.isilon.com> References: <201702170327.v1H3RKK4078742@repo.freebsd.org> <20170217160016.D1386@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170217160016.D1386@besplex.bde.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 21 Feb 2017 21:21:57 -0000 On Fri, Feb 17, 2017 at 05:05:54PM +1100, Bruce Evans wrote: > On Fri, 17 Feb 2017, Mark Johnston wrote: > > > Log: > > Directly include needed headers rather than relying on pollution. > > > > We get machine/cpu.h via kmem.h -> proc.h -> _vm_domain.h -> seq.h. > > machine/cpu.h is not added here. Do you mean machine/cpufnc.h? > > > Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c > > ============================================================================== > > --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Feb 17 00:50:00 2017 (r313849) > > +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Feb 17 03:27:20 2017 (r313850) > > @@ -41,7 +41,9 @@ > > #include > > #include > > #include > > +#include > > This was correct. is standard pollution in , > and it is a style bug to include it directly, and a bug to not include > after and before all other headers in kernel > .c files. > > It is pollution to include in any header except > . kmem.h has grosser pollution (param, proc, malloc, vmem, > vm/uma, vm/vm, vm/vm_extern, but not systm which is a prerequisite for > most of the other headers that kmem.h includes). Most of the other headers > also have gross pollution, ending with seq.h which includes systm.h and > its standard pollution. > > seq.h also includes machine/cpu.h. Apparently kmem.h does depend on this, > and this commit doesn't fix it. This commit was intended to address an issue with r313841, which added a "KASSERT((read_rflags() & PSL_I) == 0, ...);" to dtrace_subr.c. That change fails to compile when ported to a kernel that predates seq.h; it's only because we include kmem.h and thus seq.h that r313841 compiles on HEAD - kmem.h itself doesn't depend on cpufunc.h as far as I know. > > > #include > > +#include > > This include is not mentioned in the log message. > > machine/psl.h is stamdard pollution in machine/cpu.h (on at least amd64 and > i386), so would not be needed here if machine/cpu.h had been spelled > correctly. Sorry, my commit log message wasn't very good. psl.h is needed for the definition of PSL_I. I take it then that the diff below is the correct fix, since sys/systm.h isn't sufficient. diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c index 717f4557a64d..e180f4d0a57c 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c @@ -41,9 +41,8 @@ #include #include #include -#include +#include #include -#include #include extern void dtrace_getnanotime(struct timespec *tsp); diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c index 3801c1ba772c..c266f27bbd52 100644 --- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c @@ -42,9 +42,8 @@ #include #include #include -#include +#include #include -#include #include extern uintptr_t kernelbase;