All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Cupertino Miranda <cupertino.miranda@oracle.com>, bpf@vger.kernel.org
Cc: David Faust <david.faust@oracle.com>,
	Jose Marchesi <jose.marchesi@oracle.com>,
	Elena Zannoni <elena.zannoni@oracle.com>
Subject: Re: [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests
Date: Wed, 18 Mar 2026 16:07:32 -0700	[thread overview]
Message-ID: <b073da2be883cf8f22a9a4c5f2dfa112d75d68f9.camel@gmail.com> (raw)
In-Reply-To: <20260305130035.192080-1-cupertino.miranda@oracle.com>

On Thu, 2026-03-05 at 13:00 +0000, Cupertino Miranda wrote:
> Ensure that __msg macros, and similars, used for BPF test validation are
> processed in the order they are defined in the source code.
> 
> Neither GCC nor the C standard defines the order in which function
> attributes are consumed. While Clang tends to preserve definition order,
> GCC may process them out of sequence. This inconsistency causes BPF
> tests with multiple __msg entries to fail when compiled with GCC.
> 
> This patch fixes the test runner to explicitly sort or process these
> attributes to guarantee predictable matching behavior across different
> compilers.
> 
> Signed-off-by: Cupertino Miranda <cupertino.miranda@oracle.com>
> Cc: David Faust  <david.faust@oracle.com>
> Cc: Jose Marchesi  <jose.marchesi@oracle.com>
> Cc: Elena Zannoni  <elena.zannoni@oracle.com>
> ---

Looks like this patch fell through the cracks.

It looks a bit intrusive, given the amount of places index has to be
passed through. An alternative would be to modify parse_test_spec()
such that it collects decl tag ids into the array first and then sorts
the array. It will have to use strverscmp() for comparator, though.
This way all the changes would be localized to a single function
collecting the array.

Up to you if that is worth the hassle.

Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>

[...]

  parent reply	other threads:[~2026-03-18 23:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 13:00 [PATCH] selftests/bpf: Enforce definition order for __msg macros in BPF tests Cupertino Miranda
2026-03-06  1:22 ` Kumar Kartikeya Dwivedi
2026-03-11 18:19 ` Yonghong Song
2026-03-18 23:07 ` Eduard Zingerman [this message]
2026-03-19 13:45   ` Cupertino Miranda
2026-03-19 13:47     ` Cupertino Miranda
2026-03-20  5:27     ` Eduard Zingerman
2026-03-23 13:02       ` Cupertino Miranda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b073da2be883cf8f22a9a4c5f2dfa112d75d68f9.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=cupertino.miranda@oracle.com \
    --cc=david.faust@oracle.com \
    --cc=elena.zannoni@oracle.com \
    --cc=jose.marchesi@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.