aboutsummaryrefslogtreecommitdiffhomepage
path: root/debug.txt
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2019-10-26 15:02:14 +0200
committerjohannst <johannes.stoelp@gmail.com>2019-10-26 15:02:14 +0200
commit128f0d09f07db89ead779a72ec37215e76b8d209 (patch)
tree002579d6010995cd18f713eef87b6780d6b67a9f /debug.txt
parent2520f38555c9afcd6bec50116807f8bf97311d43 (diff)
downloadnotes-128f0d09f07db89ead779a72ec37215e76b8d209.tar.gz
notes-128f0d09f07db89ead779a72ec37215e76b8d209.zip
added profiling info to debug notes
Diffstat (limited to 'debug.txt')
-rw-r--r--debug.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/debug.txt b/debug.txt
index 5a3c105..18f054d 100644
--- a/debug.txt
+++ b/debug.txt
@@ -23,17 +23,34 @@ pmap <pid>
# get supported events
perf list
+## show process stats
perf stat -p <pid>
perf stat -p <pid> -I <ms>
+# select events of interests
perf stat -p <pid> -e cycles,faults,cache-misses,context-switches
# -K hide kernel threads
perf top -F 99 -p <pid> -K
-perf record -F 99 -p <pid>
+## 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 <pid> -g
+# use post processing and dwarf to collect backtraces
perf record -F 99 -p <pid> --call-graph dwarf
perf record -F 99 -p <pid> -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