Linux command
rr 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Record program execution
rr record [./program]
Replay recording
rr replay
List recordings
rr ls
Replay specific trace
rr replay [trace-directory]
Record with chaos mode
rr record --chaos [./program]
Pack trace for sharing
rr pack [trace-directory]
说明
rr is a lightweight recording and deterministic replay tool for debugging on Linux. It records a program's execution — including all system calls, signals, and thread scheduling decisions — so that the exact same execution can be replayed any number of times for debugging, producing identical behavior every run. During replay, rr integrates with GDB to provide a standard debugging interface enhanced with time-travel capabilities. Developers can step backwards through execution, set reverse breakpoints, and navigate to any point in the recorded trace, making it dramatically easier to find the root cause of bugs that are difficult to reproduce. The --chaos flag randomizes thread scheduling during recording to help expose concurrency bugs and race conditions that might not appear under normal scheduling. Recording imposes low overhead, typically running at near-native speed, making it practical for real-world debugging workflows.
参数
- record
- Record execution.
- replay
- Replay recording.
- ls
- List traces.
- pack
- Pack trace.
- --chaos
- Randomize scheduling.
- -n
- Number of processes.
- -h
- Help for command.
FAQ
What is the rr command used for?
rr is a lightweight recording and deterministic replay tool for debugging on Linux. It records a program's execution — including all system calls, signals, and thread scheduling decisions — so that the exact same execution can be replayed any number of times for debugging, producing identical behavior every run. During replay, rr integrates with GDB to provide a standard debugging interface enhanced with time-travel capabilities. Developers can step backwards through execution, set reverse breakpoints, and navigate to any point in the recorded trace, making it dramatically easier to find the root cause of bugs that are difficult to reproduce. The --chaos flag randomizes thread scheduling during recording to help expose concurrency bugs and race conditions that might not appear under normal scheduling. Recording imposes low overhead, typically running at near-native speed, making it practical for real-world debugging workflows.
How do I run a basic rr example?
Run `rr record [./program]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does record do in rr?
Record execution.