-
Notifications
You must be signed in to change notification settings - Fork 623
Valgrind
Valgrind is useful for performing dynamic analysis. Valgrind tools can automatically detect many memory management and threading bugs, and profile Peloton in detail.
Here's the command for using memcheck for detecting common memory errors.
valgrind --trace-children=yes --track-origins=yes peloton -port 54321
valgrind --trace-children=yes --track-origins=yes ./test/catalog_test
Here's the command for using callgrind for profiling Peloton.
valgrind --tool=callgrind --trace-children=yes peloton &> /dev/null &
You can use kcachegrind for viewing the collected profile files (i.e. the callgrind.out.*
files).
kcachegrind
Suppose you want the Callgrind graph for a feature you implemented but the graph is getting skewed by other heavier options such as Inserts, you can turn profiling on/off during runtime through the following steps -
First Launch Valgrind and turn off instrumentation at start
valgrind --tool=callgrind --trace-children=yes --instr-atstart=no peloton -port 54321
When you want to start instrumentation, execute the following command on another shell window
callgrind_control -i on
Once you're done instrumenting, you can turn it off by running
callgrind_control -i off
You can turn on/off instrumentation multiple times within the same Valgrind session.