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 2351CA0A02; Thu, 14 Jan 2021 13:17:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F26AF1411F1; Thu, 14 Jan 2021 13:17:14 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 66A4A1411F0 for ; Thu, 14 Jan 2021 13:17:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610626632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fAzDMyOMQA0NySeie/LJmagzAnY7/8C5kKYSLMdg2I4=; b=N7Sof1QfpPEy+nbMWnQae4lq6FsPi4DIfN2HiYmfXoRgDJl1gkjdFbubEcoRqselvaS8aI 835PAdKkJF/vYICXLw9PuVAYMiLbGksn7lPt6P8R2IwU6f36RqFZMqUJahYh6f3j0aTl+l Uc3hSjAUFbjoZEmss5YvvSqL5FzqC40= Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-457-jwaXU4_oMIiOQgJbebteZg-1; Thu, 14 Jan 2021 07:17:10 -0500 X-MC-Unique: jwaXU4_oMIiOQgJbebteZg-1 Received: by mail-vk1-f199.google.com with SMTP id i2so2264630vka.6 for ; Thu, 14 Jan 2021 04:17:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fAzDMyOMQA0NySeie/LJmagzAnY7/8C5kKYSLMdg2I4=; b=bcrTnUS9qOxR2MRQZfqh5RTtXCks85T0DMR6snm+DkGvyW5bhgkE8yffRxM6lOFtIJ J/MXbe430pY+gLRlSlN8hLpkFOaiEFB3ZKRPTUZc3WlgV8628vXIKVIPDBhucSte7zoy A06RYLntY6/cefCNo9BRkxKNrnkArFfuHnpYJOkmjdGUnRZscu9I+eVQBpxijc+7AuCY JSM6aPzTUv73lcA/sIiragTmYXK51yj0PLRBH+wfb4LiRwww74eyRk9BJcLWyMGPtLxM +0X/BGZJy+kZYihVzSAojlQV8jNxvG9cyy+YJd2MluG/zKQvH3VkrgTm4rEnoccIP5T7 7xUQ== X-Gm-Message-State: AOAM530liynjR94lAkVaIN0aO55Uo3hjkEGJPG6IepW2Jk1dw1zrDtbV AlSF4raF1cA7x+KRF+yJv6au0dAbDuk6s35QhQm1Oh7zMPpOS1oL0eXzWcVJCEEUrAoXAmGNPut VJIRfQZFhBx7Ex6AVkXg= X-Received: by 2002:a67:3093:: with SMTP id w141mr1049179vsw.27.1610626629530; Thu, 14 Jan 2021 04:17:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyffocIiJxwkaCitMvNdDPUahrDkv4qTqgCeg10IdyzM8vRr+LjPdHX/6czjEBYpT4bXPJSWD6tSBQXFlULQ3I= X-Received: by 2002:a67:3093:: with SMTP id w141mr1049168vsw.27.1610626629342; Thu, 14 Jan 2021 04:17:09 -0800 (PST) MIME-Version: 1.0 References: <20210114110606.21142-1-bruce.richardson@intel.com> <20210114110606.21142-18-bruce.richardson@intel.com> In-Reply-To: <20210114110606.21142-18-bruce.richardson@intel.com> From: David Marchand Date: Thu, 14 Jan 2021 13:16:58 +0100 Message-ID: To: Bruce Richardson Cc: dev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 17/20] app/chkincs: add chkincs app to verify headers 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 Thu, Jan 14, 2021 at 12:09 PM Bruce Richardson wrote: > > To verify that all DPDK headers are ok for inclusion directly in a C > file, and are not missing any other pre-requisite headers, we can > auto-generate for each header an empty C file that includes that header. > Compiling these files will throw errors if any header has unmet > dependencies. Some drivers expose APIs to applications, their headers would need checks too. > > Signed-off-by: Bruce Richardson > --- > app/chkincs/gen_c_file_for_header.py | 49 ++++++++++++++++++++++++++++ > app/chkincs/main.c | 4 +++ > app/chkincs/meson.build | 28 ++++++++++++++++ > app/meson.build | 1 + > lib/meson.build | 1 + > meson.build | 1 + > meson_options.txt | 2 ++ > 7 files changed, 86 insertions(+) > create mode 100755 app/chkincs/gen_c_file_for_header.py > create mode 100644 app/chkincs/main.c > create mode 100644 app/chkincs/meson.build > > diff --git a/app/chkincs/gen_c_file_for_header.py b/app/chkincs/gen_c_file_for_header.py > new file mode 100755 > index 0000000000..f92f2b412c > --- /dev/null > +++ b/app/chkincs/gen_c_file_for_header.py > @@ -0,0 +1,49 @@ > +#! /usr/bin/env python3 > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2020 Intel Corporation 2021* > + > +from sys import argv > +from os.path import abspath > + > +empty_contents = 'static const char *empty __attribute__((unused)) = "empty";' > +# files which are not used directly, but included via others > +exceptions = [ > + 'rte_cmp_arm64.h', > + 'rte_cmp_x86.h', > + 'rte_crc_arm64.h', > + 'rte_eal_interrupts.h', > + 'rte_eth_ctrl.h', > + 'rte_ethdev_core.h', > + 'rte_ipsec_group.h', > + 'rte_lpm_altivec.h', > + 'rte_lpm_neon.h', > + 'rte_lpm_sse.h', > + 'rte_lpm_x86.h', > + 'rte_lru_arm64.h', > + 'rte_lru_x86.h', > + 'rte_regexdev_core.h', > + 'rte_ring_core.h', > + 'rte_ring_generic.h', > + 'rte_ring_hts_c11_mem.h', > + 'rte_ring_hts.h', > + 'rte_ring_peek_c11_mem.h', > + 'rte_ring_peek.h', > + 'rte_ring_peek_zc.h', > + 'rte_ring_rts_c11_mem.h', > + 'rte_ring_rts.h', > + 'rte_stack_lf_c11.h', > + 'rte_stack_lf_generic.h', > + 'rte_stack_lf.h', > + 'rte_stack_std.h', > + 'rte_table_hash_func_arm64.h', > + ] Can we instead flag those headers from the libraries themselves? In addition of the headers current variable, something like a internal_headers or private_headers variable? > + > +(h_file, c_file) = argv[1:] > + > +contents = '#include "' + abspath(h_file) + '"' > +for ex in exceptions: > + if h_file.endswith(ex): > + contents = empty_contents > + > +with open(c_file, 'w') as cf: > + cf.write(contents) -- David Marchand