1 Valgrind is a powerful tool for performance and correctness analysis of code.
2 This mini-howto discusses how to set your development environment up,
3 such that you can profile a running olsr daemon and later analyze its
4 recordings using a graphical frontend called Kcachegrind.
6 First patch your makefile such that the debug symbols are not removed after
9 diff -r 26494c58ff86 Makefile.inc
10 --- a/Makefile.inc Wed Jan 09 22:01:18 2008 +0100
11 +++ b/Makefile.inc Thu Jan 10 14:46:27 2008 +0100
14 # activate debugging with 1 or deactivate with 0
17 # compile OLSR_PRINTF out
18 -NO_DEBUG_MESSAGES ?= 0
19 +NO_DEBUG_MESSAGES ?= 1
21 Next run valgrind with the following command line options.
23 valgrind --tool=callgrind -v --dump-instr=yes --trace-jump=yes ./olsrd -d 0 -nofork
25 Finally load kcachgrind to display the profiling data. (watch out the callgrind
26 data are written with a umask of 600 as user root - so you may want to chown or
27 chmod the file, otherwise kcachegrind cannot open your data and will display an