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, the access mode flags must be unchanged.
Unified · Split
| @@ -120,7 +120,10 @@ static int test__syscall_openat_tp_fields(struct test_suite *test __maybe_unused · 119 unmodified lines | ||
| 120 | 120 | |
| 121 | 121 | tp_flags = evsel__intval(evsel, &sample, "flags"); |
| 122 | 122 | perf_sample__exit(&sample); |
| 123 | − if (flags != tp_flags) { | |
| 123 | + /* C library wrapper may set additional flags, | |
| 124 | + access mode must be unchanged */ | |
| 125 | + if ((tp_flags & O_ACCMODE) != (flags & O_ACCMODE) || | |
| 126 | + (tp_flags & flags) != flags) { | |
| 124 | 127 | pr_debug("%s: Expected flags=%#x, got %#x\n", |
| 125 | 128 | __func__, flags, tp_flags); |
| 126 | 129 | goto out_delete_evlist; |