Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
BPF is a technology used in Linux for packet filtering, tracing or access auditing. BPF has its own VM and set of opcodes. If you want to write a program that loads and uses BPF binary, you can write it in any language including Ruby. However, to prepare a "BPF binary" itself, you generally need to write a bit weird C, and pass it to clang compiler using bpf target. Wouldn't it be great if we could make these BPF binaries entirely in Ruby? Rucy is intended to allow programmers to write their whole BPF programs in Ruby. I'll discuss how to "compile" BPF binaries from Ruby in this talk. RubyKaigi Takeout 2021: https://rubykaigi.org/2021-takeout/presentations/udzura.html
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
The video titled **'Story of Rucy - How to compile a BPF binary from Ruby'** features Uchio Kondo discussing a project named Rucy, which enables Ruby developers to write BPF binaries entirely in Ruby. BPF, or Berkeley Packet Filter, is a significant technology within Linux that allows user code to run safely and efficiently in the kernel. Initially designed for packet filtering, BPF has evolved for various applications including networking, server tracing, and observability. Key Points Discussed: - **Introduction to BPF**: Kondo defines BPF and its importance in Linux, describing it historically as a packet filter that has grown to deliver various functions, including improved observability and device access control. - **Using BPF from Ruby**: Kondo introduces his earlier project, rbcc, which serves as a Ruby binding for BCC (BPF Compiler Collection). He explains his motivation for creating rbcc stemmed from the lack of Ruby support in existing BCC tools. - **Challenges with BCC**: Kondo outlines some pitfalls of using BCC, such as compilation overhead and the complexity of setting up LLVM and Clang, especially in a container environment. - **Introduction to Rucy**: Rucy is presented as a solution that eliminates the need for C when compiling BPF programs. It is a Ruby compiler that translates Ruby scripts directly into BPF program binaries. - **Technical Details of Rucy**: The process involves interpreting Ruby code to generate BPF bytecode and handle various instruction sets specific to BPF and MLVM (its virtual machine). Kondo highlights some conversion challenges between MLVM and BPF instructions. - **Demonstrations of Rucy**: Kondo presents practical demonstrations, including compiling a Ruby script into a valid ELF format BPF binary and showing its functionality by filtering resource access through cgroups and tracing kernel functions. - **Future Goals**: Kondo outlines his aspirations to expand Rucy’s functionality, including handling BPF map data structures and implementing more features to enable real-world BPF operations. In conclusion, Rucy aims to simplify BPF programming by allowing Rubyists to write BPF codes in Ruby, significantly enhancing ease of use and reducing the need for context-switching between programming environments. This innovation could lead to broader usage of BPF technology within the Ruby community, as Kondo looks to expand the capabilities of Rucy in future developments.
Suggest modifications
Cancel