-
Notifications
You must be signed in to change notification settings - Fork 505
Valgrind
Valgrind is useful for performing dynamic analysis. Valgrind tools can automatically detect many memory management and threading bugs, and profile Terrier in detail.
Here's the command for using memcheck for detecting common memory errors.
valgrind --trace-children=yes --track-origins=yes terrier -port 15721
valgrind --trace-children=yes --track-origins=yes ./debug/bitmap_test
Here's the command for using callgrind for profiling Terrier.
valgrind --tool=callgrind --trace-children=yes terrier &> /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 terrier -port 15721
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.
Carnegie Mellon Database Group Website