Skip to main content
Active reading [<https://en.wikipedia.org/wiki/Valgrind#Other_tools> <https://en.wikipedia.org/wiki/Valgrind#Other_tools> <https://en.wikipedia.org/wiki/AMD_CodeAnalyst>]. Added some context.
Source Link
Peter Mortensen
  • 31.5k
  • 22
  • 110
  • 134

Use ValgrindValgrind, callgrindCallgrind and kcachegrindKCacheGrind:

valgrind --tool=callgrind ./(Your binary)

generates callgrind.out.xfile callgrind.out.x. Read it using kcachegrindKCacheGrind.

Use gprof (add -pg-pg):

cc -o myprog myprog.c utils.c -g -pg 

(not so good for multi-threads, function pointers)

Use google-perftools:

Uses time sampling, I/O and CPU bottlenecks are revealed.

Intel VTuneVTune is the best (free for educational purposes).

Others: AMD CodeanalystCodeAnalyst (since replaced with AMD CodeXLCodeXL), OProfileOProfile, 'perf'and 'perf' tools (apt-get install linux-toolsapt-get install linux-tools)

Use Valgrind, callgrind and kcachegrind:

valgrind --tool=callgrind ./(Your binary)

generates callgrind.out.x. Read it using kcachegrind.

Use gprof (add -pg):

cc -o myprog myprog.c utils.c -g -pg 

(not so good for multi-threads, function pointers)

Use google-perftools:

Uses time sampling, I/O and CPU bottlenecks are revealed.

Intel VTune is the best (free for educational purposes).

Others: AMD Codeanalyst (since replaced with AMD CodeXL), OProfile, 'perf' tools (apt-get install linux-tools)

Use Valgrind, Callgrind and KCacheGrind:

valgrind --tool=callgrind ./(Your binary)

generates file callgrind.out.x. Read it using KCacheGrind.

Use gprof (add -pg):

cc -o myprog myprog.c utils.c -g -pg

(not so good for multi-threads, function pointers)

Use google-perftools:

Uses time sampling, I/O and CPU bottlenecks are revealed.

Intel VTune is the best (free for educational purposes).

Others: AMD CodeAnalyst (since replaced with AMD CodeXL), OProfile, and 'perf' tools (apt-get install linux-tools)

corrected obvious typo, added detail regarding replacement of Codeanalyst with CodeXL
Source Link

Use Valgrind, callgrind and kcachegrind:

valgrind --tool=callgrind ./(Your binary)

generates callgrind.out.x. Read it using kcachegrind.

Use gprof (add -pg):

cc -o myprog myprog.c utils.c -g -pg 

(not so good for multi-threads, function pointers)

Use google-perftools:

Uses time sampling, reveals I/O and CPU bottlenecks are revealed.

Intel VTune is the best (free for educational purposes).

Others: AMD Codeanalyst (since replaced with AMD CodeXL), OProfile, 'perf' tools (apt-get install linux-tools)

Use Valgrind, callgrind and kcachegrind:

valgrind --tool=callgrind ./(Your binary)

generates callgrind.out.x. Read it using kcachegrind.

Use gprof (add -pg):

cc -o myprog myprog.c utils.c -g -pg 

(not so good for multi-threads, function pointers)

Use google-perftools:

Uses time sampling, reveals I/O and CPU bottlenecks are revealed.

Intel VTune is the best (free for educational purposes).

Others: AMD Codeanalyst, OProfile, 'perf' tools (apt-get install linux-tools)

Use Valgrind, callgrind and kcachegrind:

valgrind --tool=callgrind ./(Your binary)

generates callgrind.out.x. Read it using kcachegrind.

Use gprof (add -pg):

cc -o myprog myprog.c utils.c -g -pg 

(not so good for multi-threads, function pointers)

Use google-perftools:

Uses time sampling, I/O and CPU bottlenecks are revealed.

Intel VTune is the best (free for educational purposes).

Others: AMD Codeanalyst (since replaced with AMD CodeXL), OProfile, 'perf' tools (apt-get install linux-tools)

Source Link
Ehsan
  • 1.4k
  • 15
  • 13

Use Valgrind, callgrind and kcachegrind:

valgrind --tool=callgrind ./(Your binary)

generates callgrind.out.x. Read it using kcachegrind.

Use gprof (add -pg):

cc -o myprog myprog.c utils.c -g -pg 

(not so good for multi-threads, function pointers)

Use google-perftools:

Uses time sampling, reveals I/O and CPU bottlenecks are revealed.

Intel VTune is the best (free for educational purposes).

Others: AMD Codeanalyst, OProfile, 'perf' tools (apt-get install linux-tools)