Perf is a set of Linux tools for command profiling.
sudo pacman -S perf
to install the performance analysis tool for Linuxperf list
to list all currently known eventsperf stat <command>
to get CPU counter statistics for the specified commandperf record <command>
to sample on-CPU functions for the specified commandperf report
to display perf.data (created by perf record)Links:
Flame graphs are visualizations of profiled software, allowing for the most frequence code paths to be identified quickly and accurately.
git clone https://github.com/brendangregg/FlameGraph
to acquire FlameGraph toolsperf record -F max -a -g -- ./<executable>
to capture executableperf script > out.perf
to read perf.data (created by perf record) and save trace output./FlameGraph/stackcollapse-perf.pl out.perf > out.folded
to fold stack samples into single lines./FlameGraph/flamegraph.pl out.folded > kernel.svg
to render a SVGbrave kernel.svg
to view the SVGLinks: