Profiling

From campisano.org
Jump to navigation Jump to search

profiling

perf tool

  • Produce profile data

Compile with '-ggdb' and '-fno-omit-frame-pointer' options as CFLAGS. An alternative exists, using the '--call-graph dwarf' option, however it apparently generates a lot of more disk data. To know more about such option, take a look at the link http://www.brendangregg.com/perf.html#StackTraces and use 'perf help record' to show all the options.


There are a lot of event that can be monitored, and they can be specified using the -e option. The default event is just 'cycles' (or 'cycles:pp' apparently), but the option accept multiple event types separated by a comma, like '-e cpu-clock,faults' for instance.

perf record -g --call-graph fp -- ./your_app your_args
  • Visualization
perf report -n -g graph

valgrind tool

valgrind --tool=callgrind --callgrind-out-file=I100_Ooriginal_S26_FS10_FB05_MS0.grind ./stsm 100_sax-26_sample-46x951.csv I100_Ooriginal_S26_FS10_FB05_MS0.js\
onn I100_Ooriginal_S26_FS10_FB05_MS0.log 10 05
qcachegrind I100_Ooriginal_S26_FS10_FB05_MS0.grind

References