Message ID | 20211004101058.2396458-1-sean.morrissey@intel.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AC0CDA0C4C; Mon, 4 Oct 2021 12:11:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 416A941304; Mon, 4 Oct 2021 12:11:39 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id BAE5441300 for <dev@dpdk.org>; Mon, 4 Oct 2021 12:11:37 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="205501898" X-IronPort-AV: E=Sophos;i="5.85,345,1624345200"; d="scan'208";a="205501898" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 03:11:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,345,1624345200"; d="scan'208";a="558342005" Received: from silpixa00401215.ir.intel.com ([10.55.128.96]) by FMSMGA003.fm.intel.com with ESMTP; 04 Oct 2021 03:11:32 -0700 From: Sean Morrissey <sean.morrissey@intel.com> To: Cc: dev@dpdk.org, Sean Morrissey <sean.morrissey@intel.com> Date: Mon, 4 Oct 2021 10:10:53 +0000 Message-Id: <20211004101058.2396458-1-sean.morrissey@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v1 0/5] introduce IWYU 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> |
Series | introduce IWYU | |
Message
Sean Morrissey
Oct. 4, 2021, 10:10 a.m. UTC
This patchset introduces the include-what-you-use script which removes unused header includes. IWYU GitHub: https://github.com/include-what-you-use/include-what-you-use Along with the script there are some patches which make a start on removing unneeded headers. Sean Morrissey (5): devtools: script to remove unused headers includes lib/telemetry: remove unneeded header includes lib/ring: remove unneeded header includes lib/kvargs: remove unneeded header includes lib/eal: remove unneeded header includes devtools/process_iwyu.py | 109 +++++++++++++++++++++++++ lib/eal/common/eal_common_dev.c | 5 -- lib/eal/common/eal_common_devargs.c | 1 - lib/eal/common/eal_common_errno.c | 4 - lib/eal/common/eal_common_fbarray.c | 3 - lib/eal/common/eal_common_hexdump.c | 3 - lib/eal/common/eal_common_launch.c | 6 -- lib/eal/common/eal_common_lcore.c | 6 -- lib/eal/common/eal_common_log.c | 2 - lib/eal/common/eal_common_memalloc.c | 3 - lib/eal/common/eal_common_memory.c | 5 -- lib/eal/common/eal_common_memzone.c | 4 - lib/eal/common/eal_common_options.c | 2 - lib/eal/common/eal_common_proc.c | 2 - lib/eal/common/eal_common_string_fns.c | 2 - lib/eal/common/eal_common_tailqs.c | 11 --- lib/eal/common/eal_common_thread.c | 3 - lib/eal/common/eal_common_timer.c | 6 -- lib/eal/common/eal_common_trace.c | 1 - lib/eal/common/hotplug_mp.h | 1 - lib/eal/common/malloc_elem.c | 6 -- lib/eal/common/malloc_heap.c | 5 -- lib/eal/common/malloc_mp.c | 1 - lib/eal/common/malloc_mp.h | 2 - lib/eal/common/rte_malloc.c | 6 -- lib/eal/common/rte_random.c | 3 - lib/eal/common/rte_service.c | 6 -- lib/eal/include/rte_version.h | 2 - lib/eal/linux/eal.c | 10 --- lib/eal/linux/eal_alarm.c | 7 -- lib/eal/linux/eal_cpuflags.c | 2 - lib/eal/linux/eal_debug.c | 5 -- lib/eal/linux/eal_dev.c | 4 - lib/eal/linux/eal_hugepage_info.c | 8 -- lib/eal/linux/eal_interrupts.c | 8 -- lib/eal/linux/eal_lcore.c | 7 -- lib/eal/linux/eal_log.c | 11 +-- lib/eal/linux/eal_memalloc.c | 8 -- lib/eal/linux/eal_memory.c | 9 -- lib/eal/linux/eal_thread.c | 5 -- lib/eal/linux/eal_timer.c | 15 ---- lib/eal/linux/eal_vfio_mp_sync.c | 1 - lib/eal/unix/eal_file.c | 1 - lib/eal/unix/rte_thread.c | 1 - lib/eal/x86/rte_cycles.c | 1 - lib/kvargs/rte_kvargs.c | 1 - lib/ring/rte_ring.c | 7 -- lib/telemetry/telemetry.c | 1 - lib/telemetry/telemetry_data.h | 1 - 49 files changed, 110 insertions(+), 213 deletions(-) create mode 100755 devtools/process_iwyu.py
Comments
On Mon, 4 Oct 2021 10:10:53 +0000 Sean Morrissey <sean.morrissey@intel.com> wrote: > This patchset introduces the include-what-you-use script which removes > unused header includes. IWYU GitHub: > > https://github.com/include-what-you-use/include-what-you-use > > Along with the script there are some patches which make a start on > removing unneeded headers. > > Sean Morrissey (5): > devtools: script to remove unused headers includes > lib/telemetry: remove unneeded header includes > lib/ring: remove unneeded header includes > lib/kvargs: remove unneeded header includes > lib/eal: remove unneeded header includes > > devtools/process_iwyu.py | 109 +++++++++++++++++++++++++ > lib/eal/common/eal_common_dev.c | 5 -- > lib/eal/common/eal_common_devargs.c | 1 - > lib/eal/common/eal_common_errno.c | 4 - > lib/eal/common/eal_common_fbarray.c | 3 - > lib/eal/common/eal_common_hexdump.c | 3 - > lib/eal/common/eal_common_launch.c | 6 -- > lib/eal/common/eal_common_lcore.c | 6 -- > lib/eal/common/eal_common_log.c | 2 - > lib/eal/common/eal_common_memalloc.c | 3 - > lib/eal/common/eal_common_memory.c | 5 -- > lib/eal/common/eal_common_memzone.c | 4 - > lib/eal/common/eal_common_options.c | 2 - > lib/eal/common/eal_common_proc.c | 2 - > lib/eal/common/eal_common_string_fns.c | 2 - > lib/eal/common/eal_common_tailqs.c | 11 --- > lib/eal/common/eal_common_thread.c | 3 - > lib/eal/common/eal_common_timer.c | 6 -- > lib/eal/common/eal_common_trace.c | 1 - > lib/eal/common/hotplug_mp.h | 1 - > lib/eal/common/malloc_elem.c | 6 -- > lib/eal/common/malloc_heap.c | 5 -- > lib/eal/common/malloc_mp.c | 1 - > lib/eal/common/malloc_mp.h | 2 - > lib/eal/common/rte_malloc.c | 6 -- > lib/eal/common/rte_random.c | 3 - > lib/eal/common/rte_service.c | 6 -- > lib/eal/include/rte_version.h | 2 - > lib/eal/linux/eal.c | 10 --- > lib/eal/linux/eal_alarm.c | 7 -- > lib/eal/linux/eal_cpuflags.c | 2 - > lib/eal/linux/eal_debug.c | 5 -- > lib/eal/linux/eal_dev.c | 4 - > lib/eal/linux/eal_hugepage_info.c | 8 -- > lib/eal/linux/eal_interrupts.c | 8 -- > lib/eal/linux/eal_lcore.c | 7 -- > lib/eal/linux/eal_log.c | 11 +-- > lib/eal/linux/eal_memalloc.c | 8 -- > lib/eal/linux/eal_memory.c | 9 -- > lib/eal/linux/eal_thread.c | 5 -- > lib/eal/linux/eal_timer.c | 15 ---- > lib/eal/linux/eal_vfio_mp_sync.c | 1 - > lib/eal/unix/eal_file.c | 1 - > lib/eal/unix/rte_thread.c | 1 - > lib/eal/x86/rte_cycles.c | 1 - > lib/kvargs/rte_kvargs.c | 1 - > lib/ring/rte_ring.c | 7 -- > lib/telemetry/telemetry.c | 1 - > lib/telemetry/telemetry_data.h | 1 - > 49 files changed, 110 insertions(+), 213 deletions(-) > create mode 100755 devtools/process_iwyu.py > There is a risk of breaking builds on other platforms. How can you be sure the include files (especially auto generated list) are the same in Linux, FreeBSD and Windows as well as the special versions of libc (musl etc).
On Mon, Oct 04, 2021 at 08:55:35AM -0700, Stephen Hemminger wrote: > On Mon, 4 Oct 2021 10:10:53 +0000 > Sean Morrissey <sean.morrissey@intel.com> wrote: > > > This patchset introduces the include-what-you-use script which removes > > unused header includes. IWYU GitHub: > > > > https://github.com/include-what-you-use/include-what-you-use > > > > Along with the script there are some patches which make a start on > > removing unneeded headers. > > > > Sean Morrissey (5): > > devtools: script to remove unused headers includes > > lib/telemetry: remove unneeded header includes > > lib/ring: remove unneeded header includes > > lib/kvargs: remove unneeded header includes > > lib/eal: remove unneeded header includes > > > > devtools/process_iwyu.py | 109 +++++++++++++++++++++++++ <snip> > > 49 files changed, 110 insertions(+), 213 deletions(-) > > create mode 100755 devtools/process_iwyu.py > > > > There is a risk of breaking builds on other platforms. > How can you be sure the include files (especially auto generated list) > are the same in Linux, FreeBSD and Windows as well as the special > versions of libc (musl etc). Yep, there is a risk of that but: a) that's why we have automated build checks of various types in test-meson-builds and why we have automated testing of patches in a number of different labs reported out in patchwork. b) if we say we can't risk it, we then can't gain much/any real benefit from tools like iwyu - a tool that you have encouraged use of a number of times :-). Overall, I think this is a good thing for DPDK, and I encouraged Sean to look into it, because it just helps with code quality in DPDK. However, it's also true that there is risk in this, so I think the approach of only doing a few libraries initially - so we can see how it works out - is probably best, rather than trying to do the whole codebase in one go. I think it's also true to say that the risk is greatest with EAL, so if it can be cleaned up, cleaning the other libs and maybe then drivers should be easier. Having the whole processing automated will also help with this, as - if we want to minimize risk - the work on each driver can be done by the driver maintainers themselves, who are best placed to know the platform-specific issues for that code. Regards, /Bruce