diff options
author | johannst <johannes.stoelp@gmail.com> | 2020-03-17 22:15:55 +0100 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2020-03-17 22:15:55 +0100 |
commit | 4038f87747b78a62074309174558045e1adef939 (patch) | |
tree | 0423cd222a6efbb5b9cc2c7d742e11cf1a3b84a2 /src | |
parent | a5d37af7eb006a48de3fe68ee53ddd2235c79647 (diff) | |
download | notes-4038f87747b78a62074309174558045e1adef939.tar.gz notes-4038f87747b78a62074309174558045e1adef939.zip |
updated perf
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 ``` |