-
Notifications
You must be signed in to change notification settings - Fork 1
Add support for several mostly x86_64-only syscalls #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for 14 new syscalls to the pinchy tracing tool, primarily focused on x86_64-only legacy syscalls. The changes include 9 filesystem operations (access, chmod, creat, mkdir, readlink, stat, lstat, utimes, futimesat), 2 process creation syscalls (fork, vfork), and 3 I/O/IPC miscellaneous syscalls (getdents, semtimedop, sendfile). The PR introduces two new kernel types (LinuxDirent for legacy directory entries and Sembuf for semaphore operations) and includes comprehensive tests for the new functionality.
Key Changes
- Added 14 new syscall data structures in pinchy-common with proper architecture annotations
- Implemented eBPF handlers for capturing syscall data in the kernel space
- Added event parsing logic to format and display the captured syscall data
- Extended return value formatting to handle the new syscalls appropriately
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| pinchy-common/src/lib.rs | Added data structures for 14 new syscalls including ForkData, VforkData, AccessData, StatData, GetdentsData, SemtimedopData, and SendfileData |
| pinchy-common/src/kernel_types.rs | Added LinuxDirent and Sembuf kernel type definitions for legacy directory entries and semaphore operations |
| pinchy-ebpf/src/main.rs | Registered fork and vfork as trivial syscalls in the consolidated handler |
| pinchy-ebpf/src/filesystem.rs | Implemented eBPF handlers for 10 filesystem-related syscalls including getdents, access, chmod, creat, mkdir, readlink, stat, lstat, utimes, and futimesat |
| pinchy-ebpf/src/basic_io.rs | Added sendfile syscall handler with offset pointer handling |
| pinchy-ebpf/src/ipc.rs | Implemented semtimedop handler with sembuf array and timeout handling |
| pinchy/src/events.rs | Added event parsing logic for all 14 new syscalls with appropriate formatting |
| pinchy/src/format_helpers.rs | Extended return value formatting to handle fork/vfork, readlink, getdents, semtimedop, and filesystem operation return values; added duplicates in match arm |
| pinchy/src/server.rs | Registered all new syscalls with their respective consolidated handlers (trivial, filesystem, basic_io, ipc) |
| pinchy/src/tests/process.rs | Added 6 test cases for fork and vfork syscalls covering parent, child, and error scenarios |
| pinchy/src/tests/ipc.rs | Added 2 test cases for semtimedop with and without timeout |
| pinchy/src/tests/filesystem.rs | Added 17 test cases covering all new filesystem syscalls with various scenarios |
| pinchy/src/tests/basic_io.rs | Added 2 test cases for sendfile with and without offset pointer |
09ed354 to
1281787
Compare
Common Filesystem Operations (9 x86_64-only syscalls) - access: Check file access permissions - chmod: Change file mode - creat: Create file (legacy) - mkdir: Create directory - readlink: Read symbolic link - stat: Get file status - lstat: Get file status (no symlink follow) - utimes: Change file timestamps - futimesat: Change file timestamps with dirfd Process Creation (2 x86_64-only syscalls) - fork: Create child process - vfork: Create child process (lightweight) I/O & IPC Misc (3 syscalls) - getdents (x86_64): Legacy directory entries - semtimedop (common): Semaphore ops with timeout - sendfile (x86_64): Copy data between fds Added kernel types: - LinuxDirent: Legacy directory entry structure - Sembuf: Semaphore operation structure Total: 14 new syscalls, 5 new tests (2 run on aarch64) All 549 tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Common Filesystem Operations (9 x86_64-only syscalls)
Process Creation (2 x86_64-only syscalls)
I/O & IPC Misc (3 syscalls)
Added kernel types:
Total: 14 new syscalls, 5 new tests (2 run on aarch64) All 549 tests passing.
🤖 Generated with Claude Code