summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-02-21Add negative integration tests for rename syscalls (task 348)Paul Buetow
- rename-enoent: rename nonexistent file via SYS_RENAME (ENOENT) - rename-noreplace: renameat2 with RENAME_NOREPLACE on existing target (EEXIST) Both verify ior captures tracepoints on entry even when syscall fails. Amp-Thread-ID: https://ampcode.com/threads/T-019c819e-cdae-7777-9be6-992ca8a7b96b Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add negative integration tests for fcntl syscalls (task 348)Paul Buetow
Add two negative scenarios: - fcntl-invalid-fd: calls SYS_FCNTL F_GETFL on invalid fd 99999 (EBADF) - fcntl-dupfd-max: calls F_DUPFD with minfd=1<<30 beyond RLIMIT_NOFILE (EINVAL) Both verify ior captures enter_fcntl tracepoints even when syscalls fail. Amp-Thread-ID: https://ampcode.com/threads/T-019c819b-5673-75ab-8eb4-227b6cf56b38 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add negative integration tests for dup syscallsPaul Buetow
Add three negative test scenarios for dup syscalls: - dup-invalid-fd: dup on invalid fd 99999 (EBADF) - dup2-same-fd: dup2(fd, fd) no-op case (POSIX documented behavior) - dup3-invalid-flags: dup3 with 0xBAD flags (EINVAL) All verify ior captures the tracepoint even when the syscall fails, since BPF reads arguments on syscall entry before execution. Task: 348 Amp-Thread-ID: https://ampcode.com/threads/T-019c8196-6186-7054-a4e5-640fce69e493 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add negative integration tests for close syscallsPaul Buetow
Add three negative scenarios to verify ior captures tracepoints even when close syscalls fail: - close-invalid-fd: close an fd (99999) that was never opened (EBADF) - close-double-close: open a file, close it, close same fd again (EBADF) - close-range-empty: close_range on high fd range with no open fds Task: 348 Amp-Thread-ID: https://ampcode.com/threads/T-019c8190-c9ae-776e-b00d-476207d8c10e Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add negative integration tests for readwrite syscalls (task 348)Paul Buetow
Add four negative scenarios that verify ior captures tracepoints even when syscalls fail: - readwrite-wronly-read: read from O_WRONLY fd (EBADF) - readwrite-rdonly-write: write to O_RDONLY fd (EBADF) - readwrite-pread-invalid: pread64 with negative offset (EINVAL) - readwrite-pwrite-invalid: pwrite64 with negative offset (EINVAL) Amp-Thread-ID: https://ampcode.com/threads/T-019c818c-ec91-7673-a5ba-e9b2ba53379b Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add negative integration tests for open syscallsPaul Buetow
- openEnoent: verifies ior captures enter_openat even when syscall fails (ENOENT) - openRdonlyWrite: verifies tracing of open + failed write to read-only fd - openPidFilter: verifies child process I/O is excluded by PID filtering - AssertEventsAbsent helper with zero-value guard and 6 unit tests Task: 348 Amp-Thread-ID: https://ampcode.com/threads/T-019c8185-55f4-72f0-8ddb-3be5e4002c0d Co-authored-by: Amp <amp@ampcode.com>
2026-02-21fix: close_range path resolution - lookup fd before deleting from mapPaul Buetow
Move e.files[fd] lookup before the close_range fd cleanup loop in the FdEvent handler so the file path is resolved while the fd still exists in the map. Previously, close_range events always fell through to file.NewFdWithPid() which couldn't resolve the path since the fd was already closed. Also add unit test assertion verifying ep.File resolves to the correct filename for close_range events. Task: 349 Amp-Thread-ID: https://ampcode.com/threads/T-019c8180-1da4-7048-9200-ae93bdd90cab Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Fix integration test expectations to test actual syscall outcomes (task 349)Paul Buetow
- rename_test.go: Fix PathContains to use destination names (newname.txt, renameat-new.txt, renameat2-new.txt) since name_events use Newname as the path in ior output, not the source name - open_test.go: Change expected tracepoint from enter_openat to enter_creat - scenarios.go: Use raw SYS_CREAT instead of Go's syscall.Creat which wraps openat on amd64, so the creat tracepoint is actually exercised - Created task 350 for close_range path resolution bug found during review Amp-Thread-ID: https://ampcode.com/threads/T-019c8178-1c1f-7509-9ac9-bd48b970945b Co-authored-by: Amp <amp@ampcode.com>
2026-02-21integrationtests: address review comments on cleanup testsPaul Buetow
- Remove tautological temp dir tests that self-cleaned in script - Add TestCleanupLeakedWorkloadTempDirCaughtByAssertion that creates a dir without cleanup and verifies detection catches it - Inline snapshotWorkloadTempDirs into listWorkloadTempDirs - Add comment explaining assertNoNewWorkloadTempDirs cleanup behavior - Add non-empty check in OutputDir test to prevent vacuous pass - Fix .collapsed -> .collapsed.zst suffix consistency Amp-Thread-ID: https://ampcode.com/threads/T-019c8172-052c-74fe-8d8d-34a0529d082c Co-authored-by: Amp <amp@ampcode.com>
2026-02-21integrationtests: verify no temp files or artifacts leak after testsPaul Buetow
Add cleanup_test.go with 6 tests verifying: - OutputDir contains only expected file types (.ior.zst, .collapsed.zst, .svg, bpf symlink) - No ioworkload temp dirs leak on success or failure paths - OutputDir only has bpf symlink after ior failure (no stale output) - No artifacts leak outside the OutputDir - Leak detection mechanism works (negative test) Task: 343 Amp-Thread-ID: https://ampcode.com/threads/T-019c8172-052c-74fe-8d8d-34a0529d082c Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Address review: strengthen multi-record assertions, add corrupt-zstd testPaul Buetow
- TestLoadTestResultMultipleRecordsSamePath now checks all fields per record - Fixed unchecked error return from zstd Write - Added TestLoadTestResultCorruptZstd for non-zstd file content Amp-Thread-ID: https://ampcode.com/threads/T-019c816d-5634-7387-8065-f67e38257019 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add parse.go unit tests verifying .ior.zst deserialization and TestResult fieldsPaul Buetow
Tests cover: - All IterRecord fields (Path, TraceID, Comm, Pid, Tid, Flags, Cnt) - Multiple records with same path but different tracepoints - Empty .ior.zst file - Nonexistent file (error path) - Invalid/corrupt data (error path) Task 343: Verify parse.go correctly deserializes .ior.zst files Amp-Thread-ID: https://ampcode.com/threads/T-019c816d-5634-7387-8065-f67e38257019 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add ior crash/timeout harness tests (task 343)Paul Buetow
- Add waitBoth unit tests: ior exit error, ior timeout, both timeout, both succeed — using real processes (true/false/sleep) - Add TestIorCrashReportsError: full harness test with fake ior binary that exits with error, verifying error mentions 'ior' and workload PID is returned - Add TestIorStartFailureCleansUpWorkload: verifies workload process is killed when ior binary doesn't exist, checking with signal 0 - Refactor waitBoth to accept grace duration parameter for testability (production code passes iorShutdownGrace, tests use 500ms) - Fix pipe drain in startWorkload: drain remaining stdout after reading PID so cmd.Wait() doesn't block on pending I/O - Add writeScript helper to helpers_test.go for creating fake binaries Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019c8162-c1cf-7612-b8f5-84c61e3d2021
2026-02-21Verify harness handles workload crash/nonzero exit (task 343)Paul Buetow
Add crash scenario to ioworkload that exits non-zero, and a test verifying the harness returns a clear error mentioning 'workload', reports a valid PID, and returns no records. Amp-Thread-ID: https://ampcode.com/threads/T-019c815e-6fb6-714a-a4db-37522416ea9a Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Fix integration test harness: symlink BPF object, increase grace period, ↵Paul Buetow
improve assertions - Symlink ior.bpf.o into output dir so ior finds it when run from temp dir - Increase iorShutdownGrace from 3s to 30s for BPF tracepoint unloading - Skip records with empty comm in AssertNoUnexpectedComm (BPF race condition) - Add diagnostic logging (up to 5 samples) in both AssertNoUnexpectedComm and AssertNoUnexpectedPID for easier debugging of test failures Amp-Thread-ID: https://ampcode.com/threads/T-019c814e-d6b6-72fb-aaf0-c49f5b3fd04e Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add io_uring integration tests and workload scenariosPaul Buetow
Implement iouring_test.go with tests for io_uring_setup, io_uring_enter, and io_uring_register tracepoints. Add corresponding workload scenarios using raw syscalls (425, 426, 427) since Go stdlib doesn't wrap io_uring on amd64. - iouring-setup: creates io_uring instance via io_uring_setup(2) - iouring-enter: creates ring, calls io_uring_enter(2) with zero ops - iouring-register: creates ring, calls io_uring_register(2) with PROBE Task #343 Amp-Thread-ID: https://ampcode.com/threads/T-019c8149-2aa6-75fb-88f3-dd6bd3a2b654 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Implement truncate_test.go + workload scenarios for truncate, ftruncatePaul Buetow
- truncate-basic: tests SYS_TRUNCATE (path-based) via syscall.Truncate - truncate-ftruncate: tests SYS_FTRUNCATE (fd-based) via syscall.Ftruncate - Both syscall wrappers use direct SYS_* calls on amd64 (no *at wrapping) Task #343 Amp-Thread-ID: https://ampcode.com/threads/T-019c8145-7437-7218-95ff-4cb451e18655 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Implement sync_test.go + workload scenarios for fsync, fdatasync, sync, ↵Paul Buetow
sync_file_range - Add syncFdatasync, syncSync, syncSyncFileRange scenario functions - Register sync-fdatasync, sync-sync, sync-sync-file-range in scenarios map - Add sync_test.go with tests for all 4 sync-related syscalls - sync is a null_event (no path); others are fd_events - All use direct SYS_* syscalls on amd64 (no wrapper delegation) Task: #343 Amp-Thread-ID: https://ampcode.com/threads/T-019c813f-e020-7558-86ce-be6fdbd96f98 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21more on integration testsPaul Buetow
2026-02-21Add integration test framework: plan, workload binary, harness scaffoldingPaul Buetow
- INTEGRATIONTESTS-PLAN.md: full design for e2e integration tests - integrationtests/cmd/ioworkload: standalone binary with 13 I/O scenarios - integrationtests/expectations.go: ExpectedEvent type and assertion helpers - integrationtests/parse.go: .ior.zst parser producing TestResult - Export IterRecord and LoadFromFile in flamegraph package - Fix TraceId -> TraceID, StringByName returns error instead of panic Amp-Thread-ID: https://ampcode.com/threads/T-019c8031-c106-757a-95a0-7a5457163ce7 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Move TODO list to taskwarriorPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c8012-eaeb-768d-a264-5a704f3939ef Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add byte count tracking to event pairsPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c8012-eaeb-768d-a264-5a704f3939ef Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Enable name_to_handle_at and io_uring fd attributionPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fec-eec9-706a-8338-3ce674802680 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21review comments added to gitignroesPaul Buetow
2026-02-21Fix outdated line references and test command in documentationPaul Buetow
2026-02-21Document optional open_by_handle_at excludePaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fd9-5870-77b7-9909-3eb7550d17bb Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Enable open_by_handle_at tracepointPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fd9-5870-77b7-9909-3eb7550d17bb Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Track io_uring setup fds in event loopPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fd9-5870-77b7-9909-3eb7550d17bb Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Handle close_range cleanupPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7faf-baaa-704f-af15-8aeba9df4628 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Handle open_by_handle_at without pathnamePaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7faf-baaa-704f-af15-8aeba9df4628 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Handle unknown flags for openat2Paul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7faf-baaa-704f-af15-8aeba9df4628 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Ignore flamegraph artifactsPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fa3-3180-7747-83d3-d6e99572c02a Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add flamegraph artifacts for e2e runPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fa3-3180-7747-83d3-d6e99572c02a Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add docs and ignore cursor configPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7f4e-cc5f-76f1-aaf0-dd7cbaabbb18 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Ignore ior binaryPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7f4e-cc5f-76f1-aaf0-dd7cbaabbb18 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Migrate make targets to magePaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7f4e-cc5f-76f1-aaf0-dd7cbaabbb18 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Align Go project structure and add Mage targetsPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7f3b-1326-767b-94d5-366b91eaf712 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21rewrite from Raku to Golang initialPaul Buetow
2025-10-09fix unit tests, initial hard exclude of not working yet syscallsPaul Buetow
2025-10-09initial handle by open_at syscallsPaul Buetow
2025-10-08clarify, that some tests are there already for FCNTLPaul Buetow
2025-10-08add classificationsPaul Buetow
2025-10-08classify more tracepointsPaul Buetow
2025-09-21add agents remove CLAUDE.mdPaul Buetow
2025-07-14more on classificationPaul Buetow
2025-07-12initial classificationPaul Buetow
2025-07-11fix the fctnl F_SET bugPaul Buetow
2025-07-11Add comprehensive unit tests for FcntlEvent handlingPaul Buetow
- Implement helper function makeEnterFcntlEvent for test data creation - Add test for F_SETFL flag modification (temporarily disabled due to failure) - Add test for F_DUPFD file descriptor duplication - Add test for F_DUPFD_CLOEXEC with O_CLOEXEC flag - Add test for fcntl error handling (ret=-1) - Add test for invalid file descriptors Bug fixes: - Fix NewFdWithPid to properly initialize fd field - Fix event pair pool to properly clear all fields on recycle - Initialize all fields in NewPair to prevent stale data The F_SETFL test is temporarily disabled pending investigation of "expected a file.FdFile" panic during event processing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10Update TODO.md and remove obsolete unit test commentsPaul Buetow
- Remove 5 obsolete "TODO: Unit test this" comments from eventloop.go for event types that already have comprehensive test coverage - Keep TODO comment for FcntlEvent which still needs tests - Reorganize TODO.md with prioritized task list based on all TODOs found across the codebase - Add priority levels: High (core functionality), Medium (additional syscalls), Low (less common features), and General improvements - Document completed tasks to acknowledge test coverage achievements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10Remove outdated dup3 TODO and add comprehensive testsPaul Buetow
- Remove misleading TODO comment about dup3 implementation (already implemented) - Add comprehensive test for dup3 with O_CLOEXEC flag verification - Add comprehensive test for dup2 without O_CLOEXEC flag - Both tests verify proper file descriptor lifecycle and flag handling The dup3 syscall was already fully implemented but lacked proper testing. These tests ensure correct behavior of both dup2 and dup3 syscalls, particularly the O_CLOEXEC flag handling which differentiates them. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>