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)

My First BCC

  • 1.
    My First BCC (BPFCompiler 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)