| 1 | [[PageOutline]] |
| 2 | |
| 3 | == Perf profiling with perf |
| 4 | |
| 5 | [https://perf.wiki.kernel.org/index.php/Main_Page perf] |
| 6 | |
| 7 | === Using perf with the SDK |
| 8 | |
| 9 | The Flatpak SDK already provides perf. You don't need to install it on your host machine. To record a trace, use this command: |
| 10 | |
| 11 | {{{ |
| 12 | #!sh |
| 13 | $ WEBKIT_MINI_BROWSER_PREFIX="perf record -g" Tools/Scripts/run-minibrowser --gtk ... |
| 14 | }}} |
| 15 | |
| 16 | You don't necessarily need a debug build, but it's better to have one, or a release build configured as: |
| 17 | |
| 18 | {{{ |
| 19 | #!sh |
| 20 | $ Tools/Scripts/build-webkit --gtk --cmakeargs='-DCMAKE_BUILD_TYPE=RelWithDebInfo' --cmakeargs='-DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer"' |
| 21 | }}} |
| 22 | |
| 23 | To display the report: |
| 24 | |
| 25 | {{{ |
| 26 | #!sh |
| 27 | $ Tools/Scripts/webkit-flatpak -c perf report -g |
| 28 | }}} |
| 29 | |