diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-06 09:05:36 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-06 09:05:36 +0300 |
| commit | 33dfe4ee3cf948444571554aa35508605fee0474 (patch) | |
| tree | 90e462bb697e55814b644e61d55d10ef155571af /integrationtests | |
| parent | 1b4202ac84acd129e274112a8293b4b319af9eb0 (diff) | |
test(retbytes): assert getdents64 READ_CLASSIFIED byte count end-to-end
getdents64 was listed in retbytesTraceArgs but the retbytes workload
never issued it and TestRetbytesPhaseA never asserted its exit byte
count, leaving the READ_CLASSIFIED ctx->ret path for getdents/getdents64
unverified end-to-end (unlike sibling read/recvfrom/getxattrat).
Add retbytesGetdents to the phase-A workload: it populates a temp
directory with several files, opens it O_DIRECTORY, and re-issues
getdents64 in a short window (lseek-rewind each iteration) so ior can
attach and capture an enter/exit pair under parallel load. A non-empty
directory guarantees ctx->ret > 0.
Assert enter_getdents64 presence (MinCount) plus bytes>=1 via
assertEventBytesAtLeast and a positive duration, mirroring the existing
READ-classified siblings. Bytes>=1 (not an exact payload length) because
dirent size varies with filename length and alignment.
Coverage hardening only; classify.go getdents/getdents64=ReadClassified
is correct.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'integrationtests')
| -rw-r--r-- | integrationtests/retbytes_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/integrationtests/retbytes_test.go b/integrationtests/retbytes_test.go index 4baed9e..37eb45b 100644 --- a/integrationtests/retbytes_test.go +++ b/integrationtests/retbytes_test.go @@ -19,6 +19,7 @@ func TestRetbytesPhaseA(t *testing.T) { {Tracepoint: "enter_tee", Comm: "ioworkload", MinCount: 1}, {Tracepoint: "enter_process_vm_writev", Comm: "ioworkload", MinCount: 1}, {Tracepoint: "enter_process_vm_readv", Comm: "ioworkload", MinCount: 1}, + {Tracepoint: "enter_getdents64", Comm: "ioworkload", MinCount: 1}, }, retbytesTraceArgs) for _, tracepoint := range []string{ @@ -42,4 +43,12 @@ func TestRetbytesPhaseA(t *testing.T) { assertEventBytesEqual(t, result, exp, 0) assertEventDurationPositive(t, result, exp) } + + // getdents64 is READ_CLASSIFIED: a successful call on a non-empty directory + // fills the dirent buffer and reports ctx->ret > 0. Dirent size varies with + // filename length and alignment, so assert a conservative bytes>=1 minimum + // rather than an exact payload length. + getdentsExp := ExpectedEvent{Tracepoint: "enter_getdents64", Comm: "ioworkload"} + assertEventBytesAtLeast(t, result, getdentsExp, 1) + assertEventDurationPositive(t, result, getdentsExp) } |
