History

perf test: Fix sys_enter_openat event test for musl

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.

Martin Kaiser committed 6 months ago

Commit 9a4a67d1 parent a4cbd511 file · +4 −1Browse files

Unified · Split

tools/perf/tests/openat-syscall-tp-fields.c+4−1
@@ -120,7 +120,10 @@ static int test__syscall_openat_tp_fields(struct test_suite *test __maybe_unused · 119 unmodified lines
120120
121121 tp_flags = evsel__intval(evsel, &sample, "flags");
122122 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) {
124127 pr_debug("%s: Expected flags=%#x, got %#x\n",
125128 __func__, flags, tp_flags);
126129 goto out_delete_evlist;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t