From 128f0d09f07db89ead779a72ec37215e76b8d209 Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 26 Oct 2019 15:02:14 +0200 Subject: added profiling info to debug notes --- debug.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'debug.txt') diff --git a/debug.txt b/debug.txt index 5a3c105..18f054d 100644 --- a/debug.txt +++ b/debug.txt @@ -23,17 +23,34 @@ pmap # get supported events perf list +## show process stats perf stat -p perf stat -p -I +# select events of interests perf stat -p -e cycles,faults,cache-misses,context-switches # -K hide kernel threads perf top -F 99 -p -K -perf record -F 99 -p +## record measurement into db +# -g uses 'fb' = frame-pointer as default method to collect backtraces +# tell gcc to not optimize fp out -fno-omit-frame-pointer +perf record -F 99 -p -g +# use post processing and dwarf to collect backtraces perf record -F 99 -p --call-graph dwarf perf record -F 99 -p -e instructions,cpu-cycles,faults,cache-misses,context-switches +## report perf db +# print to stdio +perf report -n --stdio +# use tui +perf report -g graph,0.5,caller + +# flamegraph (https://github.com/brendangregg/FlameGraph) +# record events of interest, eg page-faults +perf stat -e page-faults -I 1000 -p 571 +perf script | FlameGraph/stackcollapse-perf.pl > out.perf-folded +FlameGraph/flamegraph.pl out.perf-folded > perf-trace.svg # print supported events ophelp -- cgit v1.2.3