

GitHub - javierhonduco/rbperf: Sampling profiler and tracer for Ruby (CRuby) whi...
source link: https://github.com/javierhonduco/rbperf
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

rbperf
rbperf
is a low-overhead sampling profiler and tracer for Ruby (CRuby) which runs in BPF
Features
The main goals for rbperf are
- On-CPU profiling support
- Low overhead
- Profiled processes don't have to be restarted or modified in any way
- Support for tracing low level events, such as system calls
Installation
The latest release of is available here.
Usage
CPU sampling
$ sudo rbperf record --pid `pidof ruby` cpu
System call tracing
The available system calls to trace can be found with:
$ sudo rbperf record --pid `pidof ruby` syscall --list
$ sudo rbperf record --pid `pidof ruby` syscall enter_writev
Some debug information will be printed, and a flamegraph called rbperf_flame_$date
will be written to disk
Building
To build rbperf
you would need a modern Linux machine with:
- The Rust toolchain
clang
to compile the BPF codeelfutils
andzlib
installedmake
andpkg-config
to build libbpf
Once the dependencies are installed:
# As we are statically linking elfutils and zlib, we have to tell Rustc
# where are they located. On my Ubuntu system they are under
$ export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu'
$ cargo build [--release]
The built binary can be found under target/(debug|release)/rbperf
.
Developing and troubleshooting
Debug logs can be enabled with RUST_LOG=debug
. The info subcommand, rbperf info
shows the supported BPF features as well as other supported details.
Stability
rbperf
is in active development and the CLI and APIs might change any time
If you encounter any bugs, feel free to open an issue on rbperf's repo
Acknowledgements
rbperf
wouldn't be possible without all the open source projects that we benefit from, such as Rust and all the superb crates we use in this project, Ruby and its GDB file, the BPF ecosystem, and many others!
License
Licensed under the MIT license
Recommend
-
118
rbspy Have a running Ruby program that you want to profile without restarting it? Want to profile a Ruby command line program really easily? You want rbspy! rbspy can profile any Ruby program just by running 1 simple command....
-
97
README.md
-
63
Sampling profiler for PHP 7
-
69
Py-Spy: A sampling profiler for Python programs. Py-Spy is a sampling profiler for Python programs. It lets you visualize what your Python program is spending time on without restarting the program or modify...
-
25
For the last two years, I have been trying to improve CRuby performance. I have been working simultan...
-
20
lowleveldesign.org Software tracing, debugging, and security While working on a new version of wtrace
-
10
php-profiler php-profiler is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the process. It's a stand alone CLI tool, so target programs don't need any m...
-
4
fgtrace - The Full Go Tracer fgtrace is an experimental profiler/tracer that is capturing wallclock timelines for each goroutine. It's very similar to the Chrome profiler.
-
6
async-profiler This project is a low overhead sampling profiler for Java that does not suffer from Safepoint bias problem. It f...
-
4
Sampling Profiler & Rogue case of App Profiling
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK