From 4038f87747b78a62074309174558045e1adef939 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 17 Mar 2020 22:15:55 +0100 Subject: updated perf --- src/perf.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/perf.md b/src/perf.md index 003e164..57118ed 100644 --- a/src/perf.md +++ b/src/perf.md @@ -1,8 +1,7 @@ # perf(1) ```markdown -perf list - ......... show supported hw/sw events +perf list show supported hw/sw events perf stat -p .. show stats for running process @@ -18,7 +17,8 @@ perf record -p ............... record stats for running process -F ................ sampling frequency --call-graph .. [fp, dwarf, lbr] method how to caputre backtrace - fp : use frame-pointer, need -fno-omit-frame-pointer + fp : use frame-pointer, need to compile with + -fno-omit-frame-pointer dwarf: use .cfi debug information lbr : use hardware last branch record facility -g ..................... short-hand for --call-graph fp @@ -30,26 +30,26 @@ perf report -g graph,0.5,caller ... show caller based call chains with value >0.5 ``` -## Useful `perf` events - ```markdown -useful : +Useful : page-faults minor-faults major-faults cpu-cycles` task-clock - ``` +``` ## [`Flamegraph`](https://github.com/brendangregg/FlameGraph) +### Flamegraph with single event trace ```markdown -# flamegraph for single event trace -perf record -g -p -e cpu-cycles +perf record -g -e cpu-cycles -p perf script | FlameGraph/stackcollapse-perf.pl | FlameGraph/flamegraph.pl > cycles-flamegraph.svg +``` -# flamegraphs for multiple events trace -perf record -g -p -e cpu-cycles,page-faults +### Flamegraph with multiple event traces +```markdown +perf record -g -e cpu-cycles,page-faults -p perf script --per-event-dump # fold & generate as above ``` -- cgit v1.2.3