diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-29 17:27:31 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-29 17:27:31 +0300 |
| commit | b184674de2bc4f3cb27aaa31bcc64c3f3976ecff (patch) | |
| tree | 86a8e2e870f3ce9bd8425417446019b9e1ccc7db /internal/generate/family_test.go | |
| parent | 4df620818f603564b2e6f4def6052baa72b2fbb1 (diff) | |
test(sysinfo): lock in KindNull + FamilyMisc + UNCLASSIFIED ret
Audit of sysinfo(2): int sysinfo(struct sysinfo *info) returns overall
system statistics into a single userspace output pointer (not an fd or
path) and returns 0/-1. The existing classification was already correct
(KindNull, FamilyMisc, UNCLASSIFIED return) and docs/generated artifacts
are consistent; no behavior change was needed.
Add dedicated lock-in regression tests mirroring the rt_sigpending audit:
- TestGenerateSysinfoHandler: enter emits a null_event and captures no
args; exit emits a ret_event with ctx->ret tagged UNCLASSIFIED.
- TestClassifyRetSysinfoUnclassified: the 0/-1 status is never a byte
count.
- family_test.go: assert sysinfo/newuname/sysfs stay in FamilyMisc, with
a note that ustat is FamilyFS (matched by the 'stat' name marker) and
is intentionally not grouped here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'internal/generate/family_test.go')
| -rw-r--r-- | internal/generate/family_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/generate/family_test.go b/internal/generate/family_test.go index f6c9ca4..0e284a3 100644 --- a/internal/generate/family_test.go +++ b/internal/generate/family_test.go @@ -87,6 +87,21 @@ func TestClassifySyscallFamily(t *testing.T) { {"sys_exit_rseq", FamilyMisc}, {"sys_enter_set_robust_list", FamilyMisc}, {"sys_enter_get_robust_list", FamilyMisc}, + // sysinfo(2) returns overall system statistics (memory/swap usage and + // load averages) into a single userspace struct sysinfo *info pointer + // (an output buffer, not an fd/path). It is not in the explicit family + // table and intentionally falls through to Misc, sharing the family with + // its closest system-introspection siblings newuname/sysfs (also Misc). + // NOTE: other "system info" relatives are deliberately classified + // elsewhere — getrusage is Process, times/gettimeofday are Time — so + // sysinfo is grouped with the uname/sysfs cluster rather than any of + // those. ustat(2) is NOT a sibling here: it contains the "stat" name + // marker and is classified FamilyFS by isFSSyscall. Keep this in sync + // with the Misc list in docs/syscall-tracing-plan.md. + {"sys_enter_sysinfo", FamilyMisc}, + {"sys_exit_sysinfo", FamilyMisc}, + {"sys_enter_newuname", FamilyMisc}, + {"sys_enter_sysfs", FamilyMisc}, // rt_sigpending(2) examines the set of signals pending for delivery // (sigset_t *set, size_t sigsetsize). It is a signal-handling syscall and // shares FamilySignals with the whole rt_sig* group as well as kill/pause/ |
