From 4df620818f603564b2e6f4def6052baa72b2fbb1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 29 May 2026 17:22:56 +0300 Subject: utime/utimes: classify as FS family (fix Misc misclassification) 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 --- integrationtests/utime_test.go | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 integrationtests/utime_test.go (limited to 'integrationtests') diff --git a/integrationtests/utime_test.go b/integrationtests/utime_test.go new file mode 100644 index 0000000..b1e6fdc --- /dev/null +++ b/integrationtests/utime_test.go @@ -0,0 +1,45 @@ +package integrationtests + +import "testing" + +// TestUtimeBasic verifies that ior captures the enter_utime tracepoint with the +// real file path. utime(2) takes a genuine filesystem path at args[0] +// ("filename"), so it must be path-classified (KindPathname), just like its +// siblings utimensat/futimesat. +func TestUtimeBasic(t *testing.T) { + runScenario(t, "utime-basic", []ExpectedEvent{ + { + PathContains: "utimefile.txt", + Tracepoint: "enter_utime", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + +// TestUtimeUtimes verifies the microsecond-resolution sibling utimes(2) is +// likewise path-classified and its filename path captured. +func TestUtimeUtimes(t *testing.T) { + runScenario(t, "utime-utimes", []ExpectedEvent{ + { + PathContains: "utimesfile.txt", + Tracepoint: "enter_utimes", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + +// TestUtimeEnoent verifies the path is still captured on the error path: +// utime(2) on a missing file fails with ENOENT, but ior records enter_utime +// because the filename is read on syscall entry. +func TestUtimeEnoent(t *testing.T) { + runScenario(t, "utime-enoent", []ExpectedEvent{ + { + PathContains: "utime-enoent-missing.txt", + Tracepoint: "enter_utime", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} -- cgit v1.2.3