-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathvalgrind
50 lines (31 loc) · 2.43 KB
/
valgrind
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
valgrind -v --track-fds=yes --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file="../logs/valgrind.log" ./eve-server
^^^this is verbose and tracking filedescriptors upon exit
valgrind -v --track-fds=yes --leak-check=full --track-origins=yes --log-file="../logs/valgrind.log" ./eve-server
^^^this is a bit less verbose and tracks filedescriptors
valgrind -v --track-fds=yes --leak-check=full --track-origins=yes --trace-children=yes --log-file="../logs/valgrind.log" ./eve-server
^^^same as above, and traces children also
valgrind -v --track-fds=yes --leak-check=full --show-leak-kinds=all --track-origins=yes --trace-children=yes --log-file="../logs/valgrind.log" ./eve-server
^^^same as above, adds full tracking
valgrind -v --track-fds=yes --leak-check=full --show-reachable=no --log-file="../logs/valgrind.log" ./eve-server
^^^this bit less verbose, doesnt show reachable, doesnt track origins(is faster), and is for *mostly* 'good' code
valgrind --tool=drd -v --show-stack-usage=yes --trace-fork-join=yes --log-file="../logs/drd.log" ./eve-server
^^^thread debugging tool.
valgrind --tool=callgrind ./eve-server
^^^this runs profiling tools and makes result called callgrind.out.x
*** run kcachegrind on above result ***
misc errata...
if a shared object is unloaded before the program terminates, Valgrind will discard the debug information and
the error message will be full of ??? entries
"definitely lost" means your program is leaking memory -- fix those leaks!
"indirectly lost" means your program is leaking memory in a pointer-based structure.
E.g. if the root node of a binary tree is "definitely lost", all the children will be "indirectly lost".
If you fix the "definitely lost" leaks, the "indirectly lost" leaks should go away.
"possibly lost" means your program is leaking memory, unless you're doing unusual things with pointers
that could cause them to point into the middle of an allocated block; see the user manual for some possible causes.
Use --show-possibly-lost=no if you don't want to see these reports.
"still reachable" means your program is probably ok -- it didn't free some memory it could have.
This is quite common and often reasonable.
Don't use --show-reachable=yes if you don't want to see these reports.
"suppressed" means that a leak error has been suppressed.
There are some suppressions in the default suppression files.
You can ignore suppressed errors.