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
抽象化をするということ - 具体と抽象の往復を身につける / Abstraction and concretization
soudai
16
4k
目の前の仕事と向き合うことで成長できる - 仕事とスキルを広げる / Every little bit counts
soudai
24
7.1k
人はなぜISUCONに夢中になるのか
kakehashi
PRO
6
1.6k
CZII - CryoET Object Identification 参加振り返り・解法共有
tattaka
0
360
レビューを増やしつつ 高評価維持するテクニック
tsuzuki817
1
710
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
2
190
リアルタイム分析データベースで実現する SQLベースのオブザーバビリティ
mikimatsumoto
0
1.3k
エンジニアの育成を支える爆速フィードバック文化
sansantech
PRO
3
1.1k
インフラをつくるとはどういうことなのか、 あるいはPlatform Engineeringについて
nwiizo
5
2.6k
関東Kaggler会LT: 人狼コンペとLLM量子化について
nejumi
3
580
自動テストの世界に、この5年間で起きたこと
autifyhq
10
8.5k
Helm , Kustomize に代わる !? 次世代 k8s パッケージマネージャー Glasskube 入門 / glasskube-entry
parupappa2929
0
250
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
28
8.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Documentation Writing (for coders)
carmenintech
67
4.6k
A Philosophy of Restraint
colly
203
16k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
330
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.8k
Into the Great Unknown - MozCon
thekraken
35
1.6k
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