[PATCH 2/3] perf test: fix sys_enter_openat event test for musl

From: Martin Kaiser

Date: Mon Apr 27 2026 - 05:38:25 EST


The "syscalls:sys_enter_openat event fields" test calls

openat(AT_FDCWD, "/etc/passwd", O_RDONLY | O_DIRECTORY)

and verifies that the flags of the captured event are matching.
This fails for musl, where the openat syscall wrapper always adds
O_LARGEFILE.

Update the check to allow for additional flags. Fail the test only if one
of our flags is missing.

Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
---
tools/perf/tests/openat-syscall-tp-fields.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c
index 2a139d2781a8..366b3bf39def 100644
--- a/tools/perf/tests/openat-syscall-tp-fields.c
+++ b/tools/perf/tests/openat-syscall-tp-fields.c
@@ -120,7 +120,8 @@ static int test__syscall_openat_tp_fields(struct test_suite *test __maybe_unused

tp_flags = evsel__intval(evsel, &sample, "flags");
perf_sample__exit(&sample);
- if (flags != tp_flags) {
+ /* C library wrapper may set additional flags */
+ if ((tp_flags & flags) != flags) {
pr_debug("%s: Expected flags=%#x, got %#x\n",
__func__, flags, tp_flags);
goto out_delete_evlist;
--
2.43.7