SlideShare a Scribd company logo
Performance Analysis
Superpowers with Linux BPF
Brendan Gregg
Sep	2017
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
bcc/BPF tools
DEMO

Recommended for you

Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing

This document discusses how eBPF (extended Berkeley Packet Filter) can be used for kernel tracing. It provides an overview of BPF and eBPF, how eBPF programs are compiled and run in the kernel, the use of BPF maps, and how eBPF enables new possibilities for dynamic kernel instrumentation through techniques like Kprobes and ftrace.

ebpftracinglinux
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring

Presentation about Linux Performance Profiling and Monitoring, held at OSDC 2015 - a conference powered by NETWAYS.

linux performance profiling
Netflix: From Clouds to Roots
Netflix: From Clouds to RootsNetflix: From Clouds to Roots
Netflix: From Clouds to Roots

Surge 2014: From Clouds to Roots: root cause performance analysis at Netflix. Brendan Gregg. At Netflix, high scale and fast deployment rule. The possibilities for failure are endless, and the environment excels at handling this, regularly tested and exercised by the simian army. But, when this environment automatically works around systemic issues that aren’t root-caused, they can grow over time. This talk describes the challenge of not just handling failures of scale on the Netflix cloud, but also new approaches and tools for quickly diagnosing their root cause in an ever changing environment.

Agenda
1. eBPF & bcc
2. bcc/BPF CLI Tools 3. bcc/BPF Visualizations
Take aways
1.  Understand Linux tracing and enhanced BPF
2.  How to use BPF tools
3.  Areas of future development
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
Who	at	Ne/lix	will	use	BPF?

Recommended for you

Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016

Talk for PerconaLive 2016 by Brendan Gregg. Video: https://www.youtube.com/watch?v=CbmEDXq7es0 . "Systems performance provides a different perspective for analysis and tuning, and can help you find performance wins for your databases, applications, and the kernel. However, most of us are not performance or kernel engineers, and have limited time to study this topic. This talk summarizes six important areas of Linux systems performance in 50 minutes: observability tools, methodologies, benchmarking, profiling, tracing, and tuning. Included are recipes for Linux performance analysis and tuning (using vmstat, mpstat, iostat, etc), overviews of complex areas including profiling (perf_events), static tracing (tracepoints), and dynamic tracing (kprobes, uprobes), and much advice about what is and isn't important to learn. This talk is aimed at everyone: DBAs, developers, operations, etc, and in any environment running Linux, bare-metal or the cloud."

Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools

Video: https://www.youtube.com/watch?v=FJW8nGV4jxY and https://www.youtube.com/watch?v=zrr2nUln9Kk . Tutorial slides for O'Reilly Velocity SC 2015, by Brendan Gregg. There are many performance tools nowadays for Linux, but how do they all fit together, and when do we use them? This tutorial explains methodologies for using these tools, and provides a tour of four tool types: observability, benchmarking, tuning, and static tuning. Many tools will be discussed, including top, iostat, tcpdump, sar, perf_events, ftrace, SystemTap, sysdig, and others, as well observability frameworks in the Linux kernel: PMCs, tracepoints, kprobes, and uprobes. This tutorial is updated and extended on an earlier talk that summarizes the Linux performance tool landscape. The value of this tutorial is not just learning that these tools exist and what they do, but hearing when and how they are used by a performance engineer to solve real world problems — important context that is typically not included in the standard documentation.

linux performance tools tracing
Linux kernel memory allocators
Linux kernel memory allocatorsLinux kernel memory allocators
Linux kernel memory allocators

Introduction to kernel memory allocators: buddy system, slab, vmalloc(), etc. and a simple comparison

memory allocatorsvmallockmalloc
BPF
Introducing enhanced BPF for tracing: kernel-level
software
Ye Olde BPF
Berkeley	Packet	Filter	
# tcpdump host 127.0.0.1 and port 22 -d
(000) ldh [12]
(001) jeq #0x800 jt 2 jf 18
(002) ld [26]
(003) jeq #0x7f000001 jt 6 jf 4
(004) ld [30]
(005) jeq #0x7f000001 jt 6 jf 18
(006) ldb [23]
(007) jeq #0x84 jt 10 jf 8
(008) jeq #0x6 jt 10 jf 9
(009) jeq #0x11 jt 10 jf 18
(010) ldh [20]
(011) jset #0x1fff jt 18 jf 12
(012) ldxb 4*([14]&0xf)
(013) ldh [x + 14]
[...]
User-defined bytecode
executed by an in-kernel
sandboxed virtual machine
Steven McCanne and Van Jacobson, 1993
2 x 32-bit registers
& scratch memory
Optimizes packet filter
performance
Enhanced BPF
aka	eBPF	or	just	"BPF"	
Alexei Starovoitov, 2014+
10 x 64-bit registers
maps (hashes)
actions
BPF for Tracing, Internals
BPF
bytecode
Observability Program Kernel
tracepoints
kprobes
uprobes
BPF
maps
per-event
data
statistics
verifier
output
static tracing
dynamic tracing
async
copy
perf_events
sampling, PMCs
BPF
program
event config
attach
load
Enhanced BPF is also now used for SDNs, DDOS mitigation, intrusion detection, container security, …

Recommended for you

Memory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux KernelMemory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux Kernel

Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).

linux kernelmemory mappingmmap
Slab Allocator in Linux Kernel
Slab Allocator in Linux KernelSlab Allocator in Linux Kernel
Slab Allocator in Linux Kernel

Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).

linux kernelslabslub
YOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at NetflixYOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at Netflix

Keynote by Brendan Gregg for YOW! 2018. Video: https://www.youtube.com/watch?v=03EC8uA30Pw . Description: "At Netflix, improving the performance of our cloud means happier customers and lower costs, and involves root cause analysis of applications, runtimes, operating systems, and hypervisors, in an environment of 150k cloud instances that undergo numerous production changes each week. Apart from the developers who regularly optimize their own code , we also have a dedicated performance team to help with any issue across the cloud, and to build tooling to aid in this analysis. In this session we will summarize the Netflix environment, procedures, and tools we use and build t o do root cause analysis on cloud performance issues. The analysis performed may be cloud-wide, using self-service GUIs such as our open source Atlas tool, or focused on individual instances, and use our open source Vector tool, f lame graphs, Java debuggers, and tooling that uses Linux perf, ftrace, and bcc/eBPF. You can use these open source tools in the same way to find performance wins in your own environment."

performancelinux
Dynamic Tracing
1999: Kerninst
http://www.paradyn.org/html/kerninst.html
Event Tracing Efficiency
send
receive
tcpdump
Kernel	
buffer
file system
1. read
2. dump
Analyzer 1. read
2. process
3. print
disks
Old way: packet capture
New way: dynamic tracing
Tracer 1. configure
2. read
tcp_retransmit_skb()
E.g., tracing TCP retransmits
Linux Events & BPF Support
Linux	4.3	
Linux	4.7	 Linux	4.9	
Linux	4.9	
Linux	4.1	
BPF	stacks	
Linux	4.6	
BPF	output	
Linux	4.4	
(version	
BPF	
support	
arrived)

Recommended for you

BPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveBPF Hardware Offload Deep Dive
BPF Hardware Offload Deep Dive

The first version of eBPF hardware offload was merged into the Linux kernel in October 2016 and became part of Linux v4.9. For the last two years the project has been growing and evolving to integrate more closely with the core kernel infrastructure and enable more advanced use cases. This talk will explain the internals of the kernel architecture of the offload and how it allows seamless execution of unmodified eBPF datapaths in HW.

ebpfnetronomesmartnic
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance

Talk for YOW! by Brendan Gregg. "Systems performance studies the performance of computing systems, including all physical components and the full software stack to help you find performance wins for your application and kernel. However, most of us are not performance or kernel engineers, and have limited time to study this topic. This talk summarizes the topic for everyone, touring six important areas: observability tools, methodologies, benchmarking, profiling, tracing, and tuning. Included are recipes for Linux performance analysis and tuning (using vmstat, mpstat, iostat, etc), overviews of complex areas including profiling (perf_events) and tracing (ftrace, bcc/BPF, and bpftrace/BPF), advice about what is and isn't important to learn, and case studies to see how it is applied. This talk is aimed at everyone: developers, operations, sysadmins, etc, and in any environment running Linux, bare metal or the cloud. "

linuxperformance
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix

This document discusses using the Linux perf profiling tool at Netflix. It begins with an overview of why Netflix needs Linux profiling to understand CPU usage quickly and completely. It then provides an introduction to the perf tool, covering its basic workflow and commands. The document discusses profiling CPU usage with perf, including potential issues like JIT runtimes and missing symbols. It provides several examples of perf commands for listing, counting, and recording events. The overall summary is that perf allows Netflix to quickly and accurately profile CPU usage across the entire software stack, from applications to libraries to the kernel, to optimize performance.

linuxperformanceperf
A Linux Tracing Timeline
-  1990’s: Static tracers, prototype dynamic tracers
-  2000: LTT + DProbes (dynamic tracing; not integrated)
-  2004: kprobes (2.6.9)
-  2005: DTrace (not Linux), SystemTap (out-of-tree)
-  2008: ftrace (2.6.27)
-  2009: perf_events (2.6.31)
-  2009: tracepoints (2.6.32)
-  2010-2017: ftrace & perf_events enhancements
-  2012: uprobes (3.5)
-  2014-2017: enhanced BPF patches: supporting tracing events
-  2016-2017: ftrace hist triggers
also: LTTng, ktap, sysdig, ...
BCC
Introducing BPF Complier Collection: user-level
front-end
bcc
•  BPF Compiler Collection
–  https://github.com/iovisor/bcc
–  Lead developer: Brenden Blanco
•  Includes tracing tools
•  Provides BPF front-ends:
–  Python
–  Lua
–  C++
–  C helper libraries
–  golang (gobpf)
BPF
Python
Events
Kernel
lua
bcc
front-ends
bcc tool bcc tool …
…
user
kernel
Tracing layers:
Raw BPF
samples/bpf/sock_example.c	
87	lines	truncated

Recommended for you

What Linux can learn from Solaris performance and vice-versa
What Linux can learn from Solaris performance and vice-versaWhat Linux can learn from Solaris performance and vice-versa
What Linux can learn from Solaris performance and vice-versa

The document discusses performance differences between Linux and Solaris (SmartOS). It begins by providing an example of a Perl program that runs 14% slower on one system versus the other. This example is used to explore potential reasons for performance differences between operating systems. The document then categorizes differences into major ("big") differences, such as kernel features, and minor ("small") differences, such as tunable parameters. Several major performance-related features of both Linux and Solaris are highlighted. The document cautions against a "Not Invented Here" viewpoint and suggests areas where each system could potentially learn from the other to improve performance.

performance linux solaris smartos
Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)

Talk by Brendan Gregg for USENIX LISA 2021. https://www.youtube.com/watch?v=5nN1wjA_S30 . "The future of computer performance involves clouds with hardware hypervisors and custom processors, servers running a new type of BPF software to allow high-speed applications and kernel customizations, observability of everything in production, new Linux kernel technologies, and more. This talk covers interesting developments in systems and computing performance, their challenges, and where things are headed."

performance
Introduction to Perf
Introduction to PerfIntroduction to Perf
Introduction to Perf

Perf is a Linux profiler tool that uses performance monitoring hardware to count various events like CPU cycles, instructions, and cache misses. It can count events for a single thread, entire process, specific CPUs, or system-wide. Perf stat is used to count events during process execution, while perf record collects profiling data in a file for later analysis with perf report.

perf performance linux
C/BPF
samples/bpf/tracex1_kern.c	
58	lines	truncated
bcc/BPF (C & Python)
bcc	examples/tracing/bitehist.py	
enBre	program
bpftrace
hHps://github.com/ajor/bpJrace	
enBre	program
The Tracing Landscape, Sep 2017
Scope & Capability
Easeofuse
sysdig
perf
ftrace
C/BPF
ktap
stap
Stage of
Development
(my opinion)
dtrace4L.
(brutal)(lessbrutal)
(alpha) (mature)
bcc/BPF
ply/BPF
Raw BPF
LTTng
(hist triggers)recent changes
(many)
bpftrace

Recommended for you

Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack

- The document discusses Linux network stack monitoring and configuration. It begins with definitions of key concepts like RSS, RPS, RFS, LRO, GRO, DCA, XDP and BPF. - It then provides an overview of how the network stack works from the hardware interrupts and driver level up through routing, TCP/IP and to the socket level. - Monitoring tools like ethtool, ftrace and /proc/interrupts are described for viewing hardware statistics, software stack traces and interrupt information.

linuxnetworkkernel
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKB

Describes the bootstrapping part in Linux, and related architectural mechanisms and technologies. This is the part two of the slides, and the succeeding slides may contain the errata for this slide.

Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF

Talk by Brendan Gregg at Kernel Recipes 2017 (Paris): "The in-kernel Berkeley Packet Filter (BPF) has been enhanced in recent kernels to do much more than just filtering packets. It can now run user-defined programs on events, such as on tracepoints, kprobes, uprobes, and perf_events, allowing advanced performance analysis tools to be created. These can be used in production as the BPF virtual machine is sandboxed and will reject unsafe code, and are already in use at Netflix. Beginning with the bpf() syscall in 3.18, enhancements have been added in many kernel versions since, with major features for BPF analysis landing in Linux 4.1, 4.4, 4.7, and 4.9. Specific capabilities these provide include custom in-kernel summaries of metrics, custom latency measurements, and frequency counting kernel and user stack traces on events. One interesting case involves saving stack traces on wake up events, and associating them with the blocked stack trace: so that we can see the blocking stack trace and the waker together, merged in kernel by a BPF program (that particular example is in the kernel as samples/bpf/offwaketime). This talk will discuss the new BPF capabilities for performance analysis and debugging, and demonstrate the new open source tools that have been developed to use it, many of which are in the Linux Foundation iovisor bcc (BPF Compiler Collection) project. These include tools to analyze the CPU scheduler, TCP performance, file system performance, block I/O, and more."

bpflinuxlinux performance tracing
BCC/BPF CLI Tools
Performance Analysis
Pre-BPF: Linux Perf Analysis in 60s
1.  uptime
2.  dmesg -T | tail
3.  vmstat 1
4.  mpstat -P ALL 1
5.  pidstat 1
6.  iostat -xz 1
7.  free -m
8.  sar -n DEV 1
9.  sar -n TCP,ETCP 1
10.  top
hHp://techblog.ne/lix.com/2015/11/linux-performance-analysis-in-60s.html
bcc Installation
•  https://github.com/iovisor/bcc/blob/master/INSTALL.md
•  eg, Ubuntu Xenial:
–  Also available as an Ubuntu snap
–  Ubuntu 16.04 is good, 16.10 better: more tools work
•  Installs many tools
–  In /usr/share/bcc/tools, and …/tools/old for older kernels
# echo "deb [trusted=yes] https://repo.iovisor.org/apt/xenial xenial-nightly main" |

sudo tee /etc/apt/sources.list.d/iovisor.list
# sudo apt-get update
# sudo apt-get install bcc-tools
bcc General Performance Checklist
1.  execsnoop
2.  opensnoop
3.  ext4slower (…)
4.  biolatency
5.  biosnoop
6.  cachestat
7.  tcpconnect
8.  tcpaccept
9.  tcpretrans
10.  gethostlatency
11.  runqlat
12.  profile

Recommended for you

Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...

The in-kernel Berkeley Packet Filter (BPF) has been enhanced in recent kernels to do much more than just filtering packets. It can now run user-defined programs on events, such as on tracepoints, kprobes, uprobes, and perf_events, allowing advanced performance analysis tools to be created. These can be used in production as the BPF virtual machine is sandboxed and will reject unsafe code, and are already in use at Netflix. Beginning with the bpf() syscall in 3.18, enhancements have been added in many kernel versions since, with major features for BPF analysis landing in Linux 4.1, 4.4, 4.7, and 4.9. Specific capabilities these provide include custom in-kernel summaries of metrics, custom latency measurements, and frequency counting kernel and user stack traces on events. One interesting case involves saving stack traces on wake up events, and associating them with the blocked stack trace: so that we can see the blocking stack trace and the waker together, merged in kernel by a BPF program (that particular example is in the kernel as samples/bpf/offwaketime). This talk will discuss the new BPF capabilities for performance analysis and debugging, and demonstrate the new open source tools that have been developed to use it, many of which are in the Linux Foundation iovisor bcc (BPF Compiler Collection) project. These include tools to analyze the CPU scheduler, TCP performance, file system performance, block I/O, and more. Brendan Gregg, Netflix

linux kernelperformanceoptimization
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPFUSENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPF

Talk for USENIX ATC 2017 by Brendan Gregg "The Berkeley Packet Filter (BPF) in Linux has been enhanced in very recent versions to do much more than just filter packets, and has become a hot area of operating systems innovation, with much more yet to be discovered. BPF is a sandboxed virtual machine that runs user-level defined programs in kernel context, and is part of many kernels. The Linux enhancements allow it to run custom programs on other events, including kernel- and user-level dynamic tracing (kprobes and uprobes), static tracing (tracepoints), and hardware events. This is finding uses for the generation of new performance analysis tools, network acceleration technologies, and security intrusion detection systems. This talk will explain the BPF enhancements, then discuss the new performance observability tools that are in use and being created, especially from the BPF compiler collection (bcc) open source project. These tools provide new insights for file system and storage performance, CPU scheduler performance, TCP performance, and much more. This is a major turning point for Linux systems engineering, as custom advanced performance instrumentation can be used safely in production environments, powering a new generation of tools and visualizations. Because these BPF enhancements are only in very recent Linux (such as Linux 4.9), most companies are not yet running new enough kernels to be exploring BPF yet. This will change in the next year or two, as companies including Netflix upgrade their kernels. This talk will give you a head start on this growing technology, and also discuss areas of future work and unsolved problems."

linux performancebpflinux
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix

This document provides an overview of Brendan Gregg's presentation on BPF performance analysis at Netflix. It discusses: - Why BPF is changing the Linux OS model to become more event-based and microkernel-like. - The internals of BPF including its origins, instruction set, execution model, and how it is integrated into the Linux kernel. - How BPF enables a new class of custom, efficient, and safe performance analysis tools for analyzing various Linux subsystems like CPUs, memory, disks, networking, applications, and the kernel. - Examples of specific BPF-based performance analysis tools developed by Netflix, AWS, and others for analyzing tasks, scheduling, page faults

bpflinuxperformance
Discover short-lived process issues using execsnoop
# execsnoop -t
TIME(s) PCOMM PID PPID RET ARGS
0.031 dirname 23832 23808 0 /usr/bin/dirname /apps/tomcat/bin/catalina.sh
0.888 run 23833 2344 0 ./run
0.889 run 23833 2344 -2 /command/bash
0.889 run 23833 2344 -2 /usr/local/bin/bash
0.889 run 23833 2344 -2 /usr/local/sbin/bash
0.889 bash 23833 2344 0 /bin/bash
0.894 svstat 23835 23834 0 /command/svstat /service/nflx-httpd
0.894 perl 23836 23834 0 /usr/bin/perl -e $l=<>;$l=~/(d+) sec/;print $1||0;
0.899 ps 23838 23837 0 /bin/ps --ppid 1 -o pid,cmd,args
0.900 grep 23839 23837 0 /bin/grep org.apache.catalina
0.900 sed 23840 23837 0 /bin/sed s/^ *//;
0.900 cut 23841 23837 0 /usr/bin/cut -d -f 1
0.901 xargs 23842 23837 0 /usr/bin/xargs
0.912 xargs 23843 23842 -2 /command/echo
0.912 xargs 23843 23842 -2 /usr/local/bin/echo
0.912 xargs 23843 23842 -2 /usr/local/sbin/echo
0.912 echo 23843 23842 0 /bin/echo
[...]
Efficient:	only	traces	exec()
Discover short-lived process issues using execsnoop
# execsnoop -t
TIME(s) PCOMM PID PPID RET ARGS
0.031 dirname 23832 23808 0 /usr/bin/dirname /apps/tomcat/bin/catalina.sh
0.888 run 23833 2344 0 ./run
0.889 run 23833 2344 -2 /command/bash
0.889 run 23833 2344 -2 /usr/local/bin/bash
0.889 run 23833 2344 -2 /usr/local/sbin/bash
0.889 bash 23833 2344 0 /bin/bash
0.894 svstat 23835 23834 0 /command/svstat /service/nflx-httpd
0.894 perl 23836 23834 0 /usr/bin/perl -e $l=<>;$l=~/(d+) sec/;print $1||0;
0.899 ps 23838 23837 0 /bin/ps --ppid 1 -o pid,cmd,args
0.900 grep 23839 23837 0 /bin/grep org.apache.catalina
0.900 sed 23840 23837 0 /bin/sed s/^ *//;
0.900 cut 23841 23837 0 /usr/bin/cut -d -f 1
0.901 xargs 23842 23837 0 /usr/bin/xargs
0.912 xargs 23843 23842 -2 /command/echo
0.912 xargs 23843 23842 -2 /usr/local/bin/echo
0.912 xargs 23843 23842 -2 /usr/local/sbin/echo
0.912 echo 23843 23842 0 /bin/echo
[...]
Efficient:	only	traces	exec()
Exonerate or confirm storage latency outliers with ext4slower
# /usr/share/bcc/tools/ext4slower 1
Tracing ext4 operations slower than 1 ms
TIME COMM PID T BYTES OFF_KB LAT(ms) FILENAME
17:31:42 postdrop 15523 S 0 0 2.32 5630D406E4
17:31:42 cleanup 15524 S 0 0 1.89 57BB7406EC
17:32:09 titus-log-ship 19735 S 0 0 1.94 slurper_checkpoint.db
17:35:37 dhclient 1061 S 0 0 3.32 dhclient.eth0.leases
17:35:39 systemd-journa 504 S 0 0 26.62 system.journal
17:35:39 systemd-journa 504 S 0 0 1.56 system.journal
17:35:39 systemd-journa 504 S 0 0 1.73 system.journal
17:35:45 postdrop 16187 S 0 0 2.41 C0369406E4
17:35:45 cleanup 16188 S 0 0 6.52 C1B90406EC
[…]
Tracing	at	the	file	system	is	a	more	reliable	and	complete	indicator	than	measuring	disk	I/O	latency	
Also:	btrfsslower,	xfsslower,	zfsslower
Exonerate or confirm storage latency outliers with ext4slower
# /usr/share/bcc/tools/ext4slower 1
Tracing ext4 operations slower than 1 ms
TIME COMM PID T BYTES OFF_KB LAT(ms) FILENAME
17:31:42 postdrop 15523 S 0 0 2.32 5630D406E4
17:31:42 cleanup 15524 S 0 0 1.89 57BB7406EC
17:32:09 titus-log-ship 19735 S 0 0 1.94 slurper_checkpoint.db
17:35:37 dhclient 1061 S 0 0 3.32 dhclient.eth0.leases
17:35:39 systemd-journa 504 S 0 0 26.62 system.journal
17:35:39 systemd-journa 504 S 0 0 1.56 system.journal
17:35:39 systemd-journa 504 S 0 0 1.73 system.journal
17:35:45 postdrop 16187 S 0 0 2.41 C0369406E4
17:35:45 cleanup 16188 S 0 0 6.52 C1B90406EC
[…]
Tracing	at	the	file	system	is	a	more	reliable	and	complete	indicator	than	measuring	disk	I/O	latency	
Also:	btrfsslower,	xfsslower,	zfsslower

Recommended for you

bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges

Brendan Gregg discusses the current state and future potential of BPF and BCC tools for observability in Linux. He outlines 18 areas where BPF support has progressed and 16 areas still needing work. Gregg also discusses challenges like dynamic tracing stability, overhead, ease of coding, and developing visualizations. He proposes finishing ports of his old DTrace tools and links to resources on BPF, BCC, and flame graphs.

io visor summitlinuxlinux foundation
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017

Slides from a discussion at the IOVisor workshop in Feb 2017, about BPF performance and observability tools.

bpfebpf
Velocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPF

Talk by for Velocity 2017 by Brendan Gregg: Performance analysis superpowers with Linux eBPF. "Advanced performance observability and debugging have arrived built into the Linux 4.x series, thanks to enhancements to Berkeley Packet Filter (BPF, or eBPF) and the repurposing of its sandboxed virtual machine to provide programmatic capabilities to system tracing. Netflix has been investigating its use for new observability tools, monitoring, security uses, and more. This talk will investigate this new technology, which sooner or later will be available to everyone who uses Linux. The talk will dive deep on these new tracing, observability, and debugging capabilities. Whether you’re doing analysis over an ssh session, or via a monitoring GUI, BPF can be used to provide an efficient, custom, and deep level of detail into system and application performance. This talk will also demonstrate the new open source tools that have been developed, which make use of kernel- and user-level dynamic tracing (kprobes and uprobes), and kernel- and user-level static tracing (tracepoints). These tools provide new insights for file system and storage performance, CPU scheduler performance, TCP performance, and a whole lot more. This is a major turning point for Linux systems engineering, as custom advanced performance instrumentation can be used safely in production environments, powering a new generation of tools and visualizations."

linux performance tracingebpfperformance
Identify multimodal disk I/O latency and outliers with biolatency
# biolatency -mT 10
Tracing block device I/O... Hit Ctrl-C to end.
19:19:04
msecs : count distribution
0 -> 1 : 238 |********* |
2 -> 3 : 424 |***************** |
4 -> 7 : 834 |********************************* |
8 -> 15 : 506 |******************** |
16 -> 31 : 986 |****************************************|
32 -> 63 : 97 |*** |
64 -> 127 : 7 | |
128 -> 255 : 27 |* |
19:19:14
msecs : count distribution
0 -> 1 : 427 |******************* |
2 -> 3 : 424 |****************** |
[…]
Average	latency	(iostat/sar)	may	not	be	represen[[ve	with	mul[ple	modes	or	outliers	
The	"count"	column	is	
summarized	in-kernel
Identify multimodal disk I/O latency and outliers with biolatency
# biolatency -mT 10
Tracing block device I/O... Hit Ctrl-C to end.
19:19:04
msecs : count distribution
0 -> 1 : 238 |********* |
2 -> 3 : 424 |***************** |
4 -> 7 : 834 |********************************* |
8 -> 15 : 506 |******************** |
16 -> 31 : 986 |****************************************|
32 -> 63 : 97 |*** |
64 -> 127 : 7 | |
128 -> 255 : 27 |* |
19:19:14
msecs : count distribution
0 -> 1 : 427 |******************* |
2 -> 3 : 424 |****************** |
[…]
Average	latency	(iostat/sar)	may	not	be	represen[[ve	with	mul[ple	modes	or	outliers	
The	"count"	column	is	
summarized	in-kernel
Efficiently trace TCP sessions with PID and bytes using tcplife
# /usr/share/bcc/tools/tcplife
PID COMM LADDR LPORT RADDR RPORT TX_KB RX_KB MS
2509 java 100.82.34.63 8078 100.82.130.159 12410 0 0 5.44
2509 java 100.82.34.63 8078 100.82.78.215 55564 0 0 135.32
2509 java 100.82.34.63 60778 100.82.207.252 7001 0 13 15126.87
2509 java 100.82.34.63 38884 100.82.208.178 7001 0 0 15568.25
2509 java 127.0.0.1 4243 127.0.0.1 42166 0 0 0.61
2509 java 127.0.0.1 42166 127.0.0.1 4243 0 0 0.67
12030 upload-mes 127.0.0.1 34020 127.0.0.1 8078 11 0 3.38
2509 java 127.0.0.1 8078 127.0.0.1 34020 0 11 3.41
12030 upload-mes 127.0.0.1 21196 127.0.0.1 7101 0 0 12.61
3964 mesos-slav 127.0.0.1 7101 127.0.0.1 21196 0 0 12.64
12021 upload-sys 127.0.0.1 34022 127.0.0.1 8078 372 0 15.28
2509 java 127.0.0.1 8078 127.0.0.1 34022 0 372 15.31
2235 dockerd 100.82.34.63 13730 100.82.136.233 7002 0 4 18.50
2235 dockerd 100.82.34.63 34314 100.82.64.53 7002 0 8 56.73
[...]
Dynamic	tracing	of	TCP	set	state	only;	does	not	trace	send/receive	
Also	see:	tcpconnect,	tcpaccept,	tcpretrans
Efficiently trace TCP sessions with PID and bytes using tcplife
# /usr/share/bcc/tools/tcplife
PID COMM LADDR LPORT RADDR RPORT TX_KB RX_KB MS
2509 java 100.82.34.63 8078 100.82.130.159 12410 0 0 5.44
2509 java 100.82.34.63 8078 100.82.78.215 55564 0 0 135.32
2509 java 100.82.34.63 60778 100.82.207.252 7001 0 13 15126.87
2509 java 100.82.34.63 38884 100.82.208.178 7001 0 0 15568.25
2509 java 127.0.0.1 4243 127.0.0.1 42166 0 0 0.61
2509 java 127.0.0.1 42166 127.0.0.1 4243 0 0 0.67
12030 upload-mes 127.0.0.1 34020 127.0.0.1 8078 11 0 3.38
2509 java 127.0.0.1 8078 127.0.0.1 34020 0 11 3.41
12030 upload-mes 127.0.0.1 21196 127.0.0.1 7101 0 0 12.61
3964 mesos-slav 127.0.0.1 7101 127.0.0.1 21196 0 0 12.64
12021 upload-sys 127.0.0.1 34022 127.0.0.1 8078 372 0 15.28
2509 java 127.0.0.1 8078 127.0.0.1 34022 0 372 15.31
2235 dockerd 100.82.34.63 13730 100.82.136.233 7002 0 4 18.50
2235 dockerd 100.82.34.63 34314 100.82.64.53 7002 0 8 56.73
[...]
Dynamic	tracing	of	TCP	set	state	only;	does	not	trace	send/receive	
Also	see:	tcpconnect,	tcpaccept,	tcpretrans

Recommended for you

Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF

Talk about bcc/eBPF for SCALE15x (2017) by Brendan Gregg. "BPF (Berkeley Packet Filter) has been enhanced in the Linux 4.x series and now powers a large collection of performance analysis and observability tools ready for you to use, included in the bcc (BPF Complier Collection) open source project. BPF nowadays can do system tracing, software defined networks, and kernel fast path: much more than just filtering packets! This talk will focus on the bcc/BPF tools for performance analysis, which make use of other built in Linux capabilities: dynamic tracing (kprobes and uprobes) and static tracing (tracepoints and USDT). There are now bcc tools for measuring latency distributions for file system I/O and run queue latency, printing details of storage device I/O and TCP retransmits, investigating blocked stack traces and memory leaks, and a whole lot more. These lead to performance wins large and small, especially when instrumenting areas that previously had zero visibility. Tracing superpowers have finally arrived, built in to Linux."

linux performance tracingebpfperformance
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more

Video: https://www.youtube.com/watch?v=JRFNIKUROPE . Talk for linux.conf.au 2017 (LCA2017) by Brendan Gregg, about Linux enhanced BPF (eBPF). Abstract: A world of new capabilities is emerging for the Linux 4.x series, thanks to enhancements that have been included in Linux for to Berkeley Packet Filter (BPF): an in-kernel virtual machine that can execute user space-defined programs. It is finding uses for security auditing and enforcement, enhancing networking (including eXpress Data Path), and performance observability and troubleshooting. Many new open source tools that have been written in the past 12 months for performance analysis that use BPF. Tracing superpowers have finally arrived for Linux! For its use with tracing, BPF provides the programmable capabilities to the existing tracing frameworks: kprobes, uprobes, and tracepoints. In particular, BPF allows timestamps to be recorded and compared from custom events, allowing latency to be studied in many new places: kernel and application internals. It also allows data to be efficiently summarized in-kernel, including as histograms. This has allowed dozens of new observability tools to be developed so far, including measuring latency distributions for file system I/O and run queue latency, printing details of storage device I/O and TCP retransmits, investigating blocked stack traces and memory leaks, and a whole lot more. This talk will summarize BPF capabilities and use cases so far, and then focus on its use to enhance Linux tracing, especially with the open source bcc collection. bcc includes BPF versions of old classics, and many new tools, including execsnoop, opensnoop, funcccount, ext4slower, and more (many of which I developed). Perhaps you'd like to develop new tools, or use the existing tools to find performance wins large and small, especially when instrumenting areas that previously had zero visibility. I'll also summarize how we intend to use these new capabilities to enhance systems analysis at Netflix.

linuxperformancebpf
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools

You have a system with an advanced programmatic tracer: do you know what to do with it? Brendan has used numerous tracers in production environments, and has published hundreds of tracing-based tools. In this talk he will share tips and know-how for creating CLI tracing tools and GUI visualizations, to solve real problems effectively. Programmatic tracing is an amazing superpower, and this talk will show you how to wield it!

tracingbrendan gregg
Identify DNS latency issues system wide with gethostlatency
# /usr/share/bcc/tools/gethostlatency
TIME PID COMM LATms HOST
18:56:36 5055 mesos-slave 0.01 100.82.166.217
18:56:40 5590 java 3.53 ec2-…-79.compute-1.amazonaws.com
18:56:51 5055 mesos-slave 0.01 100.82.166.217
18:56:53 30166 ncat 0.21 localhost
18:56:56 6661 java 2.19 atlas-alert-….prod.netflix.net
18:56:59 5589 java 1.50 ec2-…-207.compute-1.amazonaws.com
18:57:03 5370 java 0.04 localhost
18:57:03 30259 sudo 0.07 titusagent-mainvpc-m…3465
18:57:06 5055 mesos-slave 0.01 100.82.166.217
18:57:10 5590 java 3.10 ec2-…-79.compute-1.amazonaws.com
18:57:21 5055 mesos-slave 0.01 100.82.166.217
18:57:29 5589 java 52.36 ec2-…-207.compute-1.amazonaws.com
18:57:36 5055 mesos-slave 0.01 100.82.166.217
18:57:40 5590 java 1.83 ec2-…-79.compute-1.amazonaws.com
18:57:51 5055 mesos-slave 0.01 100.82.166.217
[…]
Instruments	using	user-level	dynamic	tracing	of	getaddrinfo(),	gethostbyname(),	etc.
Identify DNS latency issues system wide with gethostlatency
# /usr/share/bcc/tools/gethostlatency
TIME PID COMM LATms HOST
18:56:36 5055 mesos-slave 0.01 100.82.166.217
18:56:40 5590 java 3.53 ec2-…-79.compute-1.amazonaws.com
18:56:51 5055 mesos-slave 0.01 100.82.166.217
18:56:53 30166 ncat 0.21 localhost
18:56:56 6661 java 2.19 atlas-alert-….prod.netflix.net
18:56:59 5589 java 1.50 ec2-…-207.compute-1.amazonaws.com
18:57:03 5370 java 0.04 localhost
18:57:03 30259 sudo 0.07 titusagent-mainvpc-m…3465
18:57:06 5055 mesos-slave 0.01 100.82.166.217
18:57:10 5590 java 3.10 ec2-…-79.compute-1.amazonaws.com
18:57:21 5055 mesos-slave 0.01 100.82.166.217
18:57:29 5589 java 52.36 ec2-…-207.compute-1.amazonaws.com
18:57:36 5055 mesos-slave 0.01 100.82.166.217
18:57:40 5590 java 1.83 ec2-…-79.compute-1.amazonaws.com
18:57:51 5055 mesos-slave 0.01 100.82.166.217
[…]
Instruments	using	user-level	dynamic	tracing	of	getaddrinfo(),	gethostbyname(),	etc.
Examine CPU scheduler latency as a histogram with runqlat
# /usr/share/bcc/tools/runqlat 10
Tracing run queue latency... Hit Ctrl-C to end.
usecs : count distribution
0 -> 1 : 2810 |* |
2 -> 3 : 5248 |** |
4 -> 7 : 12369 |****** |
8 -> 15 : 71312 |****************************************|
16 -> 31 : 55705 |******************************* |
32 -> 63 : 11775 |****** |
64 -> 127 : 6230 |*** |
128 -> 255 : 2758 |* |
256 -> 511 : 549 | |
512 -> 1023 : 46 | |
1024 -> 2047 : 11 | |
2048 -> 4095 : 4 | |
4096 -> 8191 : 5 | |
[…]
As	efficient	as	possible:	scheduler	calls	can	become	frequent
Examine CPU scheduler latency as a histogram with runqlat
# /usr/share/bcc/tools/runqlat 10
Tracing run queue latency... Hit Ctrl-C to end.
usecs : count distribution
0 -> 1 : 2810 |* |
2 -> 3 : 5248 |** |
4 -> 7 : 12369 |****** |
8 -> 15 : 71312 |****************************************|
16 -> 31 : 55705 |******************************* |
32 -> 63 : 11775 |****** |
64 -> 127 : 6230 |*** |
128 -> 255 : 2758 |* |
256 -> 511 : 549 | |
512 -> 1023 : 46 | |
1024 -> 2047 : 11 | |
2048 -> 4095 : 4 | |
4096 -> 8191 : 5 | |
[…]
As	efficient	as	possible:	scheduler	calls	can	become	frequent

Recommended for you

ATO Linux Performance 2018
ATO Linux Performance 2018ATO Linux Performance 2018
ATO Linux Performance 2018

Talk by Brendan Gregg for All Things Open 2018. "At over one thousand code commits per week, it's hard to keep up with Linux developments. This keynote will summarize recent Linux performance features, for a wide audience: the KPTI patches for Meltdown, eBPF for performance observability and the new open source tools that use it, Kyber for disk I/O sc heduling, BBR for TCP congestion control, and more. This is about exposure: knowing what exists, so you can learn and use it later when needed. Get the most out of your systems with the latest Linux kernels and exciting features."

linuxperformance
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools

Video: https://www.youtube.com/watch?v=uibLwoVKjec . Talk by Brendan Gregg for Sysdig CCWFS 2016. Abstract: "You have a system with an advanced programmatic tracer: do you know what to do with it? Brendan has used numerous tracers in production environments, and has published hundreds of tracing-based tools. In this talk he will share tips and know-how for creating CLI tracing tools and GUI visualizations, to solve real problems effectively. Programmatic tracing is an amazing superpower, and this talk will show you how to wield it!"

performance
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape

O'Reilly Velocity New York 2016 presentation on modern Linux tracing tools and technology. Highlights the available tracing data sources on Linux (ftrace, perf_events, BPF) and demonstrates some tools that can be used to obtain traces, including DebugFS, the perf front-end, and most importantly, the BCC/BPF tool collection.

bpfperformancelinux
Construct programmatic one-liners with trace
# trace 'sys_read (arg3 > 20000) "read %d bytes", arg3'
TIME PID COMM FUNC -
05:18:23 4490 dd sys_read read 1048576 bytes
05:18:23 4490 dd sys_read read 1048576 bytes
05:18:23 4490 dd sys_read read 1048576 bytes
^C
argdist	by	Sasha	Goldshtein	
# trace -h
[...]
trace –K blk_account_io_start
Trace this kernel function, and print info with a kernel stack trace
trace 'do_sys_open "%s", arg2'
Trace the open syscall and print the filename being opened
trace 'sys_read (arg3 > 20000) "read %d bytes", arg3'
Trace the read syscall and print a message for reads >20000 bytes
trace r::do_sys_return
Trace the return from the open syscall
trace 'c:open (arg2 == 42) "%s %d", arg1, arg2'
Trace the open() call from libc only if the flags (arg2) argument is 42
[...]
e.g. reads over 20000 bytes:
Create in-kernel summaries with argdist
# argdist -H 'p::tcp_cleanup_rbuf(struct sock *sk, int copied):int:copied'
[15:34:45]
copied : count distribution
0 -> 1 : 15088 |********************************** |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 4786 |*********** |
128 -> 255 : 1 | |
256 -> 511 : 1 | |
512 -> 1023 : 4 | |
1024 -> 2047 : 11 | |
2048 -> 4095 : 5 | |
4096 -> 8191 : 27 | |
8192 -> 16383 : 105 | |
16384 -> 32767 : 0 | |
argdist	by	Sasha	Goldshtein	
e.g. histogram of tcp_cleanup_rbuf() copied:
BCC/BPF
Visualizations
Coming to a GUI near you
BPF metrics and analysis can be automated in GUIs
Flame Graphs
Heat Maps
Tracing Reports
…
Eg, Netflix Vector (self-service UI):
Should be open sourced; you may also build/buy your own

Recommended for you

Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen

This document discusses the crash reporting mechanism in Tizen. It describes the crash client, which handles crash signals and generates crash reports. It covers Samsung's crash-work-sdk and Intel's corewatcher crash clients. It also discusses the crash server that receives reports and the CrashDB web interface. Finally, it mentions crash reason location algorithms.

Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPF

Using the new extended Berkley Packet Filter capabilities in Linux to the improve performance of auditing security relevant kernel events around network, file and process actions.

securitymonitoringlinux
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory

Palestra realizada por Toronto Garcez aka torontux durante a 3a. edição da Nullbyte Security Conference em 26 de novembro de 2016. Resumo: O objetivo da apresentação é demonstrar de forma prática, o passo-a-passo para criar uma botnet com roteadores wi-fi e/ou embarcados em geral. Será demonstrado o desenvolvimento de um comando e controle e a utilização de firmwares "backdorados" para tornar dispositivos em bots.

botnetbackdoorbahia
Latency heatmaps show histograms over time
Optimize CPU flame graphs with BPF: count stacks in-kernel
What about Off-CPU?
Generic thread state digram
Efficient Off-CPU flame graphs via scheduler tracing and BPF
CPU
Off-CPU
Solve
everything?

Recommended for you

Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting Started

Talk for Facebook Systems@Scale 2021 by Brendan Gregg: "BPF (eBPF) tracing is the superpower that can analyze everything, helping you find performance wins, troubleshoot software, and more. But with many different front-ends and languages, and years of evolution, finding the right starting point can be hard. This talk will make it easy, showing how to install and run selected BPF tools in the bcc and bpftrace open source projects for some quick wins. Think like a sysadmin, not like a programmer."

linuxbpfperformance
Debugging 2013- Jesper Brouer
Debugging 2013- Jesper BrouerDebugging 2013- Jesper Brouer
Debugging 2013- Jesper Brouer

The document describes how to debug a kernel crash by recording the full kernel panic text using techniques like configuring a serial console, using the netconsole kernel feature, or manually dumping memory on a virtual machine. It also explains how to use the crash analysis tool to examine the crash dump, including getting a backtrace, disassembling instructions, and viewing the kernel log.

october 2013debuggingmediehuset ingeniøren
test
testtest
test

This document provides an overview of Linux performance monitoring tools including mpstat, top, htop, vmstat, iostat, free, strace, and tcpdump. It discusses what each tool measures and how to use it to observe system performance and diagnose issues. The tools presented provide visibility into CPU usage, memory usage, disk I/O, network traffic, and system call activity which are essential for understanding workload performance on Linux systems.

pizza
Off-CPU Time (zoomed): gzip(1)
Off-CPU doesn't always make sense:
what is gzip blocked on?
Wakeup time flame graphs show waker thread stacks
Wakeup Time (zoomed): gzip(1)
gzip(1) is blocked on tar(1)!
tar cf - * | gzip > out.tar.gz
Can't we associate off-CPU with wakeup stacks?
Off-wake flame graphs: BPF can merge blocking plus waker stacks
in-kernel
Waker	task	
Waker	stack	
Blocked	stack	
Blocked	task	
Stack	
Direc[on	
Wokeup

Recommended for you

eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019

The document describes a biolatency tool that traces block device I/O latency using eBPF. It discusses how the tool was originally written in the bcc framework using C/BPF, but has since been rewritten in the bpftrace framework using a simpler one-liner script. It provides examples of the bcc and bpftrace implementations of biolatency.

ebpfbpfperformance
YOW2021 Computing Performance
YOW2021 Computing PerformanceYOW2021 Computing Performance
YOW2021 Computing Performance

This document provides a performance engineer's predictions for computing performance trends in 2021 and beyond. The engineer discusses trends in processors, memory, disks, networking, runtimes, kernels, hypervisors, and observability. For processors, predictions include multi-socket systems becoming less common, the future of simultaneous multithreading being unclear, practical core count limits being reached in the 2030s, and more processor vendors including ARM-based and RISC-V options. Memory predictions focus on many workloads being memory-bound currently.

performancecomputingcloud computing
IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor Benchmarking

The document discusses challenges with processor benchmarking and provides recommendations. It summarizes a case study where a popular CPU benchmark claimed a new processor was 2.6x faster than Intel, but detailed analysis found the benchmark was testing division speed, which accounted for only 0.1% of cycles on Netflix servers. The document advocates for low-level, active benchmarking and profiling over statistical analysis. It also provides a checklist for evaluating benchmarks and cautions that increased processor complexity and cloud environments make accurate benchmarking more difficult.

processorscpusbenchmarking
Another	
example
Chain graphs: merge all wakeup stacks
Future Work
BPF
BCC Improvements
•  Challenges
–  Initialize all variables
–  BPF_PERF_OUTPUT()
–  Verifier errors
–  Still explicit bpf_probe_read()s.
It's getting better (thanks):
•  High-Level Languages
–  One-liners and scripts
–  Can use libbcc
tcpconnlat.py

Recommended for you

Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)

This document provides an overview of using eBPF (extended Berkeley Packet Filter) to quickly get performance wins as a sysadmin. It recommends installing BCC and bpftrace tools to easily find issues like periodic processes, misconfigurations, unexpected TCP sessions, or slow file system I/O. A case study examines using biosnoop to identify which processes were causing disk latency issues. The document suggests thinking like a sysadmin first by running tools, then like a programmer if a problem requires new tools. It also outlines recommended frontends depending on use cases and provides references to learn more about BPF.

bpfebpfperformance
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started

Keynote by Brendan Gregg for the eBPF summit, 2020. How to get started finding performance wins using the BPF (eBPF) technology. This short talk covers the quickest and easiest way to find performance wins using BPF observability tools on Linux.

bpfebpflinux
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software

BPF (Berkeley Packet Filter) has evolved from a limited virtual machine for efficient packet filtering to a new type of software called extended BPF. Extended BPF allows for custom, efficient, and production-safe performance analysis tools and observability programs to be run in the Linux kernel through BPF. It enables new event-based applications running as BPF programs attached to various kernel events like kprobes, uprobes, tracepoints, sockets, and more. Major companies like Facebook, Google, and Netflix are using BPF programs for tasks like intrusion detection, container security, firewalling, and observability with over 150,000 AWS instances running BPF programs. BPF provides a new program model and security features compared

performancelinuxbpf
ply
•  A new BPF-based language and tracer for Linux
–  Created by Tobias Waldekranz
–  https://github.com/iovisor/ply https://wkz.github.io/ply/
–  Promising, was in development
# ply -c 'kprobe:do_sys_open { printf("opened: %sn", mem(arg(1), "128s")); }'
1 probe active
opened: /sys/kernel/debug/tracing/events/enable
opened: /etc/ld.so.cache
opened: /lib/x86_64-linux-gnu/libselinux.so.1
opened: /lib/x86_64-linux-gnu/libc.so.6
opened: /proc/filesystems
opened: /usr/lib/locale/locale-archive
opened: .
[...]
ply programs are concise, such as measuring read latency
# ply -A -c 'kprobe:SyS_read { @start[tid()] = nsecs(); }
kretprobe:SyS_read /@start[tid()]/ { @ns.quantize(nsecs() - @start[tid()]);
@start[tid()] = nil; }'
2 probes active
^Cde-activating probes
[...]
@ns:
[ 512, 1k) 3 |######## |
[ 1k, 2k) 7 |################### |
[ 2k, 4k) 12 |################################|
[ 4k, 8k) 3 |######## |
[ 8k, 16k) 2 |##### |
[ 16k, 32k) 0 | |
[ 32k, 64k) 0 | |
[ 64k, 128k) 3 |######## |
[128k, 256k) 1 |### |
[256k, 512k) 1 |### |
[512k, 1M) 2 |##### |
[...]
bpftrace
•  Another new BPF-based language and tracer for Linux
–  Created by Alastair Robertson
–  https://github.com/ajor/bpftrace
–  In active development
# bpftrace -e 'kprobe:sys_open { printf("opened: %sn", str(arg0)); }'
Attaching 1 probe...
opened: /sys/devices/system/cpu/online
opened: /proc/1956/stat
opened: /proc/1241/stat
opened: /proc/net/dev
opened: /proc/net/if_inet6
opened: /sys/class/net/eth0/device/vendor
opened: /proc/sys/net/ipv4/neigh/eth0/retrans_time_ms
[...]
bpftrace programs are concise, such as measuring read latency
# bpftrace -e 'kprobe:SyS_read { @start[tid] = nsecs; } kretprobe:SyS_read /@start[tid]/
{ @ns = quantize(nsecs - @start[tid]); @start[tid] = delete(); }'
Attaching 2 probes...
^C
@ns:
[0, 1] 0 | |
[2, 4) 0 | |
[4, 8) 0 | |
[8, 16) 0 | |
[16, 32) 0 | |
[32, 64) 0 | |
[64, 128) 0 | |
[128, 256) 0 | |
[256, 512) 0 | |
[512, 1k) 0 | |
[1k, 2k) 6 |@@@@@ |
[2k, 4k) 20 |@@@@@@@@@@@@@@@@@@@ |
[4k, 8k) 4 |@@@ |
[8k, 16k) 14 |@@@@@@@@@@@@@ |
[16k, 32k) 53 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[32k, 64k) 2 |@ |

Recommended for you

LPC2019 BPF Tracing Tools
LPC2019 BPF Tracing ToolsLPC2019 BPF Tracing Tools
LPC2019 BPF Tracing Tools

This document discusses Brendan Gregg's opinions on various tracing tools including sysdig, perf, ftrace, eBPF, bpftrace, and BPF perf tools. It provides a table comparing the scope, capability, and ease of use of these tools. It then gives an example of using BPF perf tools to analyze readahead performance. Finally, it outlines desired additions to tracing capabilities and BPF helpers as well as challenges in areas like function tracing without frame pointers.

bpflinux
YOW2018 CTO Summit: Working at netflix
YOW2018 CTO Summit: Working at netflixYOW2018 CTO Summit: Working at netflix
YOW2018 CTO Summit: Working at netflix

This document summarizes Brendan Gregg's experiences working at Netflix for over 4.5 years. Some key points include: - The company culture at Netflix is openly documented and encourages independent decision making, open communication, and sharing information broadly. - Gregg's first meeting involved an expected "intense debate" but was actually professional and respectful. - Netflix values judgment, communication, curiosity, courage, and other traits that allow the culture and architecture to complement each other. - The cloud architecture is designed to be resilient through practices like chaos engineering and rapid deployments without approvals, in line with the culture of freedom and responsibility.

culture
NetConf 2018 BPF Observability
NetConf 2018 BPF ObservabilityNetConf 2018 BPF Observability
NetConf 2018 BPF Observability

Talk/discussion for NetConf 2018 on BPF Observability by Brendan Gregg. http://vger.kernel.org/netconf2018.html

New Tooling/Metrics
New Visualizations
Case Studies
•  Use it
•  Solve something
•  Write about it
•  Talk about it
•  Recent posts:
–  https://blogs.dropbox.com/tech/2017/09/optimizing-web-servers-for-high-throughput-
and-low-latency/
–  https://josefbacik.github.io/kernel/scheduler/bcc/bpf/2017/08/03/sched-time.html
Advanced Analysis
•  Find/draw a functional diagram
•  Apply performance methods
–  http://www.brendangregg.com/methodology.html
–  Workload Characterization
–  USE Method
–  Latency Analysis
–  Start with the Q's,
then find the A's
•  Use multi-tools:
–  funccount, trace, argdist, stackcount
e.g., storage I/O subsystem

Recommended for you

FlameScope 2018
FlameScope 2018FlameScope 2018
FlameScope 2018

Talk by Brendan Gregg and Martin Spier for the Linkedin Performance Engineering meetup on Nov 8, 2018. FlameScope is a visualization for performance profiles that helps you study periodic activity, variance, and perturbations, with a heat map for navigation and flame graphs for code analysis.

flamescopeflame graphsperformance
Linux Performance 2018 (PerconaLive keynote)
Linux Performance 2018 (PerconaLive keynote)Linux Performance 2018 (PerconaLive keynote)
Linux Performance 2018 (PerconaLive keynote)

Keynote for PerconaLive 2018 by Brendan Gregg. Video: https://youtu.be/sV3XfrfjrPo?t=30m51s . "At over one thousand code commits per week, it's hard to keep up with Linux developments. This keynote will summarize recent Linux performance features, for a wide audience: the KPTI patches for Meltdown, eBPF for performance observability, Kyber for disk I/O scheduling, BBR for TCP congestion control, and more. This is about exposure: knowing what exists, so you can learn and use it later when needed. Get the most out of your systems, whether they are databases or application servers, with the latest Linux kernels and exciting features."

linuxperformance
How Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for PerformanceHow Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for Performance

CMP325 talk for AWS re:Invent 2017, by Brendan Gregg. " At Netflix we make the best use of AWS EC2 instance types and features to create a high performance cloud, achieving near bare metal speed for our workloads. This session will summarize the configuration, tuning, and activities for delivering the fastest possible EC2 instances, and will help other EC2 users improve performance, reduce latency outliers, and make better use of EC2 features. We'll show how we choose EC2 instance types, how we choose between EC2 Xen modes: HVM, PV, and PVHVM, and the importance of EC2 features such SR-IOV for bare-metal performance. SR-IOV is used by EC2 enhanced networking, and recently for the new i3 instance type for enhanced disk performance as well. We'll also cover kernel tuning and observability tools, from basic to advanced. Advanced performance analysis includes the use of Java and Node.js flame graphs, and the new EC2 Performance Monitoring Counter (PMC) feature released this year."

awsec2performance
Take aways
1.  Understand Linux tracing and enhanced BPF
2.  How to use eBPF tools
3.  Areas of future development
BPF	Tracing	in	Linux	
•  3.19:	sockets	
•  3.19:	maps	
•  4.1:	kprobes	
•  4.3:	uprobes	
•  4.4:	BPF	output	
•  4.6:	stacks	
•  4.7:	tracepoints	
•  4.9:	profiling	
•  4.9:	PMCs	
Please	contribute:	
-  hHps://github.com/
iovisor/bcc	
-  hHps://github.com/
iovisor/ply	
Upgrade to Linux 4.9+!
Links & References
iovisor bcc:
-  https://github.com/iovisor/bcc https://github.com/iovisor/bcc/tree/master/docs
-  http://www.brendangregg.com/blog/ (search for "bcc")
-  http://www.brendangregg.com/ebpf.html#bcc
-  http://blogs.microsoft.co.il/sasha/2016/02/14/two-new-ebpf-tools-memleak-and-argdist/
-  On designing tracing tools: https://www.youtube.com/watch?v=uibLwoVKjec
bcc tutorial:
-  https://github.com/iovisor/bcc/blob/master/INSTALL.md
-  …/docs/tutorial.md …/docs/tutorial_bcc_python_developer.md …/docs/reference_guide.md
-  .../CONTRIBUTING-SCRIPTS.md
ply: https://github.com/iovisor/ply
bpftrace: https://github.com/ajor/bpftrace
BPF:
-  https://www.kernel.org/doc/Documentation/networking/filter.txt
-  https://github.com/iovisor/bpf-docs
-  https://suchakra.wordpress.com/tag/bpf/
Flame Graphs:
-  http://www.brendangregg.com/flamegraphs.html
-  http://www.brendangregg.com/blog/2016-01-20/ebpf-offcpu-flame-graph.html
-  http://www.brendangregg.com/blog/2016-02-01/linux-wakeup-offwake-profiling.html
Netflix Tech Blog on Vector:
-  http://techblog.netflix.com/2015/04/introducing-vector-netflixs-on-host.html
Linux Performance: http://www.brendangregg.com/linuxperf.html
BPF @ Open Source Summit
•  Making the Kernel's Networking Data Path Programmable with
BPF and XDP
–  Daniel Borkmann, Tuesday, 11:55am @ Georgia I/II
•  Performance Analysis Superpowers with Linux BPF
–  Brendan Gregg, this talk
•  Cilium - Container Security and Networking using BPF and XDP
–  Thomas Graf, Wednesday, 2:50pm @ Diamond Ballroom 6
Thank You
–  Questions?
–  iovisor bcc: https://github.com/iovisor/bcc
–  http://www.brendangregg.com
–  http://slideshare.net/brendangregg
–  bgregg@netflix.com
–  @brendangregg
Thanks to Alexei Starovoitov (Facebook), Brenden Blanco (PLUMgrid/VMware),
Sasha Goldshtein (Sela), Teng Qin (Facebook), Yonghong Song (Facebook),
Daniel Borkmann (Cisco/Covalent), Wang Nan (Huawei), Vicent Martí (GitHub),
Paul Chaignon (Orange), and other BPF and bcc contributors!

Recommended for you

LISA17 Container Performance Analysis
LISA17 Container Performance AnalysisLISA17 Container Performance Analysis
LISA17 Container Performance Analysis

Talk for USENIX LISA17: "Containers pose interesting challenges for performance monitoring and analysis, requiring new analysis methodologies and tooling. Resource-oriented analysis, as is common with systems performance tools and GUIs, must now account for both hardware limits and soft limits, as implemented using cgroups. A reverse diagnosis methodology can be applied to identify whether a container is resource constrained, and by which hard or soft resource. The interaction between the host and containers can also be examined, and noisy neighbors identified or exonerated. Performance tooling can need special usage or workarounds to function properly from within a container or on the host, to deal with different privilege levels and name spaces. At Netflix, we're using containers for some microservices, and care very much about analyzing and tuning our containers to be as fast and efficient as possible. This talk will show you how to identify bottlenecks in the host or container configuration, in the applications by profiling in a container environment, and how to dig deeper into kernel and container internals."

containersperformancelinux
EuroBSDcon 2017 System Performance Analysis Methodologies
EuroBSDcon 2017 System Performance Analysis MethodologiesEuroBSDcon 2017 System Performance Analysis Methodologies
EuroBSDcon 2017 System Performance Analysis Methodologies

keynote by Brendan Gregg. "Traditional performance monitoring makes do with vendor-supplied metrics, often involving interpretation and inference, and with numerous blind spots. Much in the field of systems performance is still living in the past: documentation, procedures, and analysis GUIs built upon the same old metrics. Modern BSD has advanced tracers and PMC tools, providing virtually endless metrics to aid performance analysis. It's time we really used them, but the problem becomes which metrics to use, and how to navigate them quickly to locate the root cause of problems. There's a new way to approach performance analysis that can guide you through the metrics. Instead of starting with traditional metrics and figuring out their use, you start with the questions you want answered then look for metrics to answer them. Methodologies can provide these questions, as well as a starting point for analysis and guidance for locating the root cause. They also pose questions that the existing metrics may not yet answer, which may be critical in solving the toughest problems. System methodologies include the USE method, workload characterization, drill-down analysis, off-CPU analysis, chain graphs, and more. This talk will discuss various system performance issues, and the methodologies, tools, and processes used to solve them. Many methodologies will be discussed, from the production proven to the cutting edge, along with recommendations for their implementation on BSD systems. In general, you will learn to think differently about analyzing your systems, and make better use of the modern tools that BSD provides."

bsdperformancefreebsd
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs

Talk by Brendan Gregg for USENIX ATC 2017. "Flame graphs are a simple stack trace visualization that helps answer an everyday problem: how is software consuming resources, especially CPUs, and how did this change since the last software version? Flame graphs have been adopted by many languages, products, and companies, including Netflix, and have become a standard tool for performance analysis. They were published in "The Flame Graph" article in the June 2016 issue of Communications of the ACM, by their creator, Brendan Gregg. This talk describes the background for this work, and the challenges encountered when profiling stack traces and resolving symbols for different languages, including for just-in-time compiler runtimes. Instructions will be included generating mixed-mode flame graphs on Linux, and examples from our use at Netflix with Java. Advanced flame graph types will be described, including differential, off-CPU, chain graphs, memory, and TCP events. Finally, future work and unsolved problems in this area will be discussed."

performancelinux performanceflame graphs

More Related Content

What's hot

BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
Brendan Gregg
 
Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016
Brendan Gregg
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF Observability
Brendan Gregg
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing
Viller Hsiao
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
Georg Schönberger
 
Netflix: From Clouds to Roots
Netflix: From Clouds to RootsNetflix: From Clouds to Roots
Netflix: From Clouds to Roots
Brendan Gregg
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
Brendan Gregg
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
Brendan Gregg
 
Linux kernel memory allocators
Linux kernel memory allocatorsLinux kernel memory allocators
Linux kernel memory allocators
Hao-Ran Liu
 
Memory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux KernelMemory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux Kernel
Adrian Huang
 
Slab Allocator in Linux Kernel
Slab Allocator in Linux KernelSlab Allocator in Linux Kernel
Slab Allocator in Linux Kernel
Adrian Huang
 
YOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at NetflixYOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at Netflix
Brendan Gregg
 
BPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveBPF Hardware Offload Deep Dive
BPF Hardware Offload Deep Dive
Netronome
 
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance
Brendan Gregg
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix
Brendan Gregg
 
What Linux can learn from Solaris performance and vice-versa
What Linux can learn from Solaris performance and vice-versaWhat Linux can learn from Solaris performance and vice-versa
What Linux can learn from Solaris performance and vice-versa
Brendan Gregg
 
Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)
Brendan Gregg
 
Introduction to Perf
Introduction to PerfIntroduction to Perf
Introduction to Perf
Wang Hsiangkai
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
Adrien Mahieux
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKB
shimosawa
 

What's hot (20)

BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 
Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF Observability
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
 
Netflix: From Clouds to Roots
Netflix: From Clouds to RootsNetflix: From Clouds to Roots
Netflix: From Clouds to Roots
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
 
Linux kernel memory allocators
Linux kernel memory allocatorsLinux kernel memory allocators
Linux kernel memory allocators
 
Memory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux KernelMemory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux Kernel
 
Slab Allocator in Linux Kernel
Slab Allocator in Linux KernelSlab Allocator in Linux Kernel
Slab Allocator in Linux Kernel
 
YOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at NetflixYOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at Netflix
 
BPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveBPF Hardware Offload Deep Dive
BPF Hardware Offload Deep Dive
 
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix
 
What Linux can learn from Solaris performance and vice-versa
What Linux can learn from Solaris performance and vice-versaWhat Linux can learn from Solaris performance and vice-versa
What Linux can learn from Solaris performance and vice-versa
 
Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)
 
Introduction to Perf
Introduction to PerfIntroduction to Perf
Introduction to Perf
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKB
 

Similar to OSSNA 2017 Performance Analysis Superpowers with Linux BPF

Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
Brendan Gregg
 
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Anne Nicolas
 
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPFUSENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
Brendan Gregg
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix
Brendan Gregg
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges
IO Visor Project
 
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017
Brendan Gregg
 
Velocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPF
Brendan Gregg
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Brendan Gregg
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
Brendan Gregg
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
Sysdig
 
ATO Linux Performance 2018
ATO Linux Performance 2018ATO Linux Performance 2018
ATO Linux Performance 2018
Brendan Gregg
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
Brendan Gregg
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
Sasha Goldshtein
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen
Lex Yu
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPF
Alex Maestretti
 
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory
Nullbyte Security Conference
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting Started
Brendan Gregg
 
Debugging 2013- Jesper Brouer
Debugging 2013- Jesper BrouerDebugging 2013- Jesper Brouer
Debugging 2013- Jesper Brouer
Mediehuset Ingeniøren Live
 
test
testtest
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
Brendan Gregg
 

Similar to OSSNA 2017 Performance Analysis Superpowers with Linux BPF (20)

Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
 
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
 
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPFUSENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges
 
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017
 
Velocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPF
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
ATO Linux Performance 2018
ATO Linux Performance 2018ATO Linux Performance 2018
ATO Linux Performance 2018
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPF
 
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting Started
 
Debugging 2013- Jesper Brouer
Debugging 2013- Jesper BrouerDebugging 2013- Jesper Brouer
Debugging 2013- Jesper Brouer
 
test
testtest
test
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
 

More from Brendan Gregg

YOW2021 Computing Performance
YOW2021 Computing PerformanceYOW2021 Computing Performance
YOW2021 Computing Performance
Brendan Gregg
 
IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor Benchmarking
Brendan Gregg
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
Brendan Gregg
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
Brendan Gregg
 
LPC2019 BPF Tracing Tools
LPC2019 BPF Tracing ToolsLPC2019 BPF Tracing Tools
LPC2019 BPF Tracing Tools
Brendan Gregg
 
YOW2018 CTO Summit: Working at netflix
YOW2018 CTO Summit: Working at netflixYOW2018 CTO Summit: Working at netflix
YOW2018 CTO Summit: Working at netflix
Brendan Gregg
 
NetConf 2018 BPF Observability
NetConf 2018 BPF ObservabilityNetConf 2018 BPF Observability
NetConf 2018 BPF Observability
Brendan Gregg
 
FlameScope 2018
FlameScope 2018FlameScope 2018
FlameScope 2018
Brendan Gregg
 
Linux Performance 2018 (PerconaLive keynote)
Linux Performance 2018 (PerconaLive keynote)Linux Performance 2018 (PerconaLive keynote)
Linux Performance 2018 (PerconaLive keynote)
Brendan Gregg
 
How Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for PerformanceHow Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for Performance
Brendan Gregg
 
LISA17 Container Performance Analysis
LISA17 Container Performance AnalysisLISA17 Container Performance Analysis
LISA17 Container Performance Analysis
Brendan Gregg
 
EuroBSDcon 2017 System Performance Analysis Methodologies
EuroBSDcon 2017 System Performance Analysis MethodologiesEuroBSDcon 2017 System Performance Analysis Methodologies
EuroBSDcon 2017 System Performance Analysis Methodologies
Brendan Gregg
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
Brendan Gregg
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
Brendan Gregg
 

More from Brendan Gregg (15)

YOW2021 Computing Performance
YOW2021 Computing PerformanceYOW2021 Computing Performance
YOW2021 Computing Performance
 
IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor Benchmarking
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
 
LPC2019 BPF Tracing Tools
LPC2019 BPF Tracing ToolsLPC2019 BPF Tracing Tools
LPC2019 BPF Tracing Tools
 
YOW2018 CTO Summit: Working at netflix
YOW2018 CTO Summit: Working at netflixYOW2018 CTO Summit: Working at netflix
YOW2018 CTO Summit: Working at netflix
 
NetConf 2018 BPF Observability
NetConf 2018 BPF ObservabilityNetConf 2018 BPF Observability
NetConf 2018 BPF Observability
 
FlameScope 2018
FlameScope 2018FlameScope 2018
FlameScope 2018
 
Linux Performance 2018 (PerconaLive keynote)
Linux Performance 2018 (PerconaLive keynote)Linux Performance 2018 (PerconaLive keynote)
Linux Performance 2018 (PerconaLive keynote)
 
How Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for PerformanceHow Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for Performance
 
LISA17 Container Performance Analysis
LISA17 Container Performance AnalysisLISA17 Container Performance Analysis
LISA17 Container Performance Analysis
 
EuroBSDcon 2017 System Performance Analysis Methodologies
EuroBSDcon 2017 System Performance Analysis MethodologiesEuroBSDcon 2017 System Performance Analysis Methodologies
EuroBSDcon 2017 System Performance Analysis Methodologies
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 

Recently uploaded

How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 

Recently uploaded (20)

How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 

OSSNA 2017 Performance Analysis Superpowers with Linux BPF

  • 1. Performance Analysis Superpowers with Linux BPF Brendan Gregg Sep 2017
  • 5. Agenda 1. eBPF & bcc 2. bcc/BPF CLI Tools 3. bcc/BPF Visualizations
  • 6. Take aways 1.  Understand Linux tracing and enhanced BPF 2.  How to use BPF tools 3.  Areas of future development
  • 9. BPF Introducing enhanced BPF for tracing: kernel-level software
  • 10. Ye Olde BPF Berkeley Packet Filter # tcpdump host 127.0.0.1 and port 22 -d (000) ldh [12] (001) jeq #0x800 jt 2 jf 18 (002) ld [26] (003) jeq #0x7f000001 jt 6 jf 4 (004) ld [30] (005) jeq #0x7f000001 jt 6 jf 18 (006) ldb [23] (007) jeq #0x84 jt 10 jf 8 (008) jeq #0x6 jt 10 jf 9 (009) jeq #0x11 jt 10 jf 18 (010) ldh [20] (011) jset #0x1fff jt 18 jf 12 (012) ldxb 4*([14]&0xf) (013) ldh [x + 14] [...] User-defined bytecode executed by an in-kernel sandboxed virtual machine Steven McCanne and Van Jacobson, 1993 2 x 32-bit registers & scratch memory Optimizes packet filter performance
  • 11. Enhanced BPF aka eBPF or just "BPF" Alexei Starovoitov, 2014+ 10 x 64-bit registers maps (hashes) actions
  • 12. BPF for Tracing, Internals BPF bytecode Observability Program Kernel tracepoints kprobes uprobes BPF maps per-event data statistics verifier output static tracing dynamic tracing async copy perf_events sampling, PMCs BPF program event config attach load Enhanced BPF is also now used for SDNs, DDOS mitigation, intrusion detection, container security, …
  • 15. Event Tracing Efficiency send receive tcpdump Kernel buffer file system 1. read 2. dump Analyzer 1. read 2. process 3. print disks Old way: packet capture New way: dynamic tracing Tracer 1. configure 2. read tcp_retransmit_skb() E.g., tracing TCP retransmits
  • 16. Linux Events & BPF Support Linux 4.3 Linux 4.7 Linux 4.9 Linux 4.9 Linux 4.1 BPF stacks Linux 4.6 BPF output Linux 4.4 (version BPF support arrived)
  • 17. A Linux Tracing Timeline -  1990’s: Static tracers, prototype dynamic tracers -  2000: LTT + DProbes (dynamic tracing; not integrated) -  2004: kprobes (2.6.9) -  2005: DTrace (not Linux), SystemTap (out-of-tree) -  2008: ftrace (2.6.27) -  2009: perf_events (2.6.31) -  2009: tracepoints (2.6.32) -  2010-2017: ftrace & perf_events enhancements -  2012: uprobes (3.5) -  2014-2017: enhanced BPF patches: supporting tracing events -  2016-2017: ftrace hist triggers also: LTTng, ktap, sysdig, ...
  • 18. BCC Introducing BPF Complier Collection: user-level front-end
  • 19. bcc •  BPF Compiler Collection –  https://github.com/iovisor/bcc –  Lead developer: Brenden Blanco •  Includes tracing tools •  Provides BPF front-ends: –  Python –  Lua –  C++ –  C helper libraries –  golang (gobpf) BPF Python Events Kernel lua bcc front-ends bcc tool bcc tool … … user kernel Tracing layers:
  • 22. bcc/BPF (C & Python) bcc examples/tracing/bitehist.py enBre program
  • 24. The Tracing Landscape, Sep 2017 Scope & Capability Easeofuse sysdig perf ftrace C/BPF ktap stap Stage of Development (my opinion) dtrace4L. (brutal)(lessbrutal) (alpha) (mature) bcc/BPF ply/BPF Raw BPF LTTng (hist triggers)recent changes (many) bpftrace
  • 26. Pre-BPF: Linux Perf Analysis in 60s 1.  uptime 2.  dmesg -T | tail 3.  vmstat 1 4.  mpstat -P ALL 1 5.  pidstat 1 6.  iostat -xz 1 7.  free -m 8.  sar -n DEV 1 9.  sar -n TCP,ETCP 1 10.  top hHp://techblog.ne/lix.com/2015/11/linux-performance-analysis-in-60s.html
  • 27. bcc Installation •  https://github.com/iovisor/bcc/blob/master/INSTALL.md •  eg, Ubuntu Xenial: –  Also available as an Ubuntu snap –  Ubuntu 16.04 is good, 16.10 better: more tools work •  Installs many tools –  In /usr/share/bcc/tools, and …/tools/old for older kernels # echo "deb [trusted=yes] https://repo.iovisor.org/apt/xenial xenial-nightly main" |
 sudo tee /etc/apt/sources.list.d/iovisor.list # sudo apt-get update # sudo apt-get install bcc-tools
  • 28. bcc General Performance Checklist 1.  execsnoop 2.  opensnoop 3.  ext4slower (…) 4.  biolatency 5.  biosnoop 6.  cachestat 7.  tcpconnect 8.  tcpaccept 9.  tcpretrans 10.  gethostlatency 11.  runqlat 12.  profile
  • 29. Discover short-lived process issues using execsnoop # execsnoop -t TIME(s) PCOMM PID PPID RET ARGS 0.031 dirname 23832 23808 0 /usr/bin/dirname /apps/tomcat/bin/catalina.sh 0.888 run 23833 2344 0 ./run 0.889 run 23833 2344 -2 /command/bash 0.889 run 23833 2344 -2 /usr/local/bin/bash 0.889 run 23833 2344 -2 /usr/local/sbin/bash 0.889 bash 23833 2344 0 /bin/bash 0.894 svstat 23835 23834 0 /command/svstat /service/nflx-httpd 0.894 perl 23836 23834 0 /usr/bin/perl -e $l=<>;$l=~/(d+) sec/;print $1||0; 0.899 ps 23838 23837 0 /bin/ps --ppid 1 -o pid,cmd,args 0.900 grep 23839 23837 0 /bin/grep org.apache.catalina 0.900 sed 23840 23837 0 /bin/sed s/^ *//; 0.900 cut 23841 23837 0 /usr/bin/cut -d -f 1 0.901 xargs 23842 23837 0 /usr/bin/xargs 0.912 xargs 23843 23842 -2 /command/echo 0.912 xargs 23843 23842 -2 /usr/local/bin/echo 0.912 xargs 23843 23842 -2 /usr/local/sbin/echo 0.912 echo 23843 23842 0 /bin/echo [...] Efficient: only traces exec()
  • 30. Discover short-lived process issues using execsnoop # execsnoop -t TIME(s) PCOMM PID PPID RET ARGS 0.031 dirname 23832 23808 0 /usr/bin/dirname /apps/tomcat/bin/catalina.sh 0.888 run 23833 2344 0 ./run 0.889 run 23833 2344 -2 /command/bash 0.889 run 23833 2344 -2 /usr/local/bin/bash 0.889 run 23833 2344 -2 /usr/local/sbin/bash 0.889 bash 23833 2344 0 /bin/bash 0.894 svstat 23835 23834 0 /command/svstat /service/nflx-httpd 0.894 perl 23836 23834 0 /usr/bin/perl -e $l=<>;$l=~/(d+) sec/;print $1||0; 0.899 ps 23838 23837 0 /bin/ps --ppid 1 -o pid,cmd,args 0.900 grep 23839 23837 0 /bin/grep org.apache.catalina 0.900 sed 23840 23837 0 /bin/sed s/^ *//; 0.900 cut 23841 23837 0 /usr/bin/cut -d -f 1 0.901 xargs 23842 23837 0 /usr/bin/xargs 0.912 xargs 23843 23842 -2 /command/echo 0.912 xargs 23843 23842 -2 /usr/local/bin/echo 0.912 xargs 23843 23842 -2 /usr/local/sbin/echo 0.912 echo 23843 23842 0 /bin/echo [...] Efficient: only traces exec()
  • 31. Exonerate or confirm storage latency outliers with ext4slower # /usr/share/bcc/tools/ext4slower 1 Tracing ext4 operations slower than 1 ms TIME COMM PID T BYTES OFF_KB LAT(ms) FILENAME 17:31:42 postdrop 15523 S 0 0 2.32 5630D406E4 17:31:42 cleanup 15524 S 0 0 1.89 57BB7406EC 17:32:09 titus-log-ship 19735 S 0 0 1.94 slurper_checkpoint.db 17:35:37 dhclient 1061 S 0 0 3.32 dhclient.eth0.leases 17:35:39 systemd-journa 504 S 0 0 26.62 system.journal 17:35:39 systemd-journa 504 S 0 0 1.56 system.journal 17:35:39 systemd-journa 504 S 0 0 1.73 system.journal 17:35:45 postdrop 16187 S 0 0 2.41 C0369406E4 17:35:45 cleanup 16188 S 0 0 6.52 C1B90406EC […] Tracing at the file system is a more reliable and complete indicator than measuring disk I/O latency Also: btrfsslower, xfsslower, zfsslower
  • 32. Exonerate or confirm storage latency outliers with ext4slower # /usr/share/bcc/tools/ext4slower 1 Tracing ext4 operations slower than 1 ms TIME COMM PID T BYTES OFF_KB LAT(ms) FILENAME 17:31:42 postdrop 15523 S 0 0 2.32 5630D406E4 17:31:42 cleanup 15524 S 0 0 1.89 57BB7406EC 17:32:09 titus-log-ship 19735 S 0 0 1.94 slurper_checkpoint.db 17:35:37 dhclient 1061 S 0 0 3.32 dhclient.eth0.leases 17:35:39 systemd-journa 504 S 0 0 26.62 system.journal 17:35:39 systemd-journa 504 S 0 0 1.56 system.journal 17:35:39 systemd-journa 504 S 0 0 1.73 system.journal 17:35:45 postdrop 16187 S 0 0 2.41 C0369406E4 17:35:45 cleanup 16188 S 0 0 6.52 C1B90406EC […] Tracing at the file system is a more reliable and complete indicator than measuring disk I/O latency Also: btrfsslower, xfsslower, zfsslower
  • 33. Identify multimodal disk I/O latency and outliers with biolatency # biolatency -mT 10 Tracing block device I/O... Hit Ctrl-C to end. 19:19:04 msecs : count distribution 0 -> 1 : 238 |********* | 2 -> 3 : 424 |***************** | 4 -> 7 : 834 |********************************* | 8 -> 15 : 506 |******************** | 16 -> 31 : 986 |****************************************| 32 -> 63 : 97 |*** | 64 -> 127 : 7 | | 128 -> 255 : 27 |* | 19:19:14 msecs : count distribution 0 -> 1 : 427 |******************* | 2 -> 3 : 424 |****************** | […] Average latency (iostat/sar) may not be represen[[ve with mul[ple modes or outliers The "count" column is summarized in-kernel
  • 34. Identify multimodal disk I/O latency and outliers with biolatency # biolatency -mT 10 Tracing block device I/O... Hit Ctrl-C to end. 19:19:04 msecs : count distribution 0 -> 1 : 238 |********* | 2 -> 3 : 424 |***************** | 4 -> 7 : 834 |********************************* | 8 -> 15 : 506 |******************** | 16 -> 31 : 986 |****************************************| 32 -> 63 : 97 |*** | 64 -> 127 : 7 | | 128 -> 255 : 27 |* | 19:19:14 msecs : count distribution 0 -> 1 : 427 |******************* | 2 -> 3 : 424 |****************** | […] Average latency (iostat/sar) may not be represen[[ve with mul[ple modes or outliers The "count" column is summarized in-kernel
  • 35. Efficiently trace TCP sessions with PID and bytes using tcplife # /usr/share/bcc/tools/tcplife PID COMM LADDR LPORT RADDR RPORT TX_KB RX_KB MS 2509 java 100.82.34.63 8078 100.82.130.159 12410 0 0 5.44 2509 java 100.82.34.63 8078 100.82.78.215 55564 0 0 135.32 2509 java 100.82.34.63 60778 100.82.207.252 7001 0 13 15126.87 2509 java 100.82.34.63 38884 100.82.208.178 7001 0 0 15568.25 2509 java 127.0.0.1 4243 127.0.0.1 42166 0 0 0.61 2509 java 127.0.0.1 42166 127.0.0.1 4243 0 0 0.67 12030 upload-mes 127.0.0.1 34020 127.0.0.1 8078 11 0 3.38 2509 java 127.0.0.1 8078 127.0.0.1 34020 0 11 3.41 12030 upload-mes 127.0.0.1 21196 127.0.0.1 7101 0 0 12.61 3964 mesos-slav 127.0.0.1 7101 127.0.0.1 21196 0 0 12.64 12021 upload-sys 127.0.0.1 34022 127.0.0.1 8078 372 0 15.28 2509 java 127.0.0.1 8078 127.0.0.1 34022 0 372 15.31 2235 dockerd 100.82.34.63 13730 100.82.136.233 7002 0 4 18.50 2235 dockerd 100.82.34.63 34314 100.82.64.53 7002 0 8 56.73 [...] Dynamic tracing of TCP set state only; does not trace send/receive Also see: tcpconnect, tcpaccept, tcpretrans
  • 36. Efficiently trace TCP sessions with PID and bytes using tcplife # /usr/share/bcc/tools/tcplife PID COMM LADDR LPORT RADDR RPORT TX_KB RX_KB MS 2509 java 100.82.34.63 8078 100.82.130.159 12410 0 0 5.44 2509 java 100.82.34.63 8078 100.82.78.215 55564 0 0 135.32 2509 java 100.82.34.63 60778 100.82.207.252 7001 0 13 15126.87 2509 java 100.82.34.63 38884 100.82.208.178 7001 0 0 15568.25 2509 java 127.0.0.1 4243 127.0.0.1 42166 0 0 0.61 2509 java 127.0.0.1 42166 127.0.0.1 4243 0 0 0.67 12030 upload-mes 127.0.0.1 34020 127.0.0.1 8078 11 0 3.38 2509 java 127.0.0.1 8078 127.0.0.1 34020 0 11 3.41 12030 upload-mes 127.0.0.1 21196 127.0.0.1 7101 0 0 12.61 3964 mesos-slav 127.0.0.1 7101 127.0.0.1 21196 0 0 12.64 12021 upload-sys 127.0.0.1 34022 127.0.0.1 8078 372 0 15.28 2509 java 127.0.0.1 8078 127.0.0.1 34022 0 372 15.31 2235 dockerd 100.82.34.63 13730 100.82.136.233 7002 0 4 18.50 2235 dockerd 100.82.34.63 34314 100.82.64.53 7002 0 8 56.73 [...] Dynamic tracing of TCP set state only; does not trace send/receive Also see: tcpconnect, tcpaccept, tcpretrans
  • 37. Identify DNS latency issues system wide with gethostlatency # /usr/share/bcc/tools/gethostlatency TIME PID COMM LATms HOST 18:56:36 5055 mesos-slave 0.01 100.82.166.217 18:56:40 5590 java 3.53 ec2-…-79.compute-1.amazonaws.com 18:56:51 5055 mesos-slave 0.01 100.82.166.217 18:56:53 30166 ncat 0.21 localhost 18:56:56 6661 java 2.19 atlas-alert-….prod.netflix.net 18:56:59 5589 java 1.50 ec2-…-207.compute-1.amazonaws.com 18:57:03 5370 java 0.04 localhost 18:57:03 30259 sudo 0.07 titusagent-mainvpc-m…3465 18:57:06 5055 mesos-slave 0.01 100.82.166.217 18:57:10 5590 java 3.10 ec2-…-79.compute-1.amazonaws.com 18:57:21 5055 mesos-slave 0.01 100.82.166.217 18:57:29 5589 java 52.36 ec2-…-207.compute-1.amazonaws.com 18:57:36 5055 mesos-slave 0.01 100.82.166.217 18:57:40 5590 java 1.83 ec2-…-79.compute-1.amazonaws.com 18:57:51 5055 mesos-slave 0.01 100.82.166.217 […] Instruments using user-level dynamic tracing of getaddrinfo(), gethostbyname(), etc.
  • 38. Identify DNS latency issues system wide with gethostlatency # /usr/share/bcc/tools/gethostlatency TIME PID COMM LATms HOST 18:56:36 5055 mesos-slave 0.01 100.82.166.217 18:56:40 5590 java 3.53 ec2-…-79.compute-1.amazonaws.com 18:56:51 5055 mesos-slave 0.01 100.82.166.217 18:56:53 30166 ncat 0.21 localhost 18:56:56 6661 java 2.19 atlas-alert-….prod.netflix.net 18:56:59 5589 java 1.50 ec2-…-207.compute-1.amazonaws.com 18:57:03 5370 java 0.04 localhost 18:57:03 30259 sudo 0.07 titusagent-mainvpc-m…3465 18:57:06 5055 mesos-slave 0.01 100.82.166.217 18:57:10 5590 java 3.10 ec2-…-79.compute-1.amazonaws.com 18:57:21 5055 mesos-slave 0.01 100.82.166.217 18:57:29 5589 java 52.36 ec2-…-207.compute-1.amazonaws.com 18:57:36 5055 mesos-slave 0.01 100.82.166.217 18:57:40 5590 java 1.83 ec2-…-79.compute-1.amazonaws.com 18:57:51 5055 mesos-slave 0.01 100.82.166.217 […] Instruments using user-level dynamic tracing of getaddrinfo(), gethostbyname(), etc.
  • 39. Examine CPU scheduler latency as a histogram with runqlat # /usr/share/bcc/tools/runqlat 10 Tracing run queue latency... Hit Ctrl-C to end. usecs : count distribution 0 -> 1 : 2810 |* | 2 -> 3 : 5248 |** | 4 -> 7 : 12369 |****** | 8 -> 15 : 71312 |****************************************| 16 -> 31 : 55705 |******************************* | 32 -> 63 : 11775 |****** | 64 -> 127 : 6230 |*** | 128 -> 255 : 2758 |* | 256 -> 511 : 549 | | 512 -> 1023 : 46 | | 1024 -> 2047 : 11 | | 2048 -> 4095 : 4 | | 4096 -> 8191 : 5 | | […] As efficient as possible: scheduler calls can become frequent
  • 40. Examine CPU scheduler latency as a histogram with runqlat # /usr/share/bcc/tools/runqlat 10 Tracing run queue latency... Hit Ctrl-C to end. usecs : count distribution 0 -> 1 : 2810 |* | 2 -> 3 : 5248 |** | 4 -> 7 : 12369 |****** | 8 -> 15 : 71312 |****************************************| 16 -> 31 : 55705 |******************************* | 32 -> 63 : 11775 |****** | 64 -> 127 : 6230 |*** | 128 -> 255 : 2758 |* | 256 -> 511 : 549 | | 512 -> 1023 : 46 | | 1024 -> 2047 : 11 | | 2048 -> 4095 : 4 | | 4096 -> 8191 : 5 | | […] As efficient as possible: scheduler calls can become frequent
  • 41. Construct programmatic one-liners with trace # trace 'sys_read (arg3 > 20000) "read %d bytes", arg3' TIME PID COMM FUNC - 05:18:23 4490 dd sys_read read 1048576 bytes 05:18:23 4490 dd sys_read read 1048576 bytes 05:18:23 4490 dd sys_read read 1048576 bytes ^C argdist by Sasha Goldshtein # trace -h [...] trace –K blk_account_io_start Trace this kernel function, and print info with a kernel stack trace trace 'do_sys_open "%s", arg2' Trace the open syscall and print the filename being opened trace 'sys_read (arg3 > 20000) "read %d bytes", arg3' Trace the read syscall and print a message for reads >20000 bytes trace r::do_sys_return Trace the return from the open syscall trace 'c:open (arg2 == 42) "%s %d", arg1, arg2' Trace the open() call from libc only if the flags (arg2) argument is 42 [...] e.g. reads over 20000 bytes:
  • 42. Create in-kernel summaries with argdist # argdist -H 'p::tcp_cleanup_rbuf(struct sock *sk, int copied):int:copied' [15:34:45] copied : count distribution 0 -> 1 : 15088 |********************************** | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 4786 |*********** | 128 -> 255 : 1 | | 256 -> 511 : 1 | | 512 -> 1023 : 4 | | 1024 -> 2047 : 11 | | 2048 -> 4095 : 5 | | 4096 -> 8191 : 27 | | 8192 -> 16383 : 105 | | 16384 -> 32767 : 0 | | argdist by Sasha Goldshtein e.g. histogram of tcp_cleanup_rbuf() copied:
  • 44. BPF metrics and analysis can be automated in GUIs Flame Graphs Heat Maps Tracing Reports … Eg, Netflix Vector (self-service UI): Should be open sourced; you may also build/buy your own
  • 45. Latency heatmaps show histograms over time
  • 46. Optimize CPU flame graphs with BPF: count stacks in-kernel
  • 47. What about Off-CPU? Generic thread state digram
  • 48. Efficient Off-CPU flame graphs via scheduler tracing and BPF CPU Off-CPU Solve everything?
  • 49. Off-CPU Time (zoomed): gzip(1) Off-CPU doesn't always make sense: what is gzip blocked on?
  • 50. Wakeup time flame graphs show waker thread stacks
  • 51. Wakeup Time (zoomed): gzip(1) gzip(1) is blocked on tar(1)! tar cf - * | gzip > out.tar.gz Can't we associate off-CPU with wakeup stacks?
  • 52. Off-wake flame graphs: BPF can merge blocking plus waker stacks in-kernel Waker task Waker stack Blocked stack Blocked task Stack Direc[on Wokeup
  • 54. Chain graphs: merge all wakeup stacks
  • 56. BCC Improvements •  Challenges –  Initialize all variables –  BPF_PERF_OUTPUT() –  Verifier errors –  Still explicit bpf_probe_read()s. It's getting better (thanks): •  High-Level Languages –  One-liners and scripts –  Can use libbcc tcpconnlat.py
  • 57. ply •  A new BPF-based language and tracer for Linux –  Created by Tobias Waldekranz –  https://github.com/iovisor/ply https://wkz.github.io/ply/ –  Promising, was in development # ply -c 'kprobe:do_sys_open { printf("opened: %sn", mem(arg(1), "128s")); }' 1 probe active opened: /sys/kernel/debug/tracing/events/enable opened: /etc/ld.so.cache opened: /lib/x86_64-linux-gnu/libselinux.so.1 opened: /lib/x86_64-linux-gnu/libc.so.6 opened: /proc/filesystems opened: /usr/lib/locale/locale-archive opened: . [...]
  • 58. ply programs are concise, such as measuring read latency # ply -A -c 'kprobe:SyS_read { @start[tid()] = nsecs(); } kretprobe:SyS_read /@start[tid()]/ { @ns.quantize(nsecs() - @start[tid()]); @start[tid()] = nil; }' 2 probes active ^Cde-activating probes [...] @ns: [ 512, 1k) 3 |######## | [ 1k, 2k) 7 |################### | [ 2k, 4k) 12 |################################| [ 4k, 8k) 3 |######## | [ 8k, 16k) 2 |##### | [ 16k, 32k) 0 | | [ 32k, 64k) 0 | | [ 64k, 128k) 3 |######## | [128k, 256k) 1 |### | [256k, 512k) 1 |### | [512k, 1M) 2 |##### | [...]
  • 59. bpftrace •  Another new BPF-based language and tracer for Linux –  Created by Alastair Robertson –  https://github.com/ajor/bpftrace –  In active development # bpftrace -e 'kprobe:sys_open { printf("opened: %sn", str(arg0)); }' Attaching 1 probe... opened: /sys/devices/system/cpu/online opened: /proc/1956/stat opened: /proc/1241/stat opened: /proc/net/dev opened: /proc/net/if_inet6 opened: /sys/class/net/eth0/device/vendor opened: /proc/sys/net/ipv4/neigh/eth0/retrans_time_ms [...]
  • 60. bpftrace programs are concise, such as measuring read latency # bpftrace -e 'kprobe:SyS_read { @start[tid] = nsecs; } kretprobe:SyS_read /@start[tid]/ { @ns = quantize(nsecs - @start[tid]); @start[tid] = delete(); }' Attaching 2 probes... ^C @ns: [0, 1] 0 | | [2, 4) 0 | | [4, 8) 0 | | [8, 16) 0 | | [16, 32) 0 | | [32, 64) 0 | | [64, 128) 0 | | [128, 256) 0 | | [256, 512) 0 | | [512, 1k) 0 | | [1k, 2k) 6 |@@@@@ | [2k, 4k) 20 |@@@@@@@@@@@@@@@@@@@ | [4k, 8k) 4 |@@@ | [8k, 16k) 14 |@@@@@@@@@@@@@ | [16k, 32k) 53 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [32k, 64k) 2 |@ |
  • 63. Case Studies •  Use it •  Solve something •  Write about it •  Talk about it •  Recent posts: –  https://blogs.dropbox.com/tech/2017/09/optimizing-web-servers-for-high-throughput- and-low-latency/ –  https://josefbacik.github.io/kernel/scheduler/bcc/bpf/2017/08/03/sched-time.html
  • 64. Advanced Analysis •  Find/draw a functional diagram •  Apply performance methods –  http://www.brendangregg.com/methodology.html –  Workload Characterization –  USE Method –  Latency Analysis –  Start with the Q's, then find the A's •  Use multi-tools: –  funccount, trace, argdist, stackcount e.g., storage I/O subsystem
  • 65. Take aways 1.  Understand Linux tracing and enhanced BPF 2.  How to use eBPF tools 3.  Areas of future development BPF Tracing in Linux •  3.19: sockets •  3.19: maps •  4.1: kprobes •  4.3: uprobes •  4.4: BPF output •  4.6: stacks •  4.7: tracepoints •  4.9: profiling •  4.9: PMCs Please contribute: -  hHps://github.com/ iovisor/bcc -  hHps://github.com/ iovisor/ply Upgrade to Linux 4.9+!
  • 66. Links & References iovisor bcc: -  https://github.com/iovisor/bcc https://github.com/iovisor/bcc/tree/master/docs -  http://www.brendangregg.com/blog/ (search for "bcc") -  http://www.brendangregg.com/ebpf.html#bcc -  http://blogs.microsoft.co.il/sasha/2016/02/14/two-new-ebpf-tools-memleak-and-argdist/ -  On designing tracing tools: https://www.youtube.com/watch?v=uibLwoVKjec bcc tutorial: -  https://github.com/iovisor/bcc/blob/master/INSTALL.md -  …/docs/tutorial.md …/docs/tutorial_bcc_python_developer.md …/docs/reference_guide.md -  .../CONTRIBUTING-SCRIPTS.md ply: https://github.com/iovisor/ply bpftrace: https://github.com/ajor/bpftrace BPF: -  https://www.kernel.org/doc/Documentation/networking/filter.txt -  https://github.com/iovisor/bpf-docs -  https://suchakra.wordpress.com/tag/bpf/ Flame Graphs: -  http://www.brendangregg.com/flamegraphs.html -  http://www.brendangregg.com/blog/2016-01-20/ebpf-offcpu-flame-graph.html -  http://www.brendangregg.com/blog/2016-02-01/linux-wakeup-offwake-profiling.html Netflix Tech Blog on Vector: -  http://techblog.netflix.com/2015/04/introducing-vector-netflixs-on-host.html Linux Performance: http://www.brendangregg.com/linuxperf.html
  • 67. BPF @ Open Source Summit •  Making the Kernel's Networking Data Path Programmable with BPF and XDP –  Daniel Borkmann, Tuesday, 11:55am @ Georgia I/II •  Performance Analysis Superpowers with Linux BPF –  Brendan Gregg, this talk •  Cilium - Container Security and Networking using BPF and XDP –  Thomas Graf, Wednesday, 2:50pm @ Diamond Ballroom 6
  • 68. Thank You –  Questions? –  iovisor bcc: https://github.com/iovisor/bcc –  http://www.brendangregg.com –  http://slideshare.net/brendangregg –  bgregg@netflix.com –  @brendangregg Thanks to Alexei Starovoitov (Facebook), Brenden Blanco (PLUMgrid/VMware), Sasha Goldshtein (Sela), Teng Qin (Facebook), Yonghong Song (Facebook), Daniel Borkmann (Cisco/Covalent), Wang Nan (Huawei), Vicent Martí (GitHub), Paul Chaignon (Orange), and other BPF and bcc contributors!