bin+lib rstrace

A Rust implementation of strace to trace system calls and CUDA API calls

2 unstable releases

0.2.2 Oct 5, 2024
0.1.0 Sep 15, 2024

#642 in Development tools

Download history 69/week @ 2024-09-09 130/week @ 2024-09-16 10/week @ 2024-09-23 172/week @ 2024-09-30 34/week @ 2024-10-07

415 downloads per month

MIT license

68KB
1.5K SLoC

rstrace

CI status

rstrace is a Rust implementation of strace. It allows the user to trace system calls of a process or command.

Usage

rstrace ls /tmp/

To get a quick overview, use rstrace --help

Usage: rstrace [OPTIONS] <ARGS>...

Arguments:
  <ARGS>...  Arguments for the program to trace. e.g. 'ls /tmp/'

Options:
  -o, --output <OUTPUT>  send trace output to FILE instead of stderr
  -t, --timestamp...     Print absolute timestamp. -tt includes microseconds, -ttt uses UNIX timestamps
  -c, --summary-only     Count time, calls, and errors for each syscall and report summary
  -j, --summary-json     Count time, calls, and errors for each syscall and report summary in JSON format
      --cuda             Enable CUDA ioctl sniffing. [Requires 'cuda_sniff' feature]
  -h, --help             Print help
  -V, --version          Print version

cuda_sniff extension

cuda_sniff is an extension to strace-rs that allows the user to trace CUDA API calls. It is based on https://github.com/geohot/cuda_ioctl_sniffer by George Hotz.

gvisor has an alternative implementation called ioct_sniffer which uses LD_PRELOAD to intercept calls, unlike strace-rs which uses ptrace.

Alternatives

Dependencies

~12–22MB
~296K SLoC