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
26
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
68
Spying Linux processes
javierhonduco
0
76
word2vec
javierhonduco
0
57
UC3M university cafeteria redesign
javierhonduco
0
62
Mac OSX UI toolkit and design guidelines
javierhonduco
0
85
Python for Java developers
javierhonduco
0
64
Other Decks in Technology
See All in Technology
エンタープライズ環境下での Active Directory の運用 TIPS
tamaiyutaro
1
1.6k
コンテナセキュリティの基本と脅威への対策
kyohmizu
3
690
ここが嬉しいABAC ここが辛いよABAC #再解説+補足編
masahirokawahara
0
220
AIQ株式会社 エンジニア向け会社紹介資料
aiqlab
0
370
Apple Vision Pro trial session
akkeylab
0
120
反実仮想機械学習とは何か
usaito
PRO
6
2.1k
シン・Kafka / shin-kafka
oracle4engineer
PRO
7
2.7k
0→1開発における技術選定において一番大切なこと
bicstone
1
320
強みを伸ばすキャリアデザイン
yug1224
0
200
検証を通して見えてきたTiDBの性能特性
lycorptech_jp
PRO
6
3.3k
「ふりかえりのふりかえり」をふりかえり、実のあるふりかえりにする
naitosatoshi
0
220
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
3
2.3k
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
220
21k
Building Applications with DynamoDB
mza
88
5.6k
Making the Leap to Tech Lead
cromwellryan
123
8.5k
RailsConf 2023
tenderlove
2
530
The Pragmatic Product Professional
lauravandoore
24
5.8k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
Reflections from 52 weeks, 52 projects
jeffersonlam
344
19k
Imperfection Machines: The Place of Print at Facebook
scottboms
258
12k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
13
1.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.4k
Designing for Performance
lara
601
67k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.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