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
39
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
87
Spying Linux processes
javierhonduco
0
96
word2vec
javierhonduco
0
69
UC3M university cafeteria redesign
javierhonduco
0
83
Mac OSX UI toolkit and design guidelines
javierhonduco
0
120
Python for Java developers
javierhonduco
0
80
Other Decks in Technology
See All in Technology
IAMのマニアックな話 2025を執筆して、 見えてきたAWSアカウント管理の現在
nrinetcom
PRO
3
140
ソフトウェア開発現代史: "LeanとDevOpsの科学"の「科学」とは何か? - DORA Report 10年の変遷を追って - #開発生産性_findy
takabow
1
350
Autonomous Database サービス・アップデート (FY25)
oracle4engineer
PRO
1
750
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
38k
CSSの最新トレンド Ver.2025
tonkotsuboy_com
11
4.4k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
脅威をモデリングしてMCPのセキュリティ対策を考えよう
flatt_security
4
1.2k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
6
900
What's new in OpenShift 4.19
redhatlivestreaming
1
140
Model Mondays S2E01: Advanced Reasoning
nitya
0
210
Long journey of Continuous Delivery at Mercari
hisaharu
1
200
AI Engineering Summit Pre Event LT #10
okaru
2
550
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
GraphQLとの向き合い方2022年版
quramy
46
14k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
How to Ace a Technical Interview
jacobian
276
23k
Code Reviewing Like a Champion
maltzj
524
40k
Designing Experiences People Love
moore
142
24k
Raft: Consensus for Rubyists
vanstee
138
7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.6k
4 Signs Your Business is Dying
shpigford
183
22k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
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