Skip to content

Conversation

@kov
Copy link
Owner

@kov kov commented Jan 1, 2026

Implements lookup_dcookie, nfsservctl, and utime

lookup_dcookie:

  • Converts directory entry cookie to path
  • Arguments: cookie (u64), buffer pointer, buffer size
  • Returns path length on success
  • Used primarily by oprofile profiler
  • Requires CAP_SYS_ADMIN capability

nfsservctl:

  • Obsolete NFS daemon control syscall (removed in Linux 3.1)
  • Arguments: cmd, argp pointer, resp pointer
  • Returns 0 on success
  • Replaced by nfsd filesystem interface

utime (x86_64 only):

  • Change file access and modification times
  • Arguments: pathname, times pointer (or NULL)
  • times is a Utimbuf struct with actime and modtime fields
  • NULL times sets both timestamps to current time
  • Returns 0 on success

Added Utimbuf struct to kernel_types.rs for utime syscall. Added 5 pretty printing tests covering all three syscalls.

🤖 Generated with Claude Code

@kov kov requested a review from Copilot January 1, 2026 18:41
@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 three legacy filesystem syscalls: lookup_dcookie, nfsservctl, and utime. The lookup_dcookie syscall converts directory entry cookies to paths and was primarily used by the oprofile profiler. The nfsservctl syscall is an obsolete NFS daemon control interface removed in Linux 3.1. The utime syscall (x86_64-only) changes file access and modification times using a Utimbuf structure.

Key changes:

  • Added Utimbuf kernel structure to represent the times parameter for the utime syscall
  • Implemented eBPF handlers for all three syscalls in the consolidated filesystem handler
  • Added event parsing logic with proper formatting for each syscall's arguments
  • Created 5 comprehensive tests covering success and error cases

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pinchy-common/src/kernel_types.rs Added Utimbuf struct for utime syscall timestamps
pinchy-common/src/lib.rs Added data structures for all three syscalls to SyscallEventData union
pinchy-ebpf/src/filesystem.rs Implemented eBPF handlers in consolidated filesystem tracepoint
pinchy/src/server.rs Registered all three syscalls in FILESYSTEM_SYSCALLS array
pinchy/src/format_helpers.rs Added return value formatting for all three syscalls
pinchy/src/events.rs Implemented argument parsing and display formatting
pinchy/src/tests/filesystem.rs Added 5 tests covering success/error cases and NULL pointer handling

Implements lookup_dcookie, nfsservctl, and utime

lookup_dcookie:
- Converts directory entry cookie to path
- Arguments: cookie (u64), buffer pointer, buffer size
- Returns path length on success
- Used primarily by oprofile profiler
- Requires CAP_SYS_ADMIN capability

nfsservctl:
- Obsolete NFS daemon control syscall (removed in Linux 3.1)
- Arguments: cmd, argp pointer, resp pointer
- Returns 0 on success
- Replaced by nfsd filesystem interface

utime (x86_64 only):
- Change file access and modification times
- Arguments: pathname, times pointer (or NULL)
- times is a Utimbuf struct with actime and modtime fields
- NULL times sets both timestamps to current time
- Returns 0 on success

Added Utimbuf struct to kernel_types.rs for utime syscall.
Added 5 pretty printing tests covering all three syscalls.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@kov kov force-pushed the legacy-filesystem branch from 5afeb1f to 6c50b4b Compare January 1, 2026 19:13
@kov kov merged commit 446ebcd into main Jan 1, 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