summaryrefslogtreecommitdiff
path: root/internal/generate/family.go
AgeCommit message (Collapse)Author
12 daysfix(classify): assign vmsplice to FamilyNetwork, not MiscPaul Buetow
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>
2026-06-03fix(classify): assign file_setattr to FamilyFS, not MiscPaul Buetow
file_setattr(2) (Linux 6.13+) is the write counterpart of file_getattr: it sets a file's extended attributes (struct file_attr) given dirfd@arg0 + pathname@arg1 + attr-buffer + size + at_flags, and returns 0/-1 (not a byte count). Its name matches none of the fsNameMarkers substrings ("stat"/"xattr"/"chmod"/"chown") and it is absent from the fsSyscalls set, so it was falling through to FamilyMisc -- the same alarm/fanotify/file_getattr-style misclassification. Add it to the explicit family map for sibling consistency with file_getattr. This also completes the file_getattr regeneration: the prior fix (96de9ef) was generated with a partial target that updated generated_tracepoints.go but did not propagate file_getattr into the traceId2Family map in generated_types.go; a full `mage generate` here reconciles both file_getattr (1058/1059) and file_setattr (1056/1057) to FamilyFS. mage build, generate idempotency, and the internal/generate, /tracepoints, /types unit tests (incl. docs-drift sync) all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03fix(classify): assign file_getattr to FamilyFS, not MiscPaul Buetow
file_getattr(2) (Linux 6.13+) retrieves a file's extended attributes (struct file_attr) given a dirfd + pathname + attr buffer + size + at_flags. It is a path-based filesystem operation, the counterpart of statx and the FS_IOC_FSGETXATTR ioctl, so it belongs in FamilyFS. It was falling through to FamilyMisc because the fsNameMarkers substring list keys on "stat"/"xattr"/"chmod"/"chown" — "getattr" matches none of them — and the syscall is absent from the fsSyscalls set, the same Misc-fall-through defect previously fixed for alarm/fanotify_init/ fanotify_mark. Add an explicit "file_getattr": FamilyFS entry to the syscallFamilies map, regenerate the Go tracepoint map, and update the docs/syscall-tracing-plan.md family listing to match. KIND stays KindPathname (pathname@args[1], data-driven from the live tracepoint) and the return is 0/-1, hence UNCLASSIFIED (not a byte count) — both already correct, only the family was wrong. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02fix(classify): assign fanotify_mark to FamilyIPC, not MiscPaul Buetow
fanotify_mark(2) adds, removes, or modifies a mark on an fanotify notification group. Its arg0 is the fanotify group fd returned by fanotify_init(2); it carries a dirfd@arg3 and an optional pathname@arg4 and returns 0/-1 (not a byte count). It is the operation counterpart of fanotify_init and the direct analog of inotify_add_watch (both register a watch/mark on a filesystem object via the notification-group fd). inotify_add_watch is FamilyIPC, and fanotify_init was just moved Misc->IPC to sit with the fd-based event-notification primitives (eventfd, signalfd, timerfd, userfaultfd, inotify_*). fanotify_mark, however, was still falling through to FamilyMisc by omission from the explicit family table -- the same alarm/adjtimex-style misclassification fixed for fanotify_init in 88769d4, and flagged there as still-outstanding for fanotify_mark. Add it to the IPC family map for sibling consistency and regenerate. KIND is unchanged and correct: KindPathname capturing the optional pathname at args[4]. This matches the *at() cohort convention (fchmodat, fchownat, unlinkat, mkdirat, newfstatat, utimensat, name_to_handle_at all carry a dirfd at arg0 yet capture the pathname), since fanotify_mark has a dirfd@arg3 + pathname@arg4 pair. RET stays UNCLASSIFIED (returns 0/-1). Docs plan updated to keep the docs-drift tests in sync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02fix(classify): assign fanotify_init to FamilyIPC, not MiscPaul Buetow
fanotify_init(2) creates and initializes an fanotify notification group and returns an event-queue file descriptor. It is the direct analog of inotify_init1 (both are filesystem-event notification facilities whose group-creating syscall is a flags-taking fd-creator). inotify_init/ inotify_init1 are FamilyIPC alongside the other fd-based event-notification primitives (eventfd, signalfd, timerfd, userfaultfd), yet fanotify_init fell through to FamilyMisc by omission from the explicit family table -- an alarm/adjtimex-style misclassification inconsistent with its siblings. Add fanotify_init to the IPC family map and regenerate. Kind (KindEventfd, flags at args[0]) and ret (UNCLASSIFIED, returned fd captured via the fd mechanism) were already correct and are unchanged. fanotify_mark stays in Misc (path-marking, not fd creation). Docs plan updated to keep the docs-drift test in sync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01fix(classify): assign alarm to FamilyTime, not MiscPaul Buetow
alarm(2) arranges for a SIGALRM after a given number of seconds; it is a simplified setitimer(ITIMER_REAL) and, per alarm(2) NOTES, "alarm() and setitimer(2) share the same timer; calls to one will interfere with use of the other." The syscallFamilies table omitted alarm, so it fell through to FamilyMisc while its siblings setitimer/getitimer/timer_create were correctly FamilyTime — an adjtimex-style misclassification (cf. 7243b7c). Add alarm -> FamilyTime and move it from Misc to Time in the tracing plan; regenerate the family maps (trace IDs 468/469 now FamilyTime, "alarm": "Time"). Kind classification (KindNull/null_event: the single arg is an unsigned int seconds, no fd/path) and the UNCLASSIFIED return (seconds remaining, not a byte count; alarm never fails) were already correct. Also harden the misc-basic integration test with a deterministic enter_alarm assertion (alarm(0) is issued unconditionally by the scenario; the syscall-entry tracepoint always fires) so the alarm enter path is covered end-to-end even though alarm is now FamilyTime rather than Misc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31fix(classify): assign adjtimex to FamilyTime, not MiscPaul Buetow
adjtimex(2) and clock_adjtime(2) share one man page: both tune or query the kernel clock (clock_adjtime is adjtimex with an explicit clockid) and return a clock-state code or -1. The syscallFamilies table omitted adjtimex, so it fell through to FamilyMisc while its sibling clock_adjtime was correctly FamilyTime. Add adjtimex -> FamilyTime and move it from Misc to Time in the tracing plan; regenerate the family maps (trace IDs 418/419 now FamilyTime, "adjtimex": "Time"). Kind classification (KindNull/null_event) and the UNCLASSIFIED return (a clock-state code, not a byte count) were already correct. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30kexec_load: classify into Security family with its siblingPaul Buetow
kexec_load(2) and kexec_file_load are documented together on the same man page and both load a new kernel for later execution by reboot(2). kexec_file_load was already FamilySecurity, but kexec_load fell through to FamilyMisc. Move kexec_load to FamilySecurity so the siblings share a family. Kind classification was already correct: kexec_load takes raw user pointers (KindNull, no fd/path) while kexec_file_load takes fds (KindFd); the return value (long 0/-1, no byte count) stays UNCLASSIFIED. Update docs/syscall-tracing-plan.md to match, regenerate artifacts, and add lock-in tests for the family and UNCLASSIFIED return of both kexec syscalls plus reboot. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30Document Process-vs-Misc boundary; keep set_tid_address in Process (task 920)Paul Buetow
Resolve the family-split question for set_tid_address vs its per-thread registration siblings rseq/set_robust_list/get_robust_list (Misc). DECISION: keep set_tid_address in FamilyProcess. The 520 registration-vs- operation rule governs the IPC-vs-Misc boundary (does the syscall perform the futex/sync op?), not Process-vs-Misc. set_tid_address registers clear_child_tid, the kernel's primary thread-EXIT notification mechanism (zeroed + FUTEX_WAKEd at teardown), set by the C runtime for essentially every thread via clone(2) CLONE_CHILD_CLEARTID, and returns the caller's tid like gettid/getpid -- mandatory thread-lifecycle plumbing belonging with clone/fork/exit/gettid. rseq (scheduling optimization) and robust_list (opt-in futex cleanup) are OPTIONAL per-thread features and stay Misc. - family.go: add Process-vs-Misc boundary-rule block (mandatory-thread- lifecycle vs optional-opt-in-feature axis) next to set_tid_address. - family_test.go: lock in set_tid_address enter+exit as Process with a WHY comment contrasting it against the rseq/robust_list Misc cluster. No generated-artifact or docs drift: classification unchanged (Process list in docs/syscall-tracing-plan.md already correct); mage generate is idempotent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30family: document Misc-vs-IPC boundary rule; keep robust_list in Misc (task 520)Paul Buetow
Resolve the get_robust_list/set_robust_list classification decision: keep both as FamilyMisc rather than promoting them to FamilyIPC alongside the recently-moved futex_* syscalls. Rule (now documented in family.go next to the futex IPC block): a syscall is IPC only if it PERFORMS the actual IPC/sync operation (futex wait/wake/requeue on the futex word, or an op on an IPC object). Per-thread registration/bookkeeping that merely hands the kernel a pointer it consults later -- rseq and get_robust_list/set_robust_list -- stays Misc. man 2 get_robust_list confirms the robust futex list is 'managed in user space: the kernel knows only about the location of the head'; these syscalls register/query that per-thread head pointer and never wait/wake or touch shared memory, structurally identical to rseq. The split axis is operation-vs-registration, not name similarity. No classification change, so mage generate is a no-op (generated artifacts and docs/syscall-tracing-plan.md unchanged). Strengthened the rseq/ robust_list comments in family_test.go and the TestClassifyGetRobustListPidNotFd lock-in comment in classify_test.go to cite the rule and mark the decision resolved. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30fix(family): classify seteuid/setegid as Process for consistencyPaul Buetow
classify.go has KindNull entries for sys_enter_seteuid/sys_enter_setegid, but family.go's FamilyProcess credential cluster omitted them, so ClassifySyscallFamily returned Misc — inconsistent with their siblings setuid/setgid/setresuid/setreuid/setfsuid. Add seteuid/setegid to the FamilyProcess group with a comment noting they are latent: current kernels expose no dedicated seteuid/setegid tracepoints (glibc wraps them over setreuid/setresuid), so they never reach the generated tracepoint map or docs/syscall-tracing-plan.md. mage generate confirmed idempotent with no diff, so docs/drift test are untouched. Lock-in unit tests assert Process for seteuid/setegid (enter+exit) by name directly, since no tracepoint exists. Refs task 620. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30fix(family): reclassify get_mempolicy as Memory not SecurityPaul Buetow
get_mempolicy(2) retrieves the NUMA memory policy for a thread or address range and is logically a Memory-family syscall, sharing FamilyMemory with its NUMA siblings set_mempolicy, set_mempolicy_home_node, mbind, migrate_pages, and move_pages. It was misclassified FamilySecurity (a copy/paste/alphabetical-ordering slip alongside the security modules). Move it to the Memory group in internal/generate/family.go, update the Memory and Security lists in docs/syscall-tracing-plan.md (keeps the docs_drift_test green), and regenerate artifacts (traceId2Family 735/734 and syscallFamilies[get_mempolicy] flip Security->Memory; C unchanged, mage generate idempotent). Add enter+exit family lock-in assertions for get_mempolicy and set_mempolicy alongside the NUMA siblings so the whole cluster is pinned. Task 120. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29ioprio_set/ioprio_get: classify as Process familyPaul Buetow
Audit of ioprio_set found a family inconsistency. ioprio_set(which, who, ioprio) and ioprio_get(which, who) query/set the I/O scheduling class and priority of a process, process group, or user. They are the direct I/O-priority analogues of getpriority/setpriority (the CPU nice value) and share the identical which/who selector signature, yet were falling through to FamilyMisc while getpriority/setpriority are FamilyProcess. Reclassify both ioprio syscalls to FamilyProcess for consistency with their priority siblings, update docs/syscall-tracing-plan.md, and regenerate the tracepoint/type artifacts (mage generate is idempotent). Argument capture is unchanged and confirmed correct: the args are all ints (which/who/ioprio), none named fd/path, so ClassifyFormat returns KindNone and the generator promotes the enter format to KindNull (null_event). In particular the 'who' argument (a pid/pgid/uid, never an fd) is not misclassified as KindFd. The exit is a ret_event (UNCLASSIFIED, int 0/-1). Add lock-in tests: - TestClassifyIoprioNullKind asserts KindNone/KindNull using the real kernel tracepoint fields, proving 'who' is not captured as an fd. - Family assertions for the ioprio pair alongside getpriority/setpriority so a stray reclassification of any of them trips the test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29utime/utimes: classify as FS family (fix Misc misclassification)Paul Buetow
utime(2) and utimes(2) change a file's access/modification times by a real filesystem path (filename at args[0]). The path was already captured (KindPathname), but both syscalls fell through to FamilyMisc instead of joining their siblings utimensat/futimesat in FamilyFS. Add them to fsSyscalls and regenerate; the only generated change is trace IDs 1034-1037 flipping FamilyMisc -> FamilyFS. Lock-in coverage: - family_test.go asserts utime/utimes/utimensat/futimesat are all FamilyFS. - classify_test.go + FormatUtime fixture assert utime is KindPathname with PathnameField "filename" (path captured even though it is a char* string, unlike domain/host name args). - New ioworkload scenarios utime-basic/utimes/enoent and integration tests TestUtimeBasic/Utimes/Enoent verify the path is captured at runtime, including on the ENOENT error path. Docs updated: moved utime/utimes from Misc to FS in docs/syscall-tracing-plan.md to keep the drift tests green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29classify: move lsm_* syscalls from Misc to Security familyPaul Buetow
The Linux Security Module introspection syscalls lsm_list_modules, lsm_get_self_attr and lsm_set_self_attr (Linux 6.8+) were classified as FamilyMisc while every sibling LSM/security syscall (landlock_*, keyctl, add_key, request_key, seccomp) is FamilySecurity. This audited inconsistency is fixed by adding the three lsm_* entries to the syscallFamilies map; their kind stays KindNull (args are userspace pointers + flags, no fd/path) and the exit remains a ret_event. Docs (syscall-tracing-plan.md) updated accordingly, generated artifacts regenerated via mage generate, and lock-in family assertions added to TestClassifySyscallPairEmitsAllFamilies. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29family: classify futex syscalls as IPC instead of MiscPaul Buetow
Audit of futex_wake found that the futex family syscalls (futex, futex_wait, futex_wake, futex_requeue, futex_waitv) were absent from the syscallFamilies map and fell through to FamilyMisc. Per futex(2) ("fast user-space locking"), these are shared-memory synchronization/IPC primitives, conceptually identical to the System V semaphores (semop/semget) already tagged FamilyIPC. Group them under IPC so per-family aggregation/reporting bins them with the other synchronization primitives. Argument and return-value handling were already correct: futex_wake's first arg (uaddr) is a userspace pointer, captured via KindFutex (null_event), and the exit ret_event records the woken-waiter count (>=0) or -1 on error. Add lock-in unit tests in family_test.go and regenerate the C/Go artifacts (generated_tracepoints.go, generated_types.go). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-20feat: add mount/fs management syscall tracing for c7Paul Buetow
2026-05-18k6: emit tracepoints for all syscall familiesPaul Buetow