diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/perf.md | 22 |
1 files 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 <pid> .. show stats for running process @@ -18,7 +17,8 @@ perf record -p <pid> ............... record stats for running process -F <hz> ................ sampling frequency --call-graph <method> .. [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 <ev>: +Useful <ev>: 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 <pid> -e cpu-cycles +perf record -g -e cpu-cycles -p <pid> perf script | FlameGraph/stackcollapse-perf.pl | FlameGraph/flamegraph.pl > cycles-flamegraph.svg +``` -# flamegraphs for multiple events trace -perf record -g -p <pid> -e cpu-cycles,page-faults +### Flamegraph with multiple event traces +```markdown +perf record -g -e cpu-cycles,page-faults -p <pid> perf script --per-event-dump # fold & generate as above ``` |