From 04c0c9abbf079922ce312fe786bdc9986c31b665 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 1 Jun 2026 15:24:28 +0300 Subject: fix(classify): assign alarm to FamilyTime, not Misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- integrationtests/misc_test.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'integrationtests/misc_test.go') diff --git a/integrationtests/misc_test.go b/integrationtests/misc_test.go index 81767b4..4f171bb 100644 --- a/integrationtests/misc_test.go +++ b/integrationtests/misc_test.go @@ -2,12 +2,15 @@ package integrationtests import "testing" -// miscTraceArgs restricts tracing to the Misc-family syscalls the misc-basic -// workload issues, so the captured output is dominated by those calls. +// miscTraceArgs restricts tracing to the syscalls the misc-basic workload +// issues, so the captured output is dominated by those calls. // 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. +// 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.) var miscTraceArgs = []string{ "-trace-syscalls", "getcpu,newuname,sysinfo,vmsplice,alarm", @@ -31,5 +34,10 @@ func TestMiscBasic(t *testing.T) { {Tracepoint: "enter_getcpu", Comm: "ioworkload", MinCount: 1}, {Tracepoint: "enter_newuname", Comm: "ioworkload", MinCount: 1}, {Tracepoint: "enter_sysinfo", Comm: "ioworkload", MinCount: 1}, + // alarm(0) is issued unconditionally by misc-basic; the enter + // tracepoint always fires (syscall entry is unconditional, alarm never + // fails), so this assertion is deterministic. Covers the alarm enter + // path end-to-end even though alarm is now FamilyTime, not Misc. + {Tracepoint: "enter_alarm", Comm: "ioworkload", MinCount: 1}, }) } -- cgit v1.2.3