SlideShare a Scribd company logo
My First BCC
(BPF Compiler Collection)
2017/06/07 SAKURA Internet, Inc. Research Center SR / Naoto MATSUMOTO
(C) Copyright 1996-2017 SAKURA Internet Inc
My First BCC
2
SOURCE: SAKURA Internet Rsearch Center. (2017/06) Project Sprig.
# sudo su
# uname -sr; cat /etc/lsb-release
Linux 4.10.0-19-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"
# echo "deb [trusted=yes] https://repo.iovisor.org/apt/trusty trusty-nightly main" | tee /etc/apt/sources.list.d/iovisor.list
# apt-get update
# apt-get install bcc-tools libbcc-examples
# cd /usr/share/bcc/examples/
# ./hello_world.py
sshd-1415 [000] d... 2360.661916: : Hello, World!
sshd-13842 [000] d... 2360.722776: : Hello, World!
sshd-13842 [000] d... 2361.241498: : Hello, World!
sh-13844 [000] d... 2361.242180: : Hello, World!
# cat hello_world.py | grep -v "#"
from bcc import BPF
BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!n"); return 0; }').trace_print()
Single CPU benchmark (with single flow)
Very fast CPU: i7-6700K CPU @ 4.00GHz
NIC 50Gbit/s Mellanox-CX4 (driver: mlx5)
Drop: 4.7Mpps : iptables -t raw -I PREROUTING -p udp --dport 9 -j DROP
Drop: 16.9Mpps: XDP blacklist:
XDP – eXpress Data Path , Used for DDoS protection, Linux Kernel self protection, Learn writing eBPF code
Jesper Dangaard Brouer / Principal Engineer, Red Hat, OpenSourceDays ()March, 2017)

More Related Content

PDF
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
Naoto MATSUMOTO
 
PDF
How to install OpenStack MITAKA --allinone - cheat sheet -
Naoto MATSUMOTO
 
PDF
SPDK benchmark memo
Naoto MATSUMOTO
 
PDF
Apache Ignite In-Memory Computing Install memo
Naoto MATSUMOTO
 
PDF
How to ride a 100GbE LAN -MEMO-
Naoto MATSUMOTO
 
PDF
My First AMD EPYC 7251 memo
Naoto MATSUMOTO
 
PDF
RabbitMQ Server - cheat sheet -
Naoto MATSUMOTO
 
PDF
How to train your L3DSR with PBR - MEMO -
Naoto MATSUMOTO
 
redis-benchmark with AMD RYZEN 1800X Intel Kaby Lake (i7-7700K) memo
Naoto MATSUMOTO
 
How to install OpenStack MITAKA --allinone - cheat sheet -
Naoto MATSUMOTO
 
SPDK benchmark memo
Naoto MATSUMOTO
 
Apache Ignite In-Memory Computing Install memo
Naoto MATSUMOTO
 
How to ride a 100GbE LAN -MEMO-
Naoto MATSUMOTO
 
My First AMD EPYC 7251 memo
Naoto MATSUMOTO
 
RabbitMQ Server - cheat sheet -
Naoto MATSUMOTO
 
How to train your L3DSR with PBR - MEMO -
Naoto MATSUMOTO
 

What's hot (20)

PDF
How to twist a IPv6 over Bluetooth (6lowpan)
Naoto MATSUMOTO
 
PDF
redis-benchmark with AMD RYZEN 1800X memo
Naoto MATSUMOTO
 
PDF
My First XDP (eXpress Data Path)
Naoto MATSUMOTO
 
PDF
MQTTS mosquitto - cheat sheet -
Naoto MATSUMOTO
 
PDF
MariaDB ColumnStore column-oriented database Install memo
Naoto MATSUMOTO
 
PPTX
High Availability Server Clustering without ILB(Internal Load Balancer) (MEMO)
Naoto MATSUMOTO
 
PDF
UP Board AI Core Configuration memo
Naoto MATSUMOTO
 
PDF
ClickHouse column-oriented database Install memo
Naoto MATSUMOTO
 
PDF
Creación de máquinas virtuales basada en kernel usando qemu y virsh
Jonathan Franchesco Torres Baca
 
PDF
An Easy way to build a server cluster without top of rack switches (MEMO)
Naoto MATSUMOTO
 
PDF
GCC ARM nRF51 IoT SDK -cheat sheet-
Naoto MATSUMOTO
 
ODP
LSA2 - 02 Namespaces
Marian Marinov
 
PDF
Scaling IO-bound microservices
Salo Shp
 
PDF
Openstack installation using rdo
Narasimha sreeram
 
PDF
Openstack kilo installation using rdo
Narasimha sreeram
 
PDF
Openstack installation using rdo multi node
Narasimha sreeram
 
PPT
Linux Server Start
Gavin Quan
 
PDF
NetBSDworkshop
Jun Ebihara
 
PDF
How to burn your GPU with CUDA9.1
Naoto MATSUMOTO
 
ODP
LSA2 - 02 Control Groups
Marian Marinov
 
How to twist a IPv6 over Bluetooth (6lowpan)
Naoto MATSUMOTO
 
redis-benchmark with AMD RYZEN 1800X memo
Naoto MATSUMOTO
 
My First XDP (eXpress Data Path)
Naoto MATSUMOTO
 
MQTTS mosquitto - cheat sheet -
Naoto MATSUMOTO
 
MariaDB ColumnStore column-oriented database Install memo
Naoto MATSUMOTO
 
High Availability Server Clustering without ILB(Internal Load Balancer) (MEMO)
Naoto MATSUMOTO
 
UP Board AI Core Configuration memo
Naoto MATSUMOTO
 
ClickHouse column-oriented database Install memo
Naoto MATSUMOTO
 
Creación de máquinas virtuales basada en kernel usando qemu y virsh
Jonathan Franchesco Torres Baca
 
An Easy way to build a server cluster without top of rack switches (MEMO)
Naoto MATSUMOTO
 
GCC ARM nRF51 IoT SDK -cheat sheet-
Naoto MATSUMOTO
 
LSA2 - 02 Namespaces
Marian Marinov
 
Scaling IO-bound microservices
Salo Shp
 
Openstack installation using rdo
Narasimha sreeram
 
Openstack kilo installation using rdo
Narasimha sreeram
 
Openstack installation using rdo multi node
Narasimha sreeram
 
Linux Server Start
Gavin Quan
 
NetBSDworkshop
Jun Ebihara
 
How to burn your GPU with CUDA9.1
Naoto MATSUMOTO
 
LSA2 - 02 Control Groups
Marian Marinov
 
Ad

Similar to My First BCC (20)

PDF
DCSF 19 eBPF Superpowers
Docker, Inc.
 
PDF
UM2019 Extended BPF: A New Type of Software
Brendan Gregg
 
PDF
Efficient System Monitoring in Cloud Native Environments
Gergely Szabó
 
PDF
Kernel Recipes 2019 - BPF at Facebook
Anne Nicolas
 
PDF
BPF - in-kernel virtual machine
Alexei Starovoitov
 
PDF
Andrii Soldatenko "Dive into BPF performance tools using python"
Fwdays
 
PDF
Kernel bug hunting
Andrea Righi
 
PDF
Introduction to eBPF and XDP
lcplcp1
 
PDF
DEF CON 27 - JEFF DILEO - evil e bpf in depth
Felipe Prado
 
PDF
Introduction of eBPF - 時下最夯的Linux Technology
Jace Liang
 
PDF
Security Monitoring with eBPF
Alex Maestretti
 
PDF
Systems@Scale 2021 BPF Performance Getting Started
Brendan Gregg
 
PDF
BPF: Tracing and more
Brendan Gregg
 
PPTX
eBPF Workshop
Michael Kehoe
 
PDF
eBPF Trace from Kernel to Userspace
SUSE Labs Taipei
 
PPTX
eBPF Basics
Michael Kehoe
 
PDF
Linux 4.x Tracing Tools: Using BPF Superpowers
Brendan Gregg
 
PDF
Bpf performance tools chapter 4 bcc
Viller Hsiao
 
PDF
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
PDF
Building Network Functions with eBPF & BCC
Kernel TLV
 
DCSF 19 eBPF Superpowers
Docker, Inc.
 
UM2019 Extended BPF: A New Type of Software
Brendan Gregg
 
Efficient System Monitoring in Cloud Native Environments
Gergely Szabó
 
Kernel Recipes 2019 - BPF at Facebook
Anne Nicolas
 
BPF - in-kernel virtual machine
Alexei Starovoitov
 
Andrii Soldatenko "Dive into BPF performance tools using python"
Fwdays
 
Kernel bug hunting
Andrea Righi
 
Introduction to eBPF and XDP
lcplcp1
 
DEF CON 27 - JEFF DILEO - evil e bpf in depth
Felipe Prado
 
Introduction of eBPF - 時下最夯的Linux Technology
Jace Liang
 
Security Monitoring with eBPF
Alex Maestretti
 
Systems@Scale 2021 BPF Performance Getting Started
Brendan Gregg
 
BPF: Tracing and more
Brendan Gregg
 
eBPF Workshop
Michael Kehoe
 
eBPF Trace from Kernel to Userspace
SUSE Labs Taipei
 
eBPF Basics
Michael Kehoe
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Brendan Gregg
 
Bpf performance tools chapter 4 bcc
Viller Hsiao
 
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
Building Network Functions with eBPF & BCC
Kernel TLV
 
Ad

More from Naoto MATSUMOTO (20)

PDF
Alder Lake-S CPU Temperature Monitoring
Naoto MATSUMOTO
 
PDF
CPU製品出荷状況と消費電力の見える化
Naoto MATSUMOTO
 
PDF
5Gの見える化
Naoto MATSUMOTO
 
PDF
2023年以降のサーバークラスタリング設計(メモ)
Naoto MATSUMOTO
 
PDF
防災を考慮した水中調査の一考察
Naoto MATSUMOTO
 
PDF
旅するパケットの見える化
Naoto MATSUMOTO
 
PDF
LTE-M/NB IoTを試してみる nRF9160/Thingy:91
Naoto MATSUMOTO
 
PDF
災害時における無線モニタリングによる社会インフラの見える化
Naoto MATSUMOTO
 
PDF
BeautifulSoup / selenium Deep dive
Naoto MATSUMOTO
 
PDF
AMDGPU ROCm Deep dive
Naoto MATSUMOTO
 
PDF
Network Adapter Deep dive
Naoto MATSUMOTO
 
PDF
RTL2838 DVB-T Deep dive
Naoto MATSUMOTO
 
PDF
x86_64 Hardware Deep dive
Naoto MATSUMOTO
 
PDF
ADS-B, AIS, APRS cheatsheet
Naoto MATSUMOTO
 
PDF
curl --http3 cheatsheet
Naoto MATSUMOTO
 
PDF
3/4G USB modem Cheat Sheet
Naoto MATSUMOTO
 
PDF
How To Train Your ARM(SBC)
Naoto MATSUMOTO
 
PDF
全国におけるCOVID-19対策の見える化 ~宿泊業の場合~
Naoto MATSUMOTO
 
PDF
我が国の電波の使用状況/携帯電話向け割当 (2019年3月1日現在)
Naoto MATSUMOTO
 
PDF
私たちに訪れる(かもしれない)未来と計算機によるモノコトの見える化
Naoto MATSUMOTO
 
Alder Lake-S CPU Temperature Monitoring
Naoto MATSUMOTO
 
CPU製品出荷状況と消費電力の見える化
Naoto MATSUMOTO
 
5Gの見える化
Naoto MATSUMOTO
 
2023年以降のサーバークラスタリング設計(メモ)
Naoto MATSUMOTO
 
防災を考慮した水中調査の一考察
Naoto MATSUMOTO
 
旅するパケットの見える化
Naoto MATSUMOTO
 
LTE-M/NB IoTを試してみる nRF9160/Thingy:91
Naoto MATSUMOTO
 
災害時における無線モニタリングによる社会インフラの見える化
Naoto MATSUMOTO
 
BeautifulSoup / selenium Deep dive
Naoto MATSUMOTO
 
AMDGPU ROCm Deep dive
Naoto MATSUMOTO
 
Network Adapter Deep dive
Naoto MATSUMOTO
 
RTL2838 DVB-T Deep dive
Naoto MATSUMOTO
 
x86_64 Hardware Deep dive
Naoto MATSUMOTO
 
ADS-B, AIS, APRS cheatsheet
Naoto MATSUMOTO
 
curl --http3 cheatsheet
Naoto MATSUMOTO
 
3/4G USB modem Cheat Sheet
Naoto MATSUMOTO
 
How To Train Your ARM(SBC)
Naoto MATSUMOTO
 
全国におけるCOVID-19対策の見える化 ~宿泊業の場合~
Naoto MATSUMOTO
 
我が国の電波の使用状況/携帯電話向け割当 (2019年3月1日現在)
Naoto MATSUMOTO
 
私たちに訪れる(かもしれない)未来と計算機によるモノコトの見える化
Naoto MATSUMOTO
 

Recently uploaded (20)

PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
The Future of Artificial Intelligence (AI)
Mukul
 
Software Development Methodologies in 2025
KodekX
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 

My First BCC

  • 1. My First BCC (BPF Compiler Collection) 2017/06/07 SAKURA Internet, Inc. Research Center SR / Naoto MATSUMOTO (C) Copyright 1996-2017 SAKURA Internet Inc
  • 2. My First BCC 2 SOURCE: SAKURA Internet Rsearch Center. (2017/06) Project Sprig. # sudo su # uname -sr; cat /etc/lsb-release Linux 4.10.0-19-generic DISTRIB_ID=Ubuntu DISTRIB_RELEASE=17.04 DISTRIB_CODENAME=zesty DISTRIB_DESCRIPTION="Ubuntu 17.04" # echo "deb [trusted=yes] https://repo.iovisor.org/apt/trusty trusty-nightly main" | tee /etc/apt/sources.list.d/iovisor.list # apt-get update # apt-get install bcc-tools libbcc-examples # cd /usr/share/bcc/examples/ # ./hello_world.py sshd-1415 [000] d... 2360.661916: : Hello, World! sshd-13842 [000] d... 2360.722776: : Hello, World! sshd-13842 [000] d... 2361.241498: : Hello, World! sh-13844 [000] d... 2361.242180: : Hello, World! # cat hello_world.py | grep -v "#" from bcc import BPF BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!n"); return 0; }').trace_print() Single CPU benchmark (with single flow) Very fast CPU: i7-6700K CPU @ 4.00GHz NIC 50Gbit/s Mellanox-CX4 (driver: mlx5) Drop: 4.7Mpps : iptables -t raw -I PREROUTING -p udp --dport 9 -j DROP Drop: 16.9Mpps: XDP blacklist: XDP – eXpress Data Path , Used for DDoS protection, Linux Kernel self protection, Learn writing eBPF code Jesper Dangaard Brouer / Principal Engineer, Red Hat, OpenSourceDays ()March, 2017)