commit 5e6b1c865a1c18db3383b92633bb321f0997a12b Author: Jack Halford Date: Fri Feb 7 15:44:23 2020 +0100 first commit diff --git a/bcc_tracing_tools.png b/bcc_tracing_tools.png new file mode 100644 index 0000000..9d760b4 Binary files /dev/null and b/bcc_tracing_tools.png differ diff --git a/bpf_performance_tools_book.png b/bpf_performance_tools_book.png new file mode 100644 index 0000000..9f61131 Binary files /dev/null and b/bpf_performance_tools_book.png differ diff --git a/offcputracing-1000.png b/offcputracing-1000.png new file mode 100644 index 0000000..3a3eca7 Binary files /dev/null and b/offcputracing-1000.png differ diff --git a/tsa.png b/tsa.png new file mode 100644 index 0000000..8079bd7 Binary files /dev/null and b/tsa.png differ diff --git a/workshop1_slides.txt b/workshop1_slides.txt new file mode 100755 index 0000000..61a649f --- /dev/null +++ b/workshop1_slides.txt @@ -0,0 +1,65 @@ +#!/usr/bin/env sent + +# install sent with: +# git clone https://git.suckless.org/sent && cd sent && sudo make install + +#Welcome + +Choose a server to profile +- check top for activity +- open wavefront machine analysis +- check $(uname -r) before you start + +# wget http://www.brendangregg.com/Perf/bcc_tracing_tools.png +@bcc_tracing_tools.png + +# wget http://www.brendangregg.com/BPF/bpf_performance_tools_book.png +@bpf_performance_tools_book.png + + +\# For linux 4.4+ +sudo perf record -F99 -a -g -- sleep 30 +sudo perf script --header > stacks +------------------------------------------------------- +\# For linux 4.9+ +sudo profile -F99 -df 30 > stacks + +ctool scp d99-usw-2:stacks . +git clone https://github.com/brendangregg/FlameGraph.git && cd FlameGraph +./stackcollapse-perf.pl collapsed #ONLY FOR PERF/DTRACE +./flamegraph.pl flamegraph.svg +open flamegraph.svg + +kernel symbols? +- sudo apt install linux-image-$(uname -r)-dbgsym +- echo 0 | sudo tee /proc/sys/kernel/kptr_restrict +\ +ubuntu package symbols? +- sudo apt install $(pkgname)-dbgsym + +flamescope @ http://10.0.33.119:5000 + +refining the graphs +- filter by PID +- filter a given function call/syscall +- --color=js,java +- --color=io +- c++filt +\ +./stackcollapse-perf.html < out.stacks | grep do_command | c++filt | \ + ./flamegraph.pl --color=io --title="Block I/O Flame Graph" --countname="I/O" > out.svg + +#see http://www.brendangregg.com/blog/2014-11-09/differential-flame-graphs.html +"differential" flamegraphs +./difffolded.pl stacksA stacksB | ./flamegraph.pl > diff_flamegraph.svg + +@tsa.png + +@offcputracing-1000.png + +"off-cpu" flamegraphs (man offcputime) +-> sudo offcputime -df > stacks +also hot/cold flamegraphs (on+off cpu) + +"wakeup" flamegraphs +-> sudo wakeuptime -f > stacks