public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/4] selftests/bpf: impose global ordering for test decl_tags
@ 2026-03-31  0:59 Eduard Zingerman
  2026-03-31  0:59 ` [PATCH bpf-next v2 1/4] selftests/bpf: fix __jited_unpriv tag name Eduard Zingerman
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Eduard Zingerman @ 2026-03-31  0:59 UTC (permalink / raw)
  To: bpf, ast
  Cc: andrii, daniel, martin.lau, kernel-team, yonghong.song,
	Eduard Zingerman

Impose global ordering for all decl tags used by test_loader.c based
tests: __success, __failure, __msg, etc. The tags are now sorted by
testing framework to be processed in the same order they appear in the
C source code of the test.

The ordering is necessary for gcc-bpf. Neither GCC nor the C standard
defines the order in which function attributes are consumed.
While Clang tends to preserve tags definition order in the output BTF,
GCC does not. This inconsistency causes BPF tests with multiple __msg
entries to fail when compiled with GCC.

This is based on a patch [1] from Cupertino Miranda (see patch #3) and
includes some additional cleanups for test_loader.c decl tags
declaration and processing (see patches #1, #2, #4).

[1] https://lore.kernel.org/bpf/20260305130035.192080-1-cupertino.miranda@oracle.com/

Changelog:
v1 -> v2:
- updated remaining str_has_pfx() usages (Puranjay)
- removed realloc_or_free() (Andrii)
- fixed qsort(NULL, ...) usage (Puranjay)
- skip_decl_tag_pfx() returns NULL if tag does not start from
  "comment:" (Puranjay)

v1: https://lore.kernel.org/bpf/20260326-selftests-global-tags-ordering-v1-0-5dd2ced5d9ad@gmail.com/
---
Eduard Zingerman (4):
      selftests/bpf: fix __jited_unpriv tag name
      selftests/bpf: make str_has_pfx return pointer past the prefix
      selftests/bpf: impose global ordering for test decl_tags
      selftests/bpf: inline TEST_TAG constants in test_loader.c

 tools/testing/selftests/bpf/progs/bpf_misc.h |  60 ++++----
 tools/testing/selftests/bpf/test_loader.c    | 202 +++++++++++++--------------
 2 files changed, 125 insertions(+), 137 deletions(-)
---
base-commit: b6b5e0ebd429d66ce37ae5af649a74ea1f041d92
change-id: 20260326-selftests-global-tags-ordering-8f324323d9c8

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-03-31 17:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31  0:59 [PATCH bpf-next v2 0/4] selftests/bpf: impose global ordering for test decl_tags Eduard Zingerman
2026-03-31  0:59 ` [PATCH bpf-next v2 1/4] selftests/bpf: fix __jited_unpriv tag name Eduard Zingerman
2026-03-31  0:59 ` [PATCH bpf-next v2 2/4] selftests/bpf: make str_has_pfx return pointer past the prefix Eduard Zingerman
2026-03-31 12:07   ` Mykyta Yatsenko
2026-03-31 17:52     ` Eduard Zingerman
2026-03-31  0:59 ` [PATCH bpf-next v2 3/4] selftests/bpf: impose global ordering for test decl_tags Eduard Zingerman
2026-03-31  2:38   ` bot+bpf-ci
2026-03-31 13:02     ` Puranjay Mohan
2026-03-31 17:52       ` Eduard Zingerman
2026-03-31  0:59 ` [PATCH bpf-next v2 4/4] selftests/bpf: inline TEST_TAG constants in test_loader.c Eduard Zingerman
2026-03-31 13:03 ` [PATCH bpf-next v2 0/4] selftests/bpf: impose global ordering for test decl_tags Puranjay Mohan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox