From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 7306BA09E4;
	Thu, 21 Jan 2021 16:16:09 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 98EA7140DA1;
	Thu, 21 Jan 2021 16:16:04 +0100 (CET)
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by mails.dpdk.org (Postfix) with ESMTP id 62E14140D01
 for <dev@dpdk.org>; Thu, 21 Jan 2021 16:16:02 +0100 (CET)
IronPort-SDR: uSiTwleSQAaGkocKOi88o2ikSR/Jzc7Q35+v6Tpgiv76LSTEfrgPXc7H/KqudXa/w80h33ME43
 t08WIyLKwW5A==
X-IronPort-AV: E=McAfee;i="6000,8403,9870"; a="159062129"
X-IronPort-AV: E=Sophos;i="5.79,364,1602572400"; d="scan'208";a="159062129"
Received: from fmsmga008.fm.intel.com ([10.253.24.58])
 by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 21 Jan 2021 07:16:00 -0800
IronPort-SDR: 4cd7yhIp4MtL+rM1kaHebGOAMfglZ7RRxZj8I0Ynn0X6wWLew/VcQP2klW4uSAtrTJyDuJEvx8
 RMIogZKaQuFw==
X-IronPort-AV: E=Sophos;i="5.79,364,1602572400"; d="scan'208";a="356502877"
Received: from bricha3-mobl.ger.corp.intel.com ([10.252.19.120])
 by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA;
 21 Jan 2021 07:15:47 -0800
Date: Thu, 21 Jan 2021 15:15:37 +0000
From: Bruce Richardson <bruce.richardson@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: David Marchand <david.marchand@redhat.com>, dev <dev@dpdk.org>
Message-ID: <20210121151537.GC258@bricha3-MOBL.ger.corp.intel.com>
References: <20210114110606.21142-1-bruce.richardson@intel.com>
 <CAJFAV8xGhj02WdCboQDd7rJf7x=AL_MU_K4ZE6aFA+ikXVZkuw@mail.gmail.com>
 <20210121093352.GA258@bricha3-MOBL.ger.corp.intel.com>
 <4726085.tz9yOLTjxq@thomas>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4726085.tz9yOLTjxq@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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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.

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 <args> 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!

Regards,
/Bruce