# general statistics
perf stat ./main
# per function statistics with graph call
# -fno-omit-frame-pointer fals must be used to see proper call stack!!!
perf record --call-graph lbr --benchmark_min_time=2 ./main
perf report -g 'graph,0.5,caller' -s dso,sym,srcline ./main
Simple way to pass flags:
clang $(< flags)
#!/bin/bash
valgrind --tool=massif --depth=$1 --threshold=5 --pages-as-heap=no ./benchmark --benchmark_min_time=2 --benchmark_filter=*
ms_print massif.out.xxx > 2.txt
1 [2] (https://www.kdab.com/wp-content/uploads/stories/Linux_perf_for_Qt_developers.pdf)