From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79B4AA0A0A; Fri, 22 Jan 2021 11:44:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EB61140F42; Fri, 22 Jan 2021 11:44:49 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 6CB48140F41 for ; Fri, 22 Jan 2021 11:44:47 +0100 (CET) IronPort-SDR: aaLh0FxR9ljMgClK6fiEZsIzr2jwmeMUZN5Bc54ZU/E440L6N/QieJD78fnMdkkuLKZgX6BBCl CV/v56hOvcFw== X-IronPort-AV: E=McAfee;i="6000,8403,9871"; a="179511296" X-IronPort-AV: E=Sophos;i="5.79,366,1602572400"; d="scan'208";a="179511296" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 02:44:46 -0800 IronPort-SDR: +lehKrK55FlAKGeztoNs/ZgMZqlhx0p6oLueB0SAsBVmubmIciyRHPZtNoASRiynp/UP9ahymR QEANBYo2bq6g== X-IronPort-AV: E=Sophos;i="5.79,366,1602572400"; d="scan'208";a="385714472" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.20.13]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 22 Jan 2021 02:44:45 -0800 Date: Fri, 22 Jan 2021 10:44:42 +0000 From: Bruce Richardson To: Thomas Monjalon Cc: David Marchand , dev Message-ID: <20210122104442.GA1579@bricha3-MOBL.ger.corp.intel.com> References: <20210114110606.21142-1-bruce.richardson@intel.com> <4726085.tz9yOLTjxq@thomas> <20210121151537.GC258@bricha3-MOBL.ger.corp.intel.com> <5714838.ECoWWY6ARZ@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5714838.ECoWWY6ARZ@thomas> Subject: Re: [dpdk-dev] [PATCH v2 00/19] ensure headers have correct includes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jan 22, 2021 at 12:20:55AM +0100, Thomas Monjalon wrote: > 21/01/2021 16:15, Bruce Richardson: > > On Thu, Jan 21, 2021 at 10:36:18AM +0100, Thomas Monjalon wrote: > > > 21/01/2021 10:33, Bruce Richardson: > > > > On Thu, Jan 21, 2021 at 10:25:07AM +0100, David Marchand wrote: > > > > > Is rte_byteorder.h inclusion in rte_mbuf.h still necessary? > > > > > > > > > Good question. The checks I was doing were only for missing headers. > > > > Checking for superfluous headers is more complicated and not something I've > > > > looked at. I know it was previously suggested to use the > > > > "include-what-you-use" tool on DPDK, if anyone wants to attempt that. > > > > > > I would love having an integration of include-what-you-use in our build system. > > > I don't know whether it's trivial or difficult with meson. > > > > > > > Did some initial investigation here, and here are some basic instructions > > based on how I got it running on my Ubuntu 20.10 system. The positive is > > that "iwyu_tool" can run on DPDK build dirs without any extra work on our > > part. > > I had looked at it recently but didn't try thinking meson was not compatible. > Thank you, it works :) > > > 1. Install iwyu from Ubuntu packaging. > > 2. Install clang-9 package: > > * This is not a dependency of iwyu, but probably should be > > * The version of clang installed *must* match that used to build iwyu > > [I had clang-10 installed which didn't work for this] > > * If you get errors about missing standard headers e.g. stddef.h, > > the version mismatch is likely the issue. > > 3. Configure a clang build of DPDK: > > * CC=clang meson build-clang > > 4. "iwyu_tool" supports the build database format used by meson, so just > > run: "iwyu_tool -p build-clang" > > > > Be warned, this runs really slowly and produces lots of output! > > We need to filter only reports of useless includes > and do the cleaning... > > The difficult part is that some includes may be useless on Linux > but required on FreeBSD. > And that some "useless" includes in headers are required by the corresponding C file which then needs the include added there. :-( However, thinking a bit more after sending that email yesterday and looking at the results, I came to the same conclusion as you - we should use it to primarily remove unused headers. That will be slowed down by the need for additional fixup, but it's doable if someone has a bit of time. /Bruce