1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-24 20:35:26 +02:00

valgrind: add page (#1407)

* valgrind: add page

* valgrind: tweak Memcheck example

Provide alternate, clearer syntax that functions the same and update
description accordingly.

* valgrind: correct program description

* valgrind: add list of common tools

* valgrind: remove general form example and add no-option example

* valgrind: replace period with colon in example 1
This commit is contained in:
Gabriel Totev 2017-06-12 05:07:22 -07:00 committed by Starbeamrainbowlabs
parent 10e9f9d2af
commit bf37b88bab

20
pages/common/valgrind.md Normal file
View file

@ -0,0 +1,20 @@
# valgrind
> Wrapper for a set of expert tools for profiling, optimizing and debugging programs.
> Commonly used tools include `memcheck`, `cachegrind`, `callgrind`, `massif`, `helgrind`, and `drd`.
- Use the (default) Memcheck tool to show a diagnostic of memory usage by `program`:
`valgrind {{program}}`
- Use Memcheck to report all possible memory leaks of `program` in full detail:
`valgrind --leak-check=full --show-leak-kinds=all {{program}}`
- Use the Cachegrind tool to profile and log CPU cache operations of `program`:
`valgrind --tool=cachegrind {{program}}`
- Use the Massif tool to profile and log heap memory and stack usage of `program`:
`valgrind --tool=massif --stacks=yes {{program}}`