From bd544509846fb7e1882aa466d24aea937c2b2804 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 1 Jun 2026 23:13:11 +0300 Subject: =?UTF-8?q?fix(classify):=20mq=5Ftimedsend=20returns=20status,=20n?= =?UTF-8?q?ot=20bytes=20=E2=80=94=20make=20ret=20UNCLASSIFIED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mq_timedsend(2)/mq_send(3) return 0 on success or -1 on error; the payload size msg_len is an INPUT argument, never the return value. It was wrongly listed in retClassifications as WriteClassified, which made bytesFromRet attribute its 0 return as "bytes written" (the stats engine WriteClassified path). Remove it so its return stays UNCLASSIFIED, consistent with its POSIX mq sibling mq_timedreceive (which legitimately stays ReadClassified because it returns the received byte count). This is the exact same defect just fixed for SysV msgsnd (5057bd9) and mirrors the msgrcv/msgsnd asymmetry. Regenerated tracepoints/docs accordingly and updated the pre-existing classify unit test and the TestPosixMqBasic integration assertion: the mq_timedsend send no longer asserts a write byte count (now expects 0), while mq_timedreceive keeps its received-byte-count assertion. Verified: mage generate idempotent, mage build OK, internal/generate tests pass. TestPosixMqBasic skips in this sandbox (mq_open: permission denied) but compiles with the corrected assertions. Co-Authored-By: Claude Opus 4.8 --- integrationtests/ipc_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'integrationtests') diff --git a/integrationtests/ipc_test.go b/integrationtests/ipc_test.go index 5672bbe..9c1efcc 100644 --- a/integrationtests/ipc_test.go +++ b/integrationtests/ipc_test.go @@ -113,7 +113,10 @@ func TestPosixMqBasic(t *testing.T) { sendExp := ExpectedEvent{Tracepoint: "enter_mq_timedsend", Comm: "ioworkload", PathContains: "/ior-mq-"} recvExp := ExpectedEvent{Tracepoint: "enter_mq_timedreceive", Comm: "ioworkload", PathContains: "/ior-mq-"} - assertEventBytesAtLeast(t, result, sendExp, mqPayloadLen) + // mq_timedsend returns 0 on success (a status, not a byte count), so it is + // UNCLASSIFIED and must NOT be attributed any write bytes. Only + // mq_timedreceive returns a real received byte count (ReadClassified). + assertEventBytesEqual(t, result, sendExp, 0) assertEventBytesAtLeast(t, result, recvExp, mqPayloadLen) assertEventDurationPositive(t, result, sendExp) assertEventDurationPositive(t, result, recvExp) -- cgit v1.2.3