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
35
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
82
Spying Linux processes
javierhonduco
0
95
word2vec
javierhonduco
0
63
UC3M university cafeteria redesign
javierhonduco
0
83
Mac OSX UI toolkit and design guidelines
javierhonduco
0
120
Python for Java developers
javierhonduco
0
79
Other Decks in Technology
See All in Technology
今日からはじめるプラットフォームエンジニアリング
jacopen
3
170
The Tale of Leo: Brave Lion and Curious Little Bug
canalun
1
120
ガバクラのAWS長期継続割引 ~次の4/1に慌てないために~
hamijay_cloud
1
240
Writing Ruby Scripts with TypeProf
mame
0
170
アジャイル脅威モデリング#1(脅威モデリングナイト#8)
masakane55
3
230
“パスワードレス認証への道" ユーザー認証の変遷とパスキーの関係
ritou
1
600
読んで学ぶ Amplify Gen2 / Amplify と CDK の関係を紐解く #jawsug_tokyo
tacck
PRO
1
160
彩の国で始めよう。おっさんエンジニアから共有したい、当たり前のことを当たり前にする技術
otsuki
0
150
30代からでも遅くない! 内製開発の世界に飛び込み、最前線で戦うLLMアプリ開発エンジニアになろう
minorun365
PRO
10
2.6k
SnowflakeとDatabricks両方でRAGを構築してみた
kameitomohiro
1
420
4/17/25 - CIJUG - Java Meets AI: Build LLM-Powered Apps with LangChain4j (part 2)
edeandrea
PRO
0
110
「経験の点」の位置を意識したキャリア形成 / Career development with an awareness of the “point of experience” position
pauli
4
100
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
The Invisible Side of Design
smashingmag
299
50k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
29
5.6k
Six Lessons from altMBA
skipperchong
27
3.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.1k
The Cost Of JavaScript in 2023
addyosmani
49
7.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
How to Think Like a Performance Engineer
csswizardry
23
1.5k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.5k
Building Flexible Design Systems
yeseniaperezcruz
329
38k
How GitHub (no longer) Works
holman
314
140k
Transcript
rbperf: Understanding Ruby with BPF Javier Honduvilla Coto <javierhonduco@fb.com> 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 javierhonduco@fb.com @javierhonduco