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
30
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
79
Spying Linux processes
javierhonduco
0
92
word2vec
javierhonduco
0
59
UC3M university cafeteria redesign
javierhonduco
0
80
Mac OSX UI toolkit and design guidelines
javierhonduco
0
110
Python for Java developers
javierhonduco
0
76
Other Decks in Technology
See All in Technology
日経のデータベース事業とElasticsearch
hinatades
PRO
0
190
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
2
360
CDKのコードを書く環境を作りました with Amazon Q
nobuhitomorioka
1
130
内製化を加速させるlaC活用術
nrinetcom
PRO
2
100
AIエージェント入門
minorun365
PRO
6
1.7k
PHPで印刷所に入稿できる名札データを作る / Generating Print-Ready Name Tag Data with PHP
tomzoh
0
180
偏光画像処理ライブラリを作った話
elerac
1
150
IAMポリシーのAllow/Denyについて、改めて理解する
smt7174
2
180
Share my, our lessons from the road to re:Invent
naospon
0
130
抽象化をするということ - 具体と抽象の往復を身につける / Abstraction and concretization
soudai
27
14k
EDRの検知の仕組みと検知回避について
chayakonanaika
8
4.2k
ホワイトボードチャレンジ 説明&実行資料
ichimichi
0
140
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Producing Creativity
orderedlist
PRO
344
40k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
YesSQL, Process and Tooling at Scale
rocio
172
14k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
Navigating Team Friction
lara
183
15k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
52k
Designing Experiences People Love
moore
140
23k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
We Have a Design System, Now What?
morganepeng
51
7.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.3k
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