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
56
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
110
Spying Linux processes
javierhonduco
0
120
word2vec
javierhonduco
0
84
UC3M university cafeteria redesign
javierhonduco
0
95
Mac OSX UI toolkit and design guidelines
javierhonduco
0
140
Python for Java developers
javierhonduco
0
89
Other Decks in Technology
See All in Technology
Vertex AI Agent Engine で学ぶ「記憶」の設計
tkikuchi
0
120
どこで打鍵するのが良い? IaCの実行基盤選定について
nrinetcom
PRO
2
110
Raspberry Pi AI HAT+ 2 介紹(#49)
piepie_tw
PRO
0
130
【PyCon mini Shizuoka 2026】生成AI時代に画像処理やオーディオ処理のノードエディターを作る理由
kazuhitotakahashi
0
230
「データとの対話」の現在地と未来
kobakou
0
1.2k
論文検索を日本語でできるアプリを作ってみた
sailen2
0
160
作るべきものと向き合う - ecspresso 8年間の開発史から学ぶ技術選定 / 技術選定con findy 2026
fujiwara3
6
1.7k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
Introduction to Bill One Development Engineer
sansan33
PRO
0
380
AIに視覚を与えモバイルアプリケーション開発をより円滑に行う
lycorptech_jp
PRO
1
740
opsmethod第1回_アラート調査の自動化にむけて
yamatook
0
330
Claude Codeはレガシー移行でどこまで使えるのか?
ak2ie
1
1.1k
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
80
SEO for Brand Visibility & Recognition
aleyda
0
4.3k
Embracing the Ebb and Flow
colly
88
5k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
150
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
450
Accessibility Awareness
sabderemane
0
71
First, design no harm
axbom
PRO
2
1.1k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Making Projects Easy
brettharned
120
6.6k
Code Reviewing Like a Champion
maltzj
528
40k
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