Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Understanding Ruby with BPF
Search
Javier Honduvilla Coto
January 01, 2021
Technology
1
43
Understanding Ruby with BPF
Javier Honduvilla Coto
January 01, 2021
Tweet
Share
More Decks by Javier Honduvilla Coto
See All by Javier Honduvilla Coto
Debugging – Learning Linux @ Facebook
javierhonduco
0
100
Spying Linux processes
javierhonduco
0
110
word2vec
javierhonduco
0
76
UC3M university cafeteria redesign
javierhonduco
0
88
Mac OSX UI toolkit and design guidelines
javierhonduco
0
120
Python for Java developers
javierhonduco
0
81
Other Decks in Technology
See All in Technology
IBC 2025 動画技術関連レポート / IBC 2025 Report
cyberagentdevelopers
PRO
2
220
オブザーバビリティが育むシステム理解と好奇心
maruloop
3
1.7k
デザインとエンジニアリングの架け橋を目指す OPTiMのデザインシステム「nucleus」の軌跡と広げ方
optim
0
120
DSPy入門
tomehirata
6
700
GCASアップデート(202508-202510)
techniczna
0
110
OPENLOGI Company Profile for engineer
hr01
1
46k
書籍『実践 Apache Iceberg』の歩き方
ishikawa_satoru
0
310
webpack依存からの脱却!快適フロントエンド開発をViteで実現する #vuefes
bengo4com
4
3.8k
SRE × マネジメントレイヤーが挑戦した組織・会社のオブザーバビリティ改革 ― ビジネス価値と信頼性を両立するリアルな挑戦
coconala_engineer
0
310
様々なファイルシステム
sat
PRO
0
270
ViteとTypeScriptのProject Referencesで 大規模モノレポのUIカタログのリリースサイクルを高速化する
shuta13
3
230
AIの個性を理解し、指揮する
shoota
3
520
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
186
22k
Optimizing for Happiness
mojombo
379
70k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Writing Fast Ruby
sferik
630
62k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
A better future with KSS
kneath
239
18k
A designer walks into a library…
pauljervisheath
209
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.3k
Transcript
rbperf: Understanding Ruby with BPF Javier Honduvilla Coto <
[email protected]
> October
28th-29th, 2020
Why BPF?
Why BPF? - Flexibility
Why BPF? - Flexibility - Low overhead
Why BPF? - Flexibility - Low overhead - Continuous profiling
Why BPF? - Flexibility - Low overhead - Continuous profiling
- No modifications of the tracee
rbperf
rbperf - Profile Ruby programs
rbperf - Profile Ruby programs - Trace complex Ruby programs
execution
rbperf – on-CPU profiling - $ rbperf record --pid=124 cpu
- $ rbperf report [...]
rbperf – Rails on-CPU profile
rbperf – tracing write(2) calls - $ rbperf record \
--pid=124 event \ --tracepoint=syscalls:sys_enter_write - $ rbperf report [...]
Architecture 2. Event (timer, syscall, etc) BPF code (bpf/rbperf.c) Read
frame Driver (rbperf.py) 1. Adds info (pid to profile, thread address) 3. Receives stacktrace 4. Serialisation and persistence BPF tail-calls Bounded loop
Challenges - Implementing the stack walking for a dynamic language
Challenges - Implementing the stack walking for a dynamic language
- Supporting multiple Ruby versions
Challenges - Implementing the stack walking for a dynamic language
- Supporting multiple Ruby versions - Correctness testing
Challenges - Implementing the stack walking for a dynamic language
- Supporting multiple Ruby versions - Correctness testing - BPF safety features
Future plans - Integrate in Facebook’s profiling infra - Rewrite
OSS driver program - Make the OSS version awesome - Better documentation (including how to measure overhead) - Add more output formats - Open source GDB / drgn helper - Other tools? - Containers support? - Support request-oriented workloads?
Thanks! :) https://github.com/facebookexperimental/rbperf
[email protected]
@javierhonduco