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