summaryrefslogtreecommitdiff
path: root/integrationtests/misc_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-06 09:00:22 +0300
committerPaul Buetow <paul@buetow.org>2026-06-06 09:00:22 +0300
commit1b4202ac84acd129e274112a8293b4b319af9eb0 (patch)
treeb6359e79b1fc7200fe10c6fe4b1af19e02ed4b70 /integrationtests/misc_test.go
parent6ac9fa4e62c6aa37a57835c390f69fe17e04a8d0 (diff)
fix(classify): assign vmsplice to FamilyNetwork, not Misc
vmsplice(int fd, const struct iovec*, unsigned long nr_segs, unsigned int flags) is the iovec<->pipe variant of splice(2) and belongs to the same fd byte-mover cohort as its direct siblings splice/tee (and sendfile64/ copy_file_range). Its KIND (KindFd@arg0) and RET (TransferClassified, byte count) already matched splice/tee — only the family was wrong. Root cause: vmsplice was absent from the syscallFamilies map in internal/generate/family.go; its name matches no fsNameMarkers and it is not in fsSyscalls, so ClassifySyscallFamily fell through to FamilyMisc. This is the same documented Misc-fall-through anti-pattern already fixed for alarm/adjtimex/fanotify_init/fanotify_mark/file_getattr/file_setattr. The established mj0 decision placed splice/tee in Network, so the minimal sibling-consistent fix is vmsplice -> Network. Added "vmsplice": FamilyNetwork next to splice/tee with an explanatory comment, then re-ran `mage generate`. The regen is minimal and idempotent: only the two vmsplice trace IDs flip Misc->Network in generated_types.go and the vmsplice entry flips Misc->Network in generated_tracepoints.go; no TraceId renumbering and no other syscalls change. The generated C tracepoints are unaffected (family is a Go-side tag). Also moved vmsplice from the Misc list to the Network list in docs/syscall-tracing-plan.md (hand-maintained, docs-drift-validated), and corrected the misc_test.go comments which described vmsplice as a Misc syscall — it is still issued by the misc-basic workload and traced by name, but its transfer/byte-count coverage lives in retbytes_test.go alongside splice/tee. No vmsplice family assertion existed in the integration suite, so no coverage was relocated, only comments corrected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'integrationtests/misc_test.go')
-rw-r--r--integrationtests/misc_test.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/integrationtests/misc_test.go b/integrationtests/misc_test.go
index 4f171bb..925f292 100644
--- a/integrationtests/misc_test.go
+++ b/integrationtests/misc_test.go
@@ -7,20 +7,24 @@ import "testing"
// Note: the tracer names the uname tracepoint after the underlying kernel
// syscall sys_newuname, i.e. "newuname" (not "uname"). vmsplice and alarm are
// issued too, but the must-haves below are the three pure-read calls whose
-// tracepoints are guaranteed to fire deterministically. (alarm is classified
-// FamilyTime, not Misc — it shares setitimer's ITIMER_REAL timer — but the
-// misc-basic scenario still issues alarm(0) as a harmless cancel, and the
-// -trace-syscalls filter is by syscall name, so it is captured regardless.)
+// tracepoints are guaranteed to fire deterministically. Neither vmsplice nor
+// alarm is a Misc-family syscall: vmsplice is FamilyNetwork — the iovec<->pipe
+// variant of splice(2), sibling to splice/tee whose transfer coverage lives in
+// retbytes_test.go — and alarm is FamilyTime (it shares setitimer's ITIMER_REAL
+// timer). The misc-basic scenario still issues both as harmless side-effect-free
+// calls, and the -trace-syscalls filter is by syscall name, so they are captured
+// regardless of family.
var miscTraceArgs = []string{
"-trace-syscalls",
"getcpu,newuname,sysinfo,vmsplice,alarm",
}
// TestMiscBasic verifies the Misc syscall family is traced end-to-end. The
-// misc-basic workload issues getcpu, uname (sys_newuname), sysinfo, vmsplice
-// (into a self-drained pipe), and alarm(0) — all unprivileged, non-blocking,
-// and free of global side effects. Each required syscall must appear as an
-// enter event attributed to the ioworkload process.
+// misc-basic workload issues getcpu, uname (sys_newuname), and sysinfo (the
+// three Misc-family must-haves asserted below), plus vmsplice (FamilyNetwork,
+// into a self-drained pipe) and alarm(0) (FamilyTime) — all unprivileged,
+// non-blocking, and free of global side effects. Each required syscall must
+// appear as an enter event attributed to the ioworkload process.
func TestMiscBasic(t *testing.T) {
h := newTestHarness(t)
result, pid, err := h.RunWithIorArgs("misc-basic", defaultDuration, miscTraceArgs)