Skip to content

Conversation

@kov
Copy link
Owner

@kov kov commented Jan 1, 2026

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

@kov kov requested a review from Copilot January 1, 2026 23:20
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Contributor

Copilot AI left a 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

@kov kov force-pushed the misc-x86 branch 4 times, most recently from 09ed354 to 1281787 Compare January 1, 2026 23:59
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>
@kov kov merged commit c9f827c into main Jan 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants