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 0887543C1E; Wed, 28 Feb 2024 12:45:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E882240ED3; Wed, 28 Feb 2024 12:45:20 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 9018F40ECF for ; Wed, 28 Feb 2024 12:45:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709120719; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aizvenxoc9N0PSfv38YJT4cyS8j64X5lzjZ3hX9s2Sw=; b=JDoRvFVjVO/XMtm7DcJ15rN3jRa9Hn4swxG99EixzDwwAyibM8gh+iXZApE84OZuXDLEZK MYWXABvf25DzeGd97wnl/9a4RpiJ7KUTFjhiyYtyPd8WTkXHWRqvdS7rxloo7Eqy5RKYW0 yl4MSzn+20PK1el0vOARe0BNCuKhD1U= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-298-P6dR54lnP7e_wJs4dGTl0A-1; Wed, 28 Feb 2024 06:45:17 -0500 X-MC-Unique: P6dR54lnP7e_wJs4dGTl0A-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-512b0c46e34so4860262e87.0 for ; Wed, 28 Feb 2024 03:45:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709120716; x=1709725516; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aizvenxoc9N0PSfv38YJT4cyS8j64X5lzjZ3hX9s2Sw=; b=Ew/Jngk5oDTA1/ZKXiYBl7CD2NwaqNAQlF3qb+ScC9wiXvpjBHscfeblaaosmNGYj1 l65FUSZNXBMrmFVoZA2qL1qQj1ZxD+Kqh7x4gviERFp4PA8ziJNF4U8KOz7G82WEmRaF 6ev+wjNDqYm7705oPLQ76eL8/vKT+I+g2kzE8hp9A3iBK9dszuMKMOksZPfDcJyMZpMt QgRl4sCpGDFN0g16q8ZoBe1LNpbBDiZgSXSMOtMk2o9/9Migm/hV2b/dWgerSl9QcXzM p+OTjsT0GMLQTL3T+XTPU1ryX620UMeWuXB7eaKiiQx8GyyDqYTfEX7C3ar5UWWXHKJm 6rWQ== X-Forwarded-Encrypted: i=1; AJvYcCV1M6bAnN05wFO0797ee/9+u6FnWnCOueWUBMQoWI5iVLLeU8+/4bWq1FyAfPQBKbYoGPlLUDoeb94Abnw= X-Gm-Message-State: AOJu0Yz9166ex7p5jWIP/JkASJbYPy1d37xnTeDyP82ojKbzG9zgRYAg M8NWINQyVNgg7UjURwyQ/55UML3YEMZfxaFfVrjcimSmH4xISeqQFLsN0daRuw5Qd5amCbOdfMB d+OpYJpwn4DTZIXdppaRoC3c9sMJA0qxRSy9StxI3c1o0xZyXfCPd/Q0hjzqrbjqf+yQcYGX2hV utPxd+SSzKDM8ts5k= X-Received: by 2002:a19:2d5c:0:b0:513:1f3f:3fef with SMTP id t28-20020a192d5c000000b005131f3f3fefmr187445lft.1.1709120716207; Wed, 28 Feb 2024 03:45:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEH0yEObyM/Sj02ykp3fpS/QFNWAH3c0IIMGIHm0WWuZnfJ0d63lwZv7WJDXXLaef64IGoP16RO+CG8IInNYTU= X-Received: by 2002:a19:2d5c:0:b0:513:1f3f:3fef with SMTP id t28-20020a192d5c000000b005131f3f3fefmr187414lft.1.1709120715875; Wed, 28 Feb 2024 03:45:15 -0800 (PST) MIME-Version: 1.0 References: <1707774557-16012-1-git-send-email-roretzla@linux.microsoft.com> <1708978786-6740-1-git-send-email-roretzla@linux.microsoft.com> <20240226125436.046684e7@hermes.local> <20240227181446.GA18561@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20240227181446.GA18561@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: David Marchand Date: Wed, 28 Feb 2024 12:45:04 +0100 Message-ID: Subject: Re: [PATCH v3 00/16] stop using variadic argument pack extension To: Tyler Retzlaff Cc: Stephen Hemminger , dev@dpdk.org, Anatoly Burakov , Ashish Gupta , Chenbo Xia , Cristian Dumitrescu , David Hunt , Fan Zhang , Hemant Agrawal , Honnappa Nagarahalli , Jasvinder Singh , Jerin Jacob , Konstantin Ananyev , Maxime Coquelin , Reshma Pattan , Sachin Saxena , Sivaprasad Tummala , Srikanth Yalavarthi , Sunil Kumar Kori , bruce.richardson@intel.com, mb@smartsharesystems.com, thomas@monjalon.net X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Tue, Feb 27, 2024 at 7:15=E2=80=AFPM Tyler Retzlaff wrote: > > On Mon, Feb 26, 2024 at 12:54:36PM -0800, Stephen Hemminger wrote: > > On Mon, 26 Feb 2024 12:19:30 -0800 > > Tyler Retzlaff wrote: > > > > > RTE_LOG_LINE cannot be augmented with a prefix format and arguments > > > without the user of RTE_LOG_LINE using the args... and ## args compil= er > > > extension to conditionally remove trailing comma when the macro recei= ves > > > only a single argument. > > > > > > Provide a new/similar macro RTE_LOG_LINE_PREFIX that accepts the pref= ix > > > format and arguments as separate parameters allowing them to be expan= ded > > > at the correct locations inside of RTE_FMT() allowing the rest of the > > > non-prefix format string and arguments to be collapsed to the argumen= t > > > pack which can be directly forwarded with __VA_ARGS__ avoiding the ne= ed > > > for conditional comma removal. > > > > > > I've done my best to manually check expansions (preprocessed) and com= piled > > > printf of the logs to validate correct output. > > > > > > note: due to drastic change in series i have not carried any series a= cks > > > forward. > > > > The changes look good, you might want to add release note, update codin= g > > style doc, and/or update checkpatch to discourage re-introduction. > > re-introduction should be protected by the CI. i know checkpatch would > be better but i couldn't think of a good way to match an arbitrarily > named pack ... reliably where it could potentially cause noise. What about a simple: + # forbid use of variadic argument pack extension in macros + awk -v FOLDERS=3D"lib drivers app examples" \ + -v EXPRESSIONS=3D'#[[:space:]]*define.*[^(,[:space:]]\\.\\.\\.[[:space:]]*)' \ + -v RET_ON_FAIL=3D1 \ + -v MESSAGE=3D'Do not use variadic argument pack in macros' = \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk = \ + "$1" || res=3D1 + --=20 David Marchand