Dynamic Profiling

code profiler is a tool to analyze a program and report on its resource usage.

Here are few pages on callgrind :

What is Callgrind?

How to use Callgrind?

How to profile Callgrind results?

You can use gprof to analyze the data. You can download it from here.

You can use gporf according to this.